Donald Sharp
46a0656f7a
tests: Close some open handles
...
I accidently installed something that is telling me about
unlosed handles in the tests. Let's clean them up.
<and yes I have no idea wtf I did>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-05 20:05:52 -05:00
Martin Winter
1a31ada871
tests: Fix FRR process shutdown in failed topotest teardown phase
...
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:14 +01:00
whitespace
701a01920e
*: reformat python files
...
We are now using black.
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-07 17:22:26 -04:00
Mark Stapp
11761ab0f4
tests: python3 compat fixes for topotests: tabs and misc
...
Use only spaces in python files; no tabs; also a couple of small
api fixes.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Donald Sharp
622c4996ef
tests: Our tests are for FRR
...
These tests at this point only work for FRR. Let's cut to the chase
and admit it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>`
2020-09-22 10:11:58 -04:00
Mark Stapp
e5f0ed147b
tests: use .items instead of .iteritems in topotests
...
Avoid py2-only .iteritems() api.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-18 15:55:23 -04:00
Mark Stapp
942a224eae
tests: fix router stop logic
...
Change the public router stop method to always do a two-phase
shutdown - once without waiting and a second time with a wait.
Ordinary callers need to use this approach when stopping routers.
Move the detailed internal details to a private method that tests
should not call directly.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-25 10:52:17 -04:00
Mark Stapp
d2bdb82ffd
tests: stop daemons consistently in mem leak path
...
When the topotest mem-leak reporting is enabled, use the same
two-step daemon stop procedure that's used in
the topogen.stop_topology path.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-06 11:47:12 -04:00
Jakub Urbańczyk
9b7decf28e
topotest: add pbr test suite
...
Add some basic tests for installing PBR rules into the kernel.
Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-06-10 16:29:14 +02:00
Donald Sharp
223f87f4db
tests: Setup very basic pbr tests for our topology tests
...
Just a simple setup for pbr to prove it starts. Once the json
code for pbr gets in we can add more.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-29 16:56:14 -04:00
Donald Sharp
a0764a368f
tests: Turn on nhrpd and babeld as part of all-protocol-startup
...
Turn on a few more daemons to run during this test.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-23 19:44:04 -04:00
Kuldeep Kashyap
c65a7e26dc
tests: Enhance topotests scripts to kill/start specific Daemons
...
1. Added APIs to topogen.py and topotest.py to kill/start specific Daemons,
ex - bgpd, staticd
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-04 17:15:55 +00:00
reformat
787e762445
tests: Run python formatter (black) for topotests
...
Mostly ' => ", whitespace changes.
Using https://github.com/psf/black
Signed-off-by: reformat <reformat@nobody.nobody>
2020-04-03 19:41:28 +03:00
Renato Westphal
a89241b42d
topotest: enable MPLS processing on all interfaces by default
...
This is necessary to make some tests work correctly. Only topologies
created using the topogen framework benefit from this change.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-11-04 13:05:47 -03:00
Lou Berger
a38f008303
topotests/lib: support sharpd and other daemons in lutils
...
needs both <daemon>.conf and <daemon> to be present
Signed-off-by: Lou Berger <lberger@labn.net>
2019-05-15 21:26:13 +00:00
Mark Stapp
a07e17d5e7
topotest: fixes to support python3
...
Make some small changes to support both python 2 and 3.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-30 11:31:02 -04:00
Rafael Zalamena
87ba6e1e3a
topotests/lib: fix router specific log output
...
Change the router log output to the previous folder so it doesn't get
erased when starting the old API (unbreaks command/output logging on
Topogen).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-03-25 15:16:12 -03:00
Donald Sharp
af99f19eb2
topotests: Cleanup diagnose_env to allow thought about multi-platforms
...
Start the cleanup of diagnose_env to allow the running of topotests
on platforms besides linux.
So we split up diagnose_env into linux and freebsd variants.
At this point in time freebsd doesn't have any special code.
To be determined in the future.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-15 10:49:59 -05:00
Rafael Zalamena
4d45d6d3b0
topogen/topotest: add support for BFDd
...
Allow BFDd to be configured and used.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Philippe Guibert
0ab7733f7f
lib: topogen support for link_enable on other netns
...
In the case where vrf backend is based on NETNS, the link enable command
switches from context so as to perform the command.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Christian Franke
f2d6ce41ca
lib: check presence of mpls modules, not exitcode of modprobe
...
Signed-off-by: Christian Franke <nobody@nowhere.ws>
2018-11-27 20:22:14 -05:00
Martin Winter
a2a1134c77
lib: Add support for staticd
...
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Lou Berger
fb80b81b26
lib: add and use Router.checkRouterVersion (based on bdpd version)
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
95460a6b7e
lib: collect and report shutdown errors across whole topology
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
b0f0d980b5
lib: allow all rw access to /tmp/topotests (for package support and debug)
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
deb4cef09a
lib: log to start/local (per node) dir, log commands
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
e1dfa45e1b
lib: convert to directories per node
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
87d5e16a45
lib: TopoExaBGP.start - report unexpected exabgp output
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:13 -05:00
Philippe Guibert
8dd5077d81
lib: zebra support for vrfwnetns parameter
...
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>
2018-11-27 20:22:13 -05:00
Lou Berger
9711fc7e0b
lib: add tgen level mpls init and hasmpls flag
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:13 -05:00
Lou Berger
447f2d5a16
lib: add router.has_mpls check
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:13 -05:00
Rafael Zalamena
46325763aa
topogen: fix assertion on routers_have_failure
...
`errors != ''` is never going to be false so the assert was never being
triggered.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:13 -05:00
Rafael Zalamena
0e17ee9e03
topogen: import pytest assert function
...
Use the pytest assert function to be able to report to pytest failures
that happened inside the API.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:13 -05:00
Lou Berger
3a568b9ca6
lib: speed up router shutdown stopRouter: report when a process is being killed only sleep if actually killed a process add option to not sleep or conduct -7 kill topogen stop: add wait parameter (defaults to old/wait) when stopping routers, first stop all without waiting then do a second pass where will wait if needed
...
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:12 -05:00
Rafael Zalamena
222ea88b2a
topotest/topogen: demote some messages level
...
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.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
fcfbc7696b
topogen: fix diagnostics failure
...
Don't try to log to file if directory doesn't exist.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
d34f613477
topogen: save zebra version output
...
Keep the zebra version output for later problem diagnostics.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
7547ebd8cd
topogen: log diagnostics to file
2018-11-27 20:22:12 -05:00
Rafael Zalamena
c267e5b112
topogen: add support for eigrpd and nhrp
2018-11-27 20:22:12 -05:00
Rafael Zalamena
57c5075b7b
topogen: router startup failure triggers errors
...
Makes `router_have_failure()` detect frr startup errors.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
b3b1b1d16c
topogen: treat some corner cases on vtysh failure
...
Don't throw unneeded tracebacks when 'show version' doesn't show us what
we expect, instead gracefully fail.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
1eb633c012
topogen: show pretty output for skipped messages
...
Format them properly instead of printing a dictionary.
2018-11-27 20:22:12 -05:00
Martin Winter
c11c4cc7d3
lib: add check for mpls kernel modules to diagnose_env()
...
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:12 -05:00
Rafael Zalamena
f9b48d8b42
topogen: allow daemon spec in vtysh_cmd
...
Allow commands to be run per-daemon basis. While here make daemon
logging file configuration per-daemon.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
812e38a94d
topotests: make 'quagga' check optional
...
Only check for quagga directories and binaries when we don't find FRR.
Also fix a copy-paste error in warning message.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
007e731324
topotest: implement environment diagnostics
...
Run environment diagnostics on topotest start, report all detected
problems and abort if an error condition is met.
2018-11-27 20:22:12 -05:00
Rafael Zalamena
6ca2411e86
topogen: add equipment version handling
...
Added helper functions to TopoRouter to test equipment version and type.
2018-11-27 20:22:11 -05:00
Rafael Zalamena
7b093d84e0
topogen: handle JSON decode failures
...
Instead of raise()ing, return a empty dictionary.
2018-11-27 20:22:11 -05:00
Rafael Zalamena
78ed61230c
topogen: implement router check method
...
Use a standard function to do 'router running checks' instead of having
to duplicate the code in every test.
2018-11-27 20:22:11 -05:00
Rafael Zalamena
e84692970b
topogen: fix topogen memleak activation
...
When memleak_path is present in the configuration file it means that it is
activated.
2018-11-27 20:22:11 -05:00