Commit Graph

88 Commits

Author SHA1 Message Date
Donatas Abraitis
e40b713015 tests: Log as error if some of the daemons are missing
Also print runtime directory for topotests if the error occurs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-20 21:45:06 +03:00
Kuldeep Kashyap
e13f9c4f31 tests: [PIMv6] APIs for multicast PIMv6 config
Enhanced few exsiting PIM APIs to support both
IPv4 and IPv6 configuration. Added few new APIs
for PIMv6. Tested all existing tests with new
API changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-23 21:28:35 -07:00
Donald Sharp
b515c81a22 tests: Fix spelling of 'registred'
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:09:36 -04:00
Jafar Al-Gharaibeh
93a7f236ac topotest: enable pim when detecting pim using unified config
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-15 22:29:52 -05:00
Jafar Al-Gharaibeh
a4b4bb5077 topotests: add support for frr.conf as a unified config
This PR adds support for configuring topotest routers using a single file.
  instead of:
```
        router.load_config(
	    TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
	    )
	router.load_config(
	    TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
	    )
	router.load_config(
	    TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
	    )
```
  you can now do:
```
        router.load_frr_config(
	    os.path.join(CWD, "{}/frr.conf".format(rname)),
	    [TopoRouter.RD_ZEBRA, TopoRouter.RD_OSPF, TopoRouter.RD_BGP]
	    )
```
or just:

```
        router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
```
In this latter case, the daemons list will be inferred from frr.conf file.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-02-27 20:53:18 -06:00
Hiroki Shirokura
c84159a90a topotests: update file format and resolving id
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 07:07:18 +00:00
Hiroki Shirokura
e03862c34a topotests: to create pid file of topotest router
Create a pid file for the router created by topotest.
By executing nsenter directly against this pid, developers
can execute commands directly from outside the unet shell.
This allows the developer to use script, tab completion, etc.,
and improves efficiency.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 03:55:04 +00:00
Christian Hopps
0254774578 tests: refactor parallel reset/load config for non-json
Refactor the bgp_auth test to create common_config code to allow
non-json based tests to reset routers and load configs in parallel.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-06 11:18:48 -04:00
Christian Hopps
a53c08bc13 tests: cleanup: rerun changed files through black
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
2905398814 tests: add generic exa-receive.py script
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
04464749b6 tests: keep revisions of configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
fe50239bc6 tests: remove legacy Topo class from infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
4958158787 tests: micronet: update infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
35c4c991f0 tests: reset router configs in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-03 09:07:49 +00:00
Christian Hopps
0ba1d257be tests: add triage features: strace, asan-abort, docker exec
TMUX and Screen support when running topotests inside docker. This
allows the gdb, shell and vtysh features to correctly work even when
running the tests inside docker.

Add options:
--asan-abort :: aborts the process on ASAN errors
--strace-daemons :: strace some or all daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-14 15:55:40 -04:00
Christian Hopps
e58133a78e tests: add valgrind memleaks run options and detection
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-16 02:56:15 -04:00
Rafael Zalamena
ab59579a12 topotests: support adding hosts
Add API to topogen so we can build topology with simple hosts instead
of routers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-09 12:32:24 -03:00
Igor Ryzhov
cac0ed050e tests: don't complain when /tmp/topotests exists
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-03 14:22:15 +03:00
Babis Chalios
92be50e63e tests: API to launch snmpd in a topotest scenario
Prepare the infrastructure to allow configuring and launching an SNMP
daemon as part of testing scenario.

Signed-off-by: Babis Chalios <babis@voltanet.io>
Signed-off-by: Pat Ruddy Chalios <pat@voltanet.io>
2021-01-11 14:36:40 +00:00
Mark Stapp
d4473065f4
Merge pull request #7759 from qlyoung/reformat-tests-again
Reformat tests again
2020-12-23 08:11:00 -05:00
Sebastien Merle
4d7b695d3a pathd: New SR-TE policy management daemon
This new daemon manages Segment-Routing Traffic-Engineering
(SR-TE) Policies and installs them into zebra. It provides
the usual yang support and vtysh commands to define or change
SR-TE Policies.

In a nutshell SR-TE Policies provide the possibility to steer
traffic through a (possibly dynamic) list of Segment Routing
segments to the endpoint of the policy. This list of segments
is part of a Candidate Path which again belongs to the SR-TE
Policy. SR-TE Policies are uniquely identified by their color
and endpoint. The color can be used to e.g. match BGP
communities on incoming traffic.

There can be multiple Candidate Paths for a single
policy, the active Candidate Path is chosen according to
certain conditions of which the most important is its
preference. Candidate Paths can be explicit (fixed list of
segments) or dynamic (list of segment comes from e.g. PCEP, see
below).

Configuration example:

segment-routing
 traffic-eng
  segment-list SL
   index 10 mpls label 1111
   index 20 mpls label 2222
  !
  policy color 4 endpoint 10.10.10.4
   name POL4
   binding-sid 104
   candidate-path preference 100 name exp explicit segment-list SL
   candidate-path preference 200 name dyn dynamic
  !
 !
!

There is an important connection between dynamic Candidate
Paths and the overall topic of Path Computation. Later on for
pathd a dynamic module will be introduced that is capable
of communicating via the PCEP protocol with a PCE (Path
Computation Element) which again is capable of calculating
paths according to its local TED (Traffic Engineering Database).
This dynamic module will be able to inject the mentioned
dynamic Candidate Paths into pathd based on calculated paths
from a PCE.

https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-06

Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18 16:34:02 +01:00
whitespace
9fa6ec1473 tests: please follow the style guide
thanks

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-17 15:32:55 -05:00
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