Commit graph

127 commits

Author SHA1 Message Date
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
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 4f99894dd0 tests: configure routers in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-26 20:49:27 -04:00
nguggarigoud cc90defcb6 tests: ospf gr helper topotests with scapy.
Testing ospf gr helper using scapy tool.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-08-23 21:42:09 -07:00
Christian Hopps 6a95bfc8b0 tests: uniq vrf names when using netns
- In order to run tests in parallel the netns-based vrfs need to
have unique names primarily bc they are all tracked/looked-up in
`/run/netns` which is not network namespace nesting friendly

- use ip(8) exclusively rather than a mix of `ip` and `ifconfig`
and `vconfig`, reducing required pkg count by a couple.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-21 06:13:52 -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 269a822be4 tests: dump the actual json values to log
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-03 09:07:49 +00:00
nguggarigoud db56171c86 tests: Adding ospfv3 basic functionality test cases
1. Adding  APIs to configure and verify ospfv3.
2. Adding ospfv3 base functionality testcase.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-07-20 02:34:24 -07:00
Donald Sharp c24e832ae9
Merge pull request #8946 from gpnaveen/bgp_lib_changes
tests: Adding lib changes for bgp peer type verification.
2021-07-16 09:15:36 -04:00
Christian Hopps be4a9b0570 tools: improve frr-reload.py delta file creation
- Remove incorrect requirement for `service integrated-vtysh-config`
  when producing a delta.
- Add `--test-reset` option which suppresses non-parseable lines from the
  produced delta
- Use new features in common_config.py

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-15 22:12:01 -04:00
nguggarigoud ad03ea8ebf tests: Adding lib changes for bgp peer type verification.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-07-15 05:28:08 -07:00
Russ White 000df71ccd
Merge pull request #8767 from opensourcerouting/ospfd-gr
ospfd: introduce support for Graceful Restart (restarting mode)
2021-07-13 06:39:53 -04:00
Renato Westphal 5957a1a11f tests: add "save_config" parameter to kill_router_daemons()
Using "write memory" to save the daemons' configurations before
restarting them can cause log files to stop working correctly. Add
a new "save_config" to the kill_router_daemons() function to prevent
that from happening when saving the configurations isn't necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-05 11:43:02 -03:00
Christian Hopps 0ef5bf1905 tests: generate support bundles in parallel, fix bugs
Speedup (large topo): OLD: ~6 minutes NEW: ~1 second
  (when paired with generate_support_bundle.py changes)
- Collect from each node in parallel

Bug fixes:
- sub-directory test name was the same internal pytest function name
  for any test, and not the actual test name.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-30 15:46:10 +00:00
Christian Hopps ed776e38f6
tests: apply KISS to retry fixture
This python fixture was way too complex for what is needed.

Eliminate gratuitous options/over-engineering:

- Change from non-deterministic `wait` and `attempts` to a single
`retry_timeout` value. This is both more deterministic, as well as
what the user should actually be thinking about.

- Use a fixed 2 second pause between executing the wrapped function
rather than a bunch of arbitrary choices of 2, 3 and 4 seconds
spread all over the test code.

- Get rid of the multiple variables for determining what "Positive" and
"Negative" results are. Instead just implement what all the user code
already wants, i.e., boolean False or a str (errormsg) means
"Negative" result otherwise it's a "Positive" result.

- As part of the above the inversion logic is much more comprehensible
in the fixture code (and more correct to boot).

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-25 05:33:04 +00:00
nguggarigoud 2448d00200 tests: Adding ospfv3 basic functionality test cases
1. Adding  APIs to configure and verify ospfv3.
2. Adding ospfv3 base functionality testcase.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-06-15 17:00:17 -07:00
Igor Ryzhov 60070c3d02 tests: remove tcp_l3mdev_accept setting
This is not necessary anymore with fixed `vrf_bind`.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-31 22:12:55 +03:00
nguggarigoud 8694dd78db tests: adding ospf basic 2 testcases.
Test cases included are 1 ospf cost, 1 ospf mtu.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:23:15 -07:00
Donald Sharp ec8f360f2d tests: Remove kill_mininet_router_process
This function kills all processes that happen to have the same
name to frr processes and it was only ever used in the setup.
Setup should not be used to kill old runs.  That should be a
separate process.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-22 15:47:37 -04:00
Donald Sharp 0b25370e95 tests: More black fixups
Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:35:05 -04:00
Patrick Ruddy fb94a2e65d
Merge pull request #8402 from opensourcerouting/debian10-topotest-fix
tests: fix for l3mdev topotests on kernel 4.19
2021-04-08 14:54:54 +01:00
David Schweizer 3d762f26a6
tests: add l3mdev config helpers for VRF topotests
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:50 +02:00
Kuldeep Kashyap 2268cf50d5 tests: Fix for BGP_GR test failures
Few tests were failing in BGP-GR intermittently. Fixing the failures.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-04-05 00:15:40 -07:00
Kuldeep Kashyap 53402dbf1e tests: Fix bgp convergence issue mentioned in #8279
1. Enhance verify_bgp_convergence() to solve issue mentioned in #8279

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-17 17:43:57 -07:00
Donatas Abraitis 7b94dd35dd
Merge pull request #8195 from qlyoung/fix-community-type-command
tests: fix community-list invalid command
2021-03-07 17:04:57 +02:00
Quentin Young 60e7da0cff tests: fix community-list invalid command
Didn't test this but it's already randomly broken so cant be worse

Hopefully fixes:

raise InvalidCLIError("%s" % output)
InvalidCLIError: line 2: % Command incomplete[4]: bgp
large-community-list standard Test1 permit

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-03-03 13:56:39 -05:00
Wesley Coakley 23f3a92e34
tests: address coverity / styling issues in topotests
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-03-02 20:44:15 -05:00
Mark Stapp e9867ca57b tests: report kernel version check failures
Report kernel version check failures in the test log.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-02-16 11:55:47 -05:00
Mark Stapp 70b99f2fff tests: make generate support bundle python3 only
Make the generate-support-bundle script and interactions more
python3-friendly, and use python3 explicitly.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-02-15 08:13:06 -05:00
ckishimo 1f661c8c90 tests: start ospf6d daemon
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-27 17:30:52 +01:00
ckishimo 12011c4015 tests: fix create_router_ospf6 to use ospf6 instead of ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:19:38 +01:00
ckishimo a7394afa52 tests: create_interfaces_cfg add ospfv3 support
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:01:05 +01:00
ckishimo 3ee31ad131 tests: create_interfaces_cfg add ospf cost
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:57:06 +01:00
ckishimo 6e7f58da09 tests: create_interfaces_cfg refactor ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:52:32 +01:00
Donald Sharp f2aee6967c
Merge pull request #7837 from ckishimo/tests_ospf
tests: fix redistribute key in ospf tests
2021-01-13 13:31:32 -05:00
nguggarigoud 26bbe9af5e tests: Static route cases with admin dist and tag.
1. Adding api to verify ip nht command.
2. 5 cases of static routes with admin dist and tag
3. Run time = 89Secs

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-12 17:13:26 +05:30
ckishimo 9458be1aec tests: fix ospf cosmetic output
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00