The code was not attempting to set the max platform_labels
on a per router basis, leaving us w/ situations where
mpls install would fail because platform_labels was 0.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In a effort to migrate more tests to use `run_and_expect` instead of
`sleep`s, this commit imports some common functions used to compare
router output. Retrying output comparison for N times, instead of
relying on arbitrary code `sleep`s, should help CI system tests fail
less and possibly run for less time.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
When normalizing a text also remove trailing whitespace since external
tools might add them. This commit fixes a test failure in ospf_topo1 on
Ubuntu 18.04.1.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Standardize run_and_expect to show start and end time along with maximum
estimated wait time.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Don't quit on the first match. While here add some more `json_cmp` tests
to make sure this doesn't happen again.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Allow json_cmp to compare JSON values which begin with a list instead of
a dictionary.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
topotest library is being added a new parameter when preparing the
configurationof each daemon. This parameter will be used to call the
daemon with some extra parameters. The -n parameter for zebra is taken
into account.
Also, when a extra parameter is given for calling zebra, a check is done to
see if it is possible to run zebra daemon with that option. This is the
case for vrfwnetns option. If not available, an error message is sent
back.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Remove PID files after a SIGKILL or confirmation that the pid file no
longer contains a running PID.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
The messages level of this commit were downgraded because some of them
happen on 'non-error' situations. This should help diminish the error
log verbosity on the CI-system run.
It was found a regression on an edge case when the second number in the
comparison was (at least) 2 numbers longer the comparison would fail
with a wrong return value. It succeeded for some cases because the
first comparison in the exception was correct, but not the second.
Standardized function that removes format spaces (or tab) and carriage
returns characters. This function is useful to allow output text
processing without breaking diff capabilities.
Output example:
*N IA 2001:db8:2::/64 :: r2-eth0 00:03:39
Becomes:
*N IA 2001:db8:2::/64 :: r2-eth0 00:03:39
If you remove 'IA' you won't have space formatting problem anymore.
TopoRouters now create a logger (which logs to /tmp/{router_name}.log)
on start to record all commands and events that it goes through. All log
messages contain timestamps that may be used in the future to:
(1) correlate commands call with events
(2) benchmark/time command speed
Use a configuration file for casual settings like:
* Verbosity level (helps when debugging mininet issues)
* Custom daemon directory (in order to support running different daemon
binaries without touching tests)
* Daemon type switch: allow running quagga without touching any test
files
Also fix the add_router() documentation to include all options.
Create a specialized assert and json_cmp() result to improve the
comparison output. With this we also got a way to display all comparison
failures instead of just the first one.
Implemented a JSON compare function that tells you when a specific
subset of items exist or not inside a JSON dataset.
More details can be found in the function docstring or in the test file
lib/test_json.py.
Topogen (Topology Generator) is a helper that wraps around Topotest to
simplify some of the boilerplate code. This abstraction will help the
development of new tests and new APIs without breaking the existing
ones. It also makes the relation of objects clearer, since we no longer
touch the Mininet API directly, which in turn also makes us less
vulnerable to external API changes.
Implemented two functions to help setting sysctl values:
* set_sysctl: set a sysctl and return an auditable return value
* assert_sysctl: uses the previous function to assert that the sysctl
was set
Fixes the issue for topotest to fail ot end of skipped LDP test on
a system without MPLS support
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
When we have a kernel sub version > 10 the float conversion
of the kernel version causes 4.10 to be less than 4.5
Get the kernel version in groups on <major>.<minor> and do
comparison that way
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>