summaryrefslogtreecommitdiffstats
path: root/tests/topotests/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15903 from y-bharath14/srib-topotests-v1Russ White2024-10-081-1/+10
|\ | | | | tests: catch exception during switch shutdown
| * tests: catch exception during switch shutdownY Bharath2024-09-251-1/+10
| | | | | | | | Signed-off-by: y-bharath14 <y.bharath@samsung.com>
* | Merge pull request #16800 from donaldsharp/nhg_reuse_intf_down_upRuss White2024-10-041-1/+1
|\ \ | |/ |/| Nhg reuse intf down up
| * tests: When finding nexthops ensure that they are activeDonald Sharp2024-09-161-1/+1
| | | | | | | | | | | | | | Do not accept a nexthop as valid unless it is marked as being active. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | tests: Addition of AutoRP Discovery uncovered broken PIM testNathan Bahr2024-09-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With AutoRP discovery running by default, that adds a new IGMP group that needs to be accounted for in IGMP output. For pim.py The clear IGMP interfaces function is in a broken state. It was already ignoring any errors and returned true always, but with the addition of the AutoRP discovery group, you could end up with a different group order in the json which would cause a key error making the test fail. For now I just added a check to avoid the key error. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
* | tests: Added tests for new AutoRP functionalityNathan Bahr2024-09-241-0/+85
| | | | | | | | | | | | | | | | Uses hardcoded sample AutoRP packets injected in to test message parsing and proper application of AutoRP learned RP info. Tests mix of AutoRP and static RP's. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
* | tests: add topotest for igmp proxyBarry A. Trent2024-09-231-1/+69
| | | | | | | | Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
* | tests: use logger.warning not logger.warnDonald Sharp2024-09-182-2/+2
| | | | | | | | | | | | | | 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>
* | Merge pull request #16438 from Jafaral/pim-10.1-cand-rpDonald Sharp2024-09-141-1/+1
|\ \ | | | | | | PIM candidate BSR/RP support
| * | tests: don't set oif to a list if it is NoneJafar Al-Gharaibeh2024-09-101-1/+1
| |/ | | | | | | Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
* / tests: Adjust minimum wait/count timers for run_and_expect() if they are too lowDonatas Abraitis2024-09-131-5/+13
|/ | | | | | | | | | | | | | | 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>
* tests: optionally pass `seconds_left` to retrying functionsChristian Hopps2024-09-071-2/+8
| | | | | | | | | | | This allows retrying functions to possibly change their logging level for diagnostics. In order to maintain backward compatibility with this longstanding function we catch the specific exception of it not being handled by the retrying function and call again w/o the argument. Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: detect all daemons correctly when using frr.confJafar Al-Gharaibeh2024-08-301-3/+3
| | | | Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
* Merge pull request #16450 from nabahr/static_joinsDonald Sharp2024-08-221-0/+76
|\ | | | | PIM: Implement static IGMP joins without an IGMP report
| * tests: Added new topotest for pim igmp static groupsNathan Bahr2024-08-151-0/+76
| | | | | | | | | | | | | | | | Copied the existing "join-group" test and modified to test static groups instead. Functionally the same but without IGMP reports. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
* | tests: dont print sys.path when running grpc-query.pyChristian Hopps2024-08-221-1/+0
| | | | | | | | | | | | | | Don't print the sys.path when running grpc-query.py. Doing so was causing tests to fail. Signed-off-by: Christian Hopps <chopps@labn.net>
* | tests: Convert self.unified_config to booleanDonatas Abraitis2024-08-111-2/+2
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | tests: add wait to RequireVpnRoutes, RequireUnicastRoutesG. Paul Ziemba2024-07-281-22/+90
|/ | | | Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* zebra, topotests: do not set nexthop's FIB flag when DUPLICATE presentPhilippe Guibert2024-07-081-5/+22
| | | | | | | | | | | | | | | | | | | | | The bgp_duplicate_nexthop test installs routes with nexthop's flags set to both DUPLICATE and FIB: this should not happen. The DUPLICATE flag of a nexthop indicates this nexthop is already used in the same nexthop-group, and there is no need to install it twice in the system; having the FIB flag set indicates that the nexthop is installed in the system. This is why both flags should not be set on the same nexthop. This case happens at installation time, but can also happen at update time. - Fix this by not setting the FIB flag value when the DUPLICATE flag is present. - Modify the bgp_duplicate_test to check that the FIB flag is not present on duplicated nexthops. - Modify the bgp_peer_type_multipath_relax test. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: Add and use option for graceful (re)startvivek2024-07-011-27/+28
| | | | | | | | | | | | | | | | Add a new start option "-K" to libfrr to denote a graceful start, and use it in zebra and bgpd. zebra will use this option to denote a planned FRR graceful restart (supporting only bgpd currently) to wait for a route sync completion from bgpd before cleaning up old stale routes from the FIB. An optional timer provides an upper-bounds for this cleanup. bgpd will use this option to denote either a planned FRR graceful restart or a bgpd-only graceful restart, and this will drive the BGP GR restarting router procedures. Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
* tests: Updated topotest and documentationPooja Jagadeesh Doijode2024-07-011-17/+60
| | | | | | Added topotest and documentation for BGP wide GR configurations Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
* Merge pull request #16227 from y-bharath14/srib-topotest-eDonald Sharp2024-06-186-38/+36
|\ | | | | tests: Avoid importing unused modules
| * tests: Avoid importing unused modulesY Bharath2024-06-176-38/+36
| | | | | | | | Signed-off-by: y-bharath14 <y.bharath@samsung.com>
* | Merge pull request #16153 from pguibert6WIND/bgp_recursive_duplicateRuss White2024-06-182-0/+72
|\ \ | |/ |/| bgpd: fix do not skip paths with same nexthop
| * topotests: add bgp duplicate nexthop testPhilippe Guibert2024-06-111-0/+48
| | | | | | | | | | | | | | | | Add a topotest that ensures that when addpath is enabled and two paths with same nexthop are received, they are sent to ZEBRA which detects 'duplicate nexthop'. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * topotests: add API to detect if iproute2 is json capablePhilippe Guibert2024-06-111-0/+24
| | | | | | | | | | | | | | | | | | 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>
* | tests: add native session-req/reply support to fe_client.pyChristian Hopps2024-06-111-16/+45
| | | | | | | | | | | | Use this to test new native message format for creating sessions. Signed-off-by: Christian Hopps <chopps@labn.net>
* | tests: add notify select support in fe client test utilityChristian Hopps2024-06-071-20/+29
|/ | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: fix multiple grpc-client.py running in parallelChristian Hopps2024-05-311-24/+34
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: improve the grpc query client and topotestChristian Hopps2024-05-151-15/+29
| | | | | | | | | - Add separate get, get-config, get-state operations to query command, as well as switching default output to JSON. - Add an `--xml` to change the output format. - move printss to logging.debug so output is a machine parseable result. Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: Apply black formatting from what frrbot suggested to be happyDonatas Abraitis2024-04-283-33/+32
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* tests: Apply black formatting for all tests/topotestsDonatas Abraitis2024-04-279-164/+184
| | | | | | | 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>
* topotests: lib, fix filter out "At line 73 in ↵Philippe Guibert2024-04-231-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /usr/share/snmp/mibs/ietf/SNMPv2-PDU" message When testing SNMP service on FRR, the following error message may appear on some distros. > # snmpwalk -v2c -c public .1.3.6 1.1.1.1 <OID> > Bad operator (INTEGER): At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU > [..then result ..] > The error message is due to the /etc/snmp/snmp.conf file. By default, this file is used by both snmp server and client side. The net-snmp MIB parsing routing loads MIBS, to bind oids with the naming scheme used by the MIBS. > # cat /etc/frr/snmp.conf > [snmp] > mibs +ALL > A potential fix would consist in modifying the SNMPv2-PDU.mib file: the problem is known on ubuntu distros, as the snmp-mibs-downloader package has not updated the SNMPv2-PDU.mib file. The choice is done to not modify the original distro where the test is run on. Fix the topotests by ignoring the 'SNMPv2-PDU line 73" error message, and keep the other error messages that may happen, for instance, when an unknown oid name value is requested. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* tests: Cleanup generate_support_bundle() to not failDonald Sharp2024-04-101-2/+14
| | | | | | | | | The Support bundle generation was/is failing in both our upstream ci and locally. This cleans up the failures that I am seeing such that tests now continue to run instead of aborting the test run. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* topotests: fix ignore routes with linkdownPhilippe Guibert2024-04-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* tests: required formatting changeChristian Hopps2024-03-171-4/+4
| | | | | | | This code wasn't touched by the actual change; however, the formatting fix is required. Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: enable code coverage reporting with topotestsChristian Hopps2024-03-171-17/+9
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* tests: Add ability to run a fpm listenerDonald Sharp2024-03-042-9/+33
| | | | | | | | 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>
* topotests: apply black on bmp collectorLouis Scalbert2024-02-292-81/+96
| | | | | | Apply black on bmp collector Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* topotests: bgp_bmp, log bmp into tgen logdirLouis Scalbert2024-02-293-7/+10
| | | | | | Log BMP into tgen logdir to facilitate the debug. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* tests: use more standard name for python3Christian Hopps2024-02-211-1/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #15351 from louis-6wind/fix-leak-vrf-interfaceRuss White2024-02-201-4/+8
|\ | | | | bgpd: update route leak after vrf interface changes
| * tests: add source_addr in check_pingLouis Scalbert2024-02-141-4/+8
| | | | | | | | | | | | Allow specifying a source_addr in check_ping library function. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | lib: mgmtd: add xpath arg to notification messageChristian Hopps2024-02-191-2/+8
|/ | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* topotests: fix snmptrap log OID parsingDavid Schweizer2024-02-071-8/+10
| | | | | | | | Replace OID string parsing of snmptrap log files based on odd/even line numbers with regex string search to prevent test failures in cases where log entries don't match assumed order. Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
* tests: add YANG notification testChristian Hopps2024-01-301-0/+414
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: set up `frr_libstatedir`David Lamparter2024-01-271-0/+1
| | | | | | | 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>
* tests: Stop some warning messages on test runsDonald Sharp2023-12-211-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* topotests: remove python2 supportLouis Scalbert2023-12-141-6/+1
| | | | | | Remove python2 support Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* topotests: create exabgp cli fifoLouis Scalbert2023-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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>