summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topotest.py
AgeCommit message (Collapse)Author
2025-03-09tests: Have zebra startup look for the zserv.api socketDonald Sharp
Ensure that the zserv.api socket is actually up and running before moving onto other daemons after zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 009f42dd5bd02eb5ee0bd9852704357c6bc7aaa1)
2025-03-09tests: Allow mgmtd and zebra to fully come up before other daemonsDonald Sharp
Currently the topotest infrastructure is starting up daemons in mgmtd,zebra, staticd then everything else. The problem that is happening, under heavy load, is that zebra may not be fully started and when a daemon attempts to connect to it, it will not be able to connect. Some of the daemons do not have great retry mechanisms at all. In addition our normal systemctl startup scripts actually wait a small amount of time for zebra to be ready before moving onto the other daemons. Let's make topotests startup a tiny bit more nuanced and have mgmtd fully up before starting up zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit dd609bc069857a38ff3577b76d0b9ef708b8d2aa)
2025-01-15tests: use global -w option instead of per-daemon -nIgor Ryzhov
Add ability to enable -w option for all daemons in a topotest and use this option instead of the deprecated -n. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-11-12tests: add support for ospf instances with unified configsJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-31tests: Do not set by default netlink receive buffer size for ZebraDonatas Abraitis
If we want to override this value - we can't because it's set by default to 90000000. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-17tests: logger masked in topotest.pyLiam Brady
a local logger masks the global logger and prevents errors from being gracefully handled within topotest.py Signed-off-by: Liam Brady <lbrady@labn.net>
2024-09-18tests: use logger.warning not logger.warnDonald Sharp
Apparently logger.warn is being deprecated. So let's switch over to logger.warning. Clearly it's better Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-13tests: Adjust minimum wait/count timers for run_and_expect() if they are too lowDonatas Abraitis
If the developer pass way too low timers, we end up with most likely false-positive situations for random tests under a high load of the system. It would be better to fallback to the minimum default values for such a cases. E.g.: ``` WARNING: topo: Waiting time is too small (count=1, wait=0.5), using default values (count=20, wait=3) ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-11tests: Convert self.unified_config to booleanDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-11topotests: add API to detect if iproute2 is json capablePhilippe Guibert
Some tests may want to use the json facility of iproute2 to dump some results. Add an internal API in lib/topotest.py that tells whether iproute2 is json capable or not. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-27tests: Apply black formatting for all tests/topotestsDonatas Abraitis
It's just annoying when the linter tells to apply the formatting for the code you didn't touch. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-03topotests: fix ignore routes with linkdownPhilippe Guibert
In topotest, a given interface has only the ignore routes bit turned on for IPv6 only, whereas topotest is expected to turn it on for all address families. > # show interface > Interface r2-r3-eth2 is up, line protocol is up > [..] > flags: <UP,BROADCAST,RUNNING,MULTICAST> > Ignore all v6 routes with linkdown > Type: Ethernet > [..] This is because the only the 'default' ipv6 ignore sysctl is set to 1. Set also the /proc/sys/net/conf/<family>/default/ignore_routes_with_linkdown flag, to have same behaviour for ipv4 and ipv6. Fixes: 4958158787ce ("tests: micronet: update infra") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-03-17tests: required formatting changeChristian Hopps
This code wasn't touched by the actual change; however, the formatting fix is required. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-17tests: enable code coverage reporting with topotestsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
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>
2023-12-01tests: add support for running things under `rr`.Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-07tests: add ability to show all types of valgrind memleaksChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-30tests: add gdb integration with valgrindChristian Hopps
Allows you to run daemons under valgrind integrated with gdb. When daemons are run with the ``--gdb-daemons/--gdb-routers`` options they will be wired up to valgrind using vgdb (valgrind tool) so gdb will stop when valgrind errors are encountered. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-24Merge pull request #14333 from fdumontet6WIND/bgp4v2_snmpDonatas Abraitis
bgpd: add support of traps for bgp4-mibv2
2023-10-24tests: lib add support of snmptrapd daemonFrancois Dumontet
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-10-23tests: add --gdb-use-emacs optionChristian Hopps
When specified `--gdb-use-emacs` will launch the daemon with gdb inside a running emacs server using `emacsclient --eval` commands. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-08-01tests: Convert d1 and d2 to output and expected in gen_json_diff_reportDonald Sharp
The output of gen_json_diff_report is used all over the place and it outputs d1 and d2. Let's change this to output and expected as that is how it is used. Should help with debugging. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-01tests: Run black over lib/topotest.pyDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-01tests: Start using output and expected vs d1 and d2Donald Sharp
Let us start using output and expected in lib/topotest.py because when we see output it is confusing what d1 is versus what d2 is. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-14tests: fix/improve the printing of backtrace from coresChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-07-10tests: Do not remove core filesDonald Sharp
Tests are removing core files and we are missing some of them because of this. Signed-off-by: Donald Sharp <sharpd@nvidia.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-28tests: python-foo assure foo[0] is on a list not dict_values objectChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-26tests: Convert to using logger.warningDonald Sharp
Use the non deprecated format. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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-05-24munet: import 0.13.5 w/ nicer cmd loggingChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-17tests: fix implicit config file and recently added logic errorChristian Hopps
- Restore default of looking for a daemon config underneath the router directory if no config file was specified. - Recent change for adding unified config support had a logic bug, fix - Update the one test that conflicted with this default - comment out asyncio option causing warnings if asyncio wasn't installed. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-11topotests: fix looging of memstat resultsLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2023-04-23tests: add --perf and --perf-options for profiling daemonsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-22tests: fix ASAN file cleanup and --asan-abort optionChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: will need new pid_exists if using pid namespacesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: fix check for daemon startup, remove sleep hackChristian Hopps
- Remove the .pid and .vty files and then wait for them to show back up. - Fix broken BGP GR test to not fail now that it's bug is exposed. It only worked b/c when starting a daemon the pid file still existed and blocked the bogus second BGP launch from happening. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21tests: add --logd optionChristian 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-17Merge pull request #13230 from LabNConsulting/micronet-is-munetDonald Sharp
Micronet is munet
2023-04-17tests: quick fix for --gdb-daemons=DAEMONLIST not workingChristian Hopps
When launching the daemons under gdb it takes a bit for them to come up, the currently code only looks for pid files to determine if the daemon is running. This test is no good as these files are left around by previous runs. For now do a simple sleep when debugging with gdb to get things working. 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 flush ipv6 addressesChristian 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: apply frrbot style requirementsChristian 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-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13tests: add iproute2 API guard to svd testStephen Worley
Add a iproute2 API guard to the SVD test using `bridge fdb get`. While it SHOULD be present on most systems based on their kernel version it may not be present due to kernel/iproute2 version mismatch weirdness. Signed-off-by: Stephen Worley <sworley@nvidia.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>
2023-01-30tests: Topotests fix for deleting wrong pidfileMartin Winter
Fixes killRouterDaemons() function which occasionally deleted the wrong pidfile. Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>