summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topogen.py
AgeCommit message (Collapse)Author
2025-03-12tests: Add an ability to specify daemon params with unified configDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-03-12tests: detect all daemons correctly when using frr.confJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-03-04tests: Add ability to run a fpm listenerDonald Sharp
Add the ability to run a fpm listener to the testing system. This is nothing more just allowing the test system to bring it up. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-02-29topotests: apply black on bmp collectorLouis Scalbert
Apply black on bmp collector Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-02-29topotests: bgp_bmp, log bmp into tgen logdirLouis Scalbert
Log BMP into tgen logdir to facilitate the debug. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-27lib: set up `frr_libstatedir`David Lamparter
This needs to be used for persistent state, which currently is misplaced into `/var/run` / `/run` where it gets deleted across reboots. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-12-14topotests: create exabgp cli fifoLouis Scalbert
Create reate exabgp cli fifo even it is not used in topotests to avoid this error message: > 16:21:42 | 2290205 | cli | could not find the named pipes (exabgp.in and exabgp.out) required for the cli > 16:21:42 | 2290205 | cli | we scanned the following folders (the number is your PID): > 16:21:42 | 2290205 | cli control | - /run/exabgp/ > 16:21:42 | 2290205 | cli control | - /run/0/ > 16:21:42 | 2290205 | cli control | - /run/ > 16:21:42 | 2290205 | cli control | - /var/run/exabgp/ > 16:21:42 | 2290205 | cli control | - /var/run/0/ > 16:21:42 | 2290205 | cli control | - /var/run/ > 16:21:42 | 2290205 | cli control | - /usr/local/run/exabgp/ > 16:21:42 | 2290205 | cli control | - /usr/local/run/0/ > 16:21:42 | 2290205 | cli control | - /usr/local/run/ > 16:21:42 | 2290205 | cli control | - /usr/local/var/run/exabgp/ > 16:21:42 | 2290205 | cli control | - /usr/local/var/run/0/ > 16:21:42 | 2290205 | cli control | - /usr/local/var/run/ > 16:21:42 | 2290205 | cli control | please make them in one of the folder with the following commands: > 16:21:42 | 2290205 | cli control | > mkfifo //run/exabgp.{in,out} > 16:21:42 | 2290205 | cli control | > chmod 600 //run/exabgp.{in,out} Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14topotests: log exabgp by defaultLouis Scalbert
Log exabgp by default in /tmp/topotests/<testname>/<peername>/exabgp.log Level is INFO. Note that in case the configuration syntax is invalid, exabgp does not log into the file and exits at startup. You can check a configuration syntax by running: > exabgp <exabgp.cfg> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14topotests: look for python3 exabgpLouis Scalbert
Look for python3 exabgp instead of python2. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14topotests: require exabgp version >= 4.2.11Louis Scalbert
Require exabgp >= 4.2.11 to allow to newer version to run exabgp topotests. Next commits will adapt the exabgp topotests when needed. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-10-24tests: lib add support of snmptrapd daemonFrancois Dumontet
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-07-12topotests: add basic bmp collectorFarid Mihoub
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-06-05tests: fix some broken loggingChristian Hopps
- make sure we close and remove all handlers for named logs on each reuse. - test module level exec.log no longer truncated to last test case output - cleanup the log names, and make sure they are present in all exec logs - keep separate exec logs for each pytest worker when running in distributed mode - disabled code due to CI infra can't handle it: add per test case exec logs Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-26tests: cleanup the config file specification and default codeChristian Hopps
Also, add a new warning for missing configuration files when user is expecting them. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29tests: change topotest log timestamp precision to 6.Christian Hopps
- Often millisecond precision is not good enough to differentiate things that occur directly one after another, and things that have some pause in between, increase to microsecond precision (reporting) Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: add --pcap and --pause-at-end optionsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: cleanup access to pytest configChristian Hopps
Rather than create a new global dict and copy all the config into it, just expose the pytest config globally and use it directly. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: blacken re-formatChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17Merge pull request #13230 from LabNConsulting/micronet-is-munetDonald Sharp
Micronet is munet
2023-04-17tests: use `shlex.quote` to pass command arg to vtyshChristian Hopps
This makes sure any included quotation is properly escaped and passed through to vtysh. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15tests: switch to munetChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07tests: don't warn with expected resultsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07tests: initialize parent test namespace tooChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07tests: cleanup infraChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-04tests: lower logging level on some infra logsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-22tests: Add topotests for MGMT daemonnguggarigoud
1. MGMT daemon support in topotests. 2. Sanity tests for MGMTd. Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-08-20tests: Log as error if some of the daemons are missingDonatas Abraitis
Also print runtime directory for topotests if the error occurs. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-23tests: [PIMv6] APIs for multicast PIMv6 configKuldeep Kashyap
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-04-19tests: Fix spelling of 'registred'Donald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-15topotest: enable pim when detecting pim using unified configJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-02-27topotests: add support for frr.conf as a unified configJafar Al-Gharaibeh
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>
2021-09-07topotests: update file format and resolving idHiroki Shirokura
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07topotests: to create pid file of topotest routerHiroki Shirokura
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-06tests: refactor parallel reset/load config for non-jsonChristian Hopps
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-04tests: cleanup: rerun changed files through blackChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04tests: add generic exa-receive.py scriptChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04tests: keep revisions of configsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04tests: remove legacy Topo class from infraChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04tests: micronet: update infraChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-03tests: reset router configs in parallelChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-14tests: add triage features: strace, asan-abort, docker execChristian Hopps
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-06-16tests: add valgrind memleaks run options and detectionChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-09topotests: support adding hostsRafael Zalamena
Add API to topogen so we can build topology with simple hosts instead of routers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-03tests: don't complain when /tmp/topotests existsIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-01-11tests: API to launch snmpd in a topotest scenarioBabis Chalios
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>
2020-12-23Merge pull request #7759 from qlyoung/reformat-tests-againMark Stapp
Reformat tests again
2020-12-18pathd: New SR-TE policy management daemonSebastien Merle
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-17tests: please follow the style guidewhitespace
thanks Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-05tests: Close some open handlesDonald Sharp
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>