Commit graph

163 commits

Author SHA1 Message Date
Y Bharath bb6f2c2fb0 tests: Resource leak in common_config.py
Address pending changes from PR:18574

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-15 11:24:44 +05:30
Y Bharath 920ef44023 tests: Shadowing the built-in function
Shadowing the built-in function

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-04-04 12:25:18 +05:30
Russ White 15991e1a08
Merge pull request #16800 from donaldsharp/nhg_reuse_intf_down_up
Nhg reuse intf down up
2024-10-04 10:28:58 -04:00
Donald Sharp 3d3c0e35eb tests: use logger.warning not logger.warn
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-18 11:56:42 -04:00
Donald Sharp 5a589217f8 tests: When finding nexthops ensure that they are active
Do not accept a nexthop as valid unless it is marked as being
active.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-16 09:34:05 -04:00
Christian Hopps 987100333a tests: optionally pass seconds_left to retrying functions
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>
2024-09-07 07:09:27 -04:00
Y Bharath 8381dbd9e2 tests: Avoid importing unused modules
Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-06-17 15:42:59 +05:30
Donald Sharp ea570f2aa6 tests: Cleanup generate_support_bundle() to not fail
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>
2024-04-10 09:28:17 -04:00
Louis Scalbert a54d18cb1c topotests: remove python2 support
Remove python2 support

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-14 10:57:30 +01:00
Christian Hopps 17054f373e doc: update doc removing socat req + remove unused tests code
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-08 11:03:18 -04:00
Christian Hopps be3c453556 tests: pause (with CLI) at step() functions when run with --pause
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-04 17:38:19 -04:00
Donald Sharp af53f97f34 tests: Add exit stanzas to pre-generated config
A bunch of tests rely on pre-generated config from
json files.  These tests were not putting `exit` stanzas
and a bunch of the tests as a result are silently failing
to configure properly at all, as commands were being sent
to the wrong daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-22 10:52:54 -04:00
Christian Hopps fea00bad20 tests: fix pylint error, and update style in lib/*.py
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-17 13:42:32 -04:00
Jafar Al-Gharaibeh f25a43ad12
Merge pull request #13200 from kuldeepkash/socat_cleanup
tests: [topojson] multicast pimv6 socat cleanup
2023-04-04 13:36:03 -05:00
Christian Hopps e8f7a22f76 tests: lower logging level on some infra logs
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-04 11:41:51 +00:00
Kuldeep Kashyap 0d58ebc4f9 tests: [topojson] multicast pimv6 socat cleanup
For multicast pimv6 join and traffic, socat is
used, which was not cleaned up post tests executions,
enhanced kill_socat() API to kill socat join and
traffic specific PIDs during teardown module.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-04-04 08:12:31 +05:30
nguggarigoud f637ac0170 tests: Add topotests for MGMT daemon
1. MGMT daemon support in topotests.
2. Sanity tests for MGMTd.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-03-22 05:22:56 +00:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Kuldeep Kashyap 2a8ad2ea97 tests: Fix for multicast_pim6_static_rp tests failure
Multicast pim6 static RP tests are failing
when run in parallel using micronet. There
are APIs to clean mcast traffic before
starting new test but these cleanups
are not needed when socat is used.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-01-19 05:26:37 -08:00
Kuldeep Kashyap 991a971fe9 tests: Cleaning up daemon param used in start_topology()
Earlier daemon parameter was passed to
start_topology(), which is not needed now,
as new code is implemented to start
feature specific daemons.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 22:45:34 -08:00
Kuldeep Kashyap dc4c450fc2 tests: Topotests daemon start as per feature test
Currently topotests starts all daemons by default,
made changes to f/w so only needed daemons can
be started, daemons which are needed to tests
particular test suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 20:25:41 -08:00
Kuldeep Kashyap d7032129b0 tests: [PIMv6] F/W support for multicast pimv6 automation
Enhanced or added new libraries to support
multicast pimv6 automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-11-07 02:19:15 -08:00
nguggarigoud 3cf90b1be9 tests: adding bgp admin distance topotests.
This has bgp admin topotest automation suit.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-08-28 23:34:52 -07: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
Kuldeep Kashyap 296b75ed2a tests: Fix for multicast_pim_bsm_topo1 key error
Issue was reported by Donald, we were hitting
with key not found error and execution was
stopped, which is fixed by this PR.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-04 23:00:31 -07:00
Martin Winter 22ad701ec0
Merge pull request #11408 from donaldsharp/common_config 2022-06-16 18:45:15 +02:00
Kuldeep Kashyap 697ce62f7a tests: Verify PIM neighbor and static routes for BSM tests
Verifying and making sure PIM neighbors are
up before sending BSM packet using Scapy.

Verifying static routes are installed before
proceeding fruther.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-06-14 14:23:09 -07:00
Donald Sharp 853585a7cd tests: Fix verify_rib such that it will look at the selected route
When you have a static route with multiple different admin
distances there exists a chance that route will have been
installed multiple times due to system load when inserted
at about the same time.  If this is the case then the
verify_rib function can and will select the wrong route
that happens to have a nexthop group that is still installed.

Modify verify_rib to ensure that the route that is going to
be looked at for nexthop correctness is the actual installed
route, not a previous version of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-14 12:21:19 -04:00
Kuldeep Kashyap fb943df10b tests: [Topojson] Enhance CLI logging
As of now we are logging only JSON output of CLIs
in topotests(topojson) executions and same o/p is
getting printed twice, which is of no use.

Enhanced code to show both plain and JSON output
of CLIs and remove duplicate logging.

It will help in reducing execution logs and in
verification, if sometimes there is mis-match
in CLI plain and JSON outputs.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-05-23 23:34:19 -07:00
Donald Sharp cb8018f4c3 tests: Make verify_rib wait up to 40 seconds.
Under heavy load I am seeing verify_rib failing after 12 seconds
but succeeding after 17:

2022-05-19 18:52:54,374 DEBUG: topolog: Exiting lib API: verify_rib
2022-05-19 18:52:54,374 DEBUG: topolog: Function returned True
2022-05-19 18:52:54,374 WARNING: topolog: RETRY DIAGNOSTIC: SUCCEED after FAILED with requested timeout of 12.0s; however, succeeded in 14.7s, investigate timeout timing

There is no reason to not have the test wait a bit longer for very very
heavily loaded systems.  Change the time to 40 seconds.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 10:31:48 -04:00
Donald Sharp 6ec742d95f tests: Ensure routes are not queued when calling verify_rib
Lots of tests call verify_rib that takes a list of routes that
need to be verified in some fashion.  This verify_rib functionality
will try up to 12 seconds before failing the check that zebra
has the route and has installed it.

Unfortunately the verify_rib code was not looking to see if
the route was queued for installation and was then allowing
tests to immediately do subsuquent steps that depended on
that route actually being installed sometimes causing tests
to fail.

Write a bit of additional code that looks at the queued
status and allows the test to wait a bit longer for zebra
to finish processing before allowing the test to move on
to the next bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 10:31:48 -04:00
kuldeepkash 40c28c860a tests: Add multicast_pim_dr_nondr_test suite
1. Added test cases to test/verify multicast_pim_dr_nondr scenarios

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2022-04-12 02:39:39 +05:30
Donald Sharp 953ef1498f tests: Fix spelling of kernel
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:25:19 -04:00
Donald Sharp dea6dce388 tests: Fix perticular spelling
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:24:33 -04:00
Kuldeep Kashyap 39c661a063 tests: Framework changes to support bgp vrf dynamic route leak automation
1. Enhance framework to support bgp vrf dynamic route leak automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:20 +05:30
nguggarigoud d1b5fa5b9e tests: adding ospfv3 base cases.
Covers basic test case like route map, rte calc.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-03-15 19:58:51 -07:00
Iqra Siddiqui 9c46c484fe tests: Fix style issues in common_config.py
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-02-22 09:29:48 -08:00
Iqra Siddiqui 055f21c49d tests: Add supporting test to validate NH resolution logic
Co-authored-by: Vijay Kumar Gupta <vijayg@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-02-22 09:28:00 -08:00
Igor Ryzhov 788a036fdb *: do not print vrf name for interface config when using vrf-lite
VRF name should not be printed in the config since 574445ec. The update
was done for NB config output but I missed it for regular vty output.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 14:44:05 +03:00
Donald Sharp 93d664c26a test: Fix addKernelRoute looking for positive results
Under heavy system load, we are sometimes seeing this
output for addKernelRoute:

2021-11-28 16:17:27,604 INFO: topolog: [DUT: b1]: Running command: [ip route add 224.0.0.13 dev b1-f1-eth0]
2021-11-28 16:17:27,604 DEBUG: topolog.b1: LinuxNamespace(b1): cmd_status("['/bin/bash', '-c', 'ip route add 224.0.0.13 dev b1-f1-eth0']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2021-11-28 16:17:27,967 DEBUG: topolog.b1: LinuxNamespace(b1): cmd_status("['/bin/bash', '-c', 'ip route']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2021-11-28 16:17:28,243 DEBUG: topolog: ip route
70.0.0.0/24 dev b1-f1-eth0 proto kernel scope link src 70.0.0.1
Signed-off-by: Donald Sharp <sharpd@nvidia.com>

This tells us that the ip route add succeeded but when looking for it
the system failed to immediately find it.  Why is this happening?
Probably we are under heavy system load and the two different
commands, 'ip route add..' and 'ip route show' are being executed
on different cpu's and the data has not been copied to the different
cpu yet in the kernel.  This is not necessarily something normally
seen but entirely possible.  Giving the system a few extra seconds
for the kernel to execute/work the memory barrier system seems
prudent for long term success of our programming.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-29 08:42:03 -05:00
Donald Sharp 45cfb2495f lib: Add metric-type to possible set operations
Several tests used the route_map_create functionality
with `metric-type` but never bothered to add the
backend code to ensure it works correctly.
Add it in so it can be used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-15 11:42:06 -04:00
Christian Hopps 1375385adf
tests: increase wait and update test
Modernize the test a bit, generate expected results rather than load from
file, and add a general json_cmp with retry function and use it.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-08 15:25:52 -04:00
Donald Sharp b041a12749 tests: Set mask to a default value for addKernelRoute
When looking for a implied host route it is not necessary
to add the `/32` to an ip route add.  As such masks
will not be set in this case.  Set the value of masks
to a known good value so that when the route installation
fails the test for it actually being there will tell you
that the route is not there -vs- complaining about mask
being uninited.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-08 07:53:04 -04: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 4953ca977f tests: cleanup - remove unused imports
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 a5124c49d3 tests: add helper object for mcast-tester and iperf tool.
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 c8e5983d8e tests: fix pylint infra errors
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00