Commit Graph

3004 Commits

Author SHA1 Message Date
Donatas Abraitis
fecc953b3c
Merge pull request #13670 from donaldsharp/coverity_99
Coverity 99
2023-06-05 22:33:55 +03:00
Donald Sharp
05cb9e55a7
Merge pull request #13658 from louis-6wind/fix-flex-algo2
isisd: fix wrongly disabled flex-algorithm
2023-06-05 12:43:01 -04:00
Donald Sharp
0889f6d894 tests: Rename a test to test_bgp_gr_functionality_topo3.py
Since the test was not named test_bgp_gr_functionality_topo3.py
pytest was not picking it up to run.  Let's run it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-05 07:57:49 -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
84af55b268 tests: new mgmt_startup tests are failing due to insufficient time
The tests are failing due to heavily loaded system and insufficient
time for large configs to be handled.  Increasing the time
allows the tests to complete locally for me under heavy load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-01 09:57:48 -04:00
Louis Scalbert
5f230545e1 tests: re-style isis_sr_flex_algo_topo1
Re-style isis_sr_flex_algo_topo1. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-01 14:26:48 +02:00
Louis Scalbert
b24bad5632 tests: fix mpls table check in isis_sr_flex_algo_topo1
Some test steps result in removing some entries in the MPLS forwarding
table. However, these steps pass before the entries are actually
removed.

Use the exact JSON comparison so that the removal of the entries is
checked.

Fixes: 1a61ef95b2 ("tests: add isis_sr_flex_algo_topo1 for flex-algo")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-01 14:14:51 +02:00
Donald Sharp
22c10bbdaa tests: Actually loop if ping fails
The usage of run_and_expect doesn't work if the function
being called as the run part asserts.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-30 15:43:42 -04:00
Donatas Abraitis
147c7a2de3
Merge pull request #13631 from donaldsharp/fix_some_ping_issues
various issues
2023-05-30 21:26:24 +03:00
Christian Hopps
7cd87abc5e tests: add unified config tests
- simple unified test
- unified test with late backend startup test

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 04:09:29 -04:00
Christian Hopps
e3c4bd2472 tests: add some more mgmtd tests
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00
Christian Hopps
5ba5613077 lib: mgmtd: add manual vty server start option and use it
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00
Donald Sharp
131153ea22 tests: Allow ping to run multiple times before failing
the bgp_default_originate test brings up the topology and
then immediately pings.  Which sometimes fails.  This is
of course possible since the first ping might actually fail
due to arp going on.  So let's give it a second chance or two.
Especially since the test, at this point, is just installing
a default route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-28 07:37:25 -04:00
Christian Hopps
898499a50f tests: python-foo assure foo[0] is on a list not dict_values object
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28 05:13:22 -04:00
Donald Sharp
780a8a10e6 tests: Convert to using logger.warning
Use the non deprecated format.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-26 16:00:42 -04:00
Donald Sharp
618a9f0592
Merge pull request #13607 from LabNConsulting/chopps/fixospftest
tests: ospfapi: fix non-determinism in test
2023-05-26 15:09:38 -04:00
Donald Sharp
145acbb3bb
Merge pull request #13599 from LabNConsulting/chopps/analyze-search
tests: allow selecting test results by regexp match
2023-05-26 07:20:17 -04:00
Christian Hopps
054d6bdc48 tests: selecting results by regexp and ragnes, add container support
- Allow selecting results using a regexp
- Allow selecting results using commasep range specs
- Add support for getting and saving results from a docker/podman
  container.
- update docs

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-26 06:32:24 -04:00
Christian Hopps
39e1f084b5 tests: ospfapi: fix non-determinism in test
fixes #13584

The test had the ospf client injecting multiple opaque LSAs on 5s pace,
but the test itself verified and advanced on an LSA in the middle of
that sequence and not the last one. Then the test reset the ospf client
and originating router. If a later injected LSA managed to get in to the
router and flooded prior to the client/router reset then the opaque data
or sequence number could differ from the expected value.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-26 05:09:13 -04:00
Christian Hopps
27c6bfc217 tests: cleanup the config file specification and default code
Also, add a new warning for missing configuration files when user is
expecting them.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-26 00:33:07 -04:00
Quentin Young
254feba0a5
Merge pull request #13592 from LabNConsulting/chopps/newmunet
munet: import 0.13.5 w/ nicer cmd logging
2023-05-24 12:20:41 -04:00
Christian Hopps
8aba44e3a7 munet: import 0.13.5 w/ nicer cmd logging
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-24 02:48:35 -04:00
Russ White
575a0c5e3c
Merge pull request #13555 from LabNConsulting/aceelindem/ospf-p2mp-delayed-reflooding-config
ospfd: OSPF P2MP Delayed Reflooding configuration
2023-05-23 11:41:35 -04:00
Russ White
fa45a19a60
Merge pull request #13535 from opensourcerouting/feature/ripng_allow_ecmp
ripng: Implement allow-ecmp X command
2023-05-23 07:35:32 -04:00
Donatas Abraitis
29d3532a7a tests: Check if allow-ecmp command works for RIPng
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-23 09:29:02 +03:00
Acee
0d8ef0477c ospfd: OSPF P2MP Delayed Reflooding configuration
Currently, delayed reflooding on P2MP interfaces for LSAs received
from neighbors on the interface is unconditionally (see commit
c706f0e32b). In some cases, this
change wasn't desirable and this feature makes delayed reflooding
configurable for P2MP interfaces via the CLI command:
"ip ospf network point-to-multipoint delay-reflood" in interface
submode.

Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-22 15:51:41 -04:00
Donald Sharp
b31a1797c6 tests: Do not Cause test scripts to stop running when config load fails
When running the pytests in parallel, calling pytest.exit() causes
the entire test run to be aborted.  Which.... Is frankly not cool.
Let's notice the failure and move on to the next tests.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-22 10:52:54 -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
Donald Sharp
b9de32473d tests: Slow bgp_default_originate test down slightly
The test is performing these steps:

a) get timestamp of route installed in zebra
b) <make changes>
c) get new timestamp of route installed in zebra

If < 1 second happens between A and C the test
assumes that something went wrong, as that it is
testing to see if the route was reinstalled <yes I know>.

Just sleep 1 second after a) happens so that if a reinstall
happens we can easily see it, and we also know that if a
reinstall doesn't happen then the new timestamp will
always be 1 second or greater.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-22 10:06:07 -04:00
Donatas Abraitis
f0ac9aa4a7
Merge pull request #13563 from donaldsharp/remove_true
tests: pytest does not like return True from a test
2023-05-22 09:38:53 +03:00
Donald Sharp
697e7e5174
Merge pull request #13566 from LabNConsulting/chopps/analyze-improvement
tests: have ananlyze.py `chown -R $SUDO_USER` when copying results
2023-05-21 20:22:22 -04:00
Donald Sharp
57a2ff8b8d
Merge pull request #13568 from opensourcerouting/fix/timers_bgp_topotests
tests: Fix timers command for bgp_disable_addpath_rx test
2023-05-21 20:21:51 -04:00
Donatas Abraitis
f55bd028b7 tests: Fix timers command for bgp_disable_addpath_rx test
Was incorrectly setting BGP timers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-20 10:06:49 +03:00
Christian Hopps
2013c684d0 tests: munet to version 0.13.4
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-19 23:16:39 -04:00
Christian Hopps
47e52c47d4 tests: have ananlyze.py chown -R $SUDO_USER when copying results
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-19 23:14:18 -04:00
Donald Sharp
cd0956e69d
Merge pull request #13559 from opensourcerouting/fix/ignore_decoding_chars
tests: Ignore utf-8 decoding errors
2023-05-19 21:30:34 -04:00
Donald Sharp
03b53c1229 tests: pytest does not like return True from a test
From running the test:
bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as
  /home/sharpd/.local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as returned True, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-19 12:52:51 -04:00
Donatas Abraitis
76b246aa1f tests: Ignore utf-8 decoding errors
This is happening sometimes for stuff like `r1 shi cat ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-19 14:57:56 +03:00
Donatas Abraitis
a8bc67a989
Merge pull request #13369 from samanvithab/bgpd_fix
lib : fix duplicate prefix list delete
2023-05-18 10:24:41 +03:00
Donatas Abraitis
c374605ecb
Merge pull request #13541 from LabNConsulting/chopps/fixtestdefconf
tests: fix implicit config file and recently added logic error
2023-05-18 09:44:38 +03:00
Christian Hopps
f3525b0b17 tests: fix implicit config file and recently added logic error
- 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-17 16:05:53 -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
Donald Sharp
244d5d0a16 tests: Change order of config files
Our CI test system is configuring interfaces like this:

int A
  <ospfX config>

router ospfX
  router-id Z.Y.M.Q

On sufficiently loaded systems, the router-id might not be respected because
the interface A neighbor might have come up by the time the router-id
command is read in.  This is a problem for our topotests in that
the tests expect neighbors to be formed with certain router-id,
but the FRR code has stored the new router-id but not accepted
it's use since a neighbor relationship has formed.

Modify the ci test system code to put the 'router ospfX' commands
before the interface commands, thus forcing the router-id to be
read in *before* any possibility that the neighbor can have come
up.

Also, I've filed issue #13452 to address the ordering of commands
with regards to router-id in our ospf protocols.  Once that is
done this should be backed out, to return to a more natural ordering
of commands.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-17 09:20:46 -04:00
Donald Sharp
e396a4f0c6 tests: Clean up commands that do nothing
Recently clear commands were added to the tests that do nothing
because they are using the wrong way to input the command.
Since these do nothing remove them:

2023-05-16 16:39:07,072.072 DEBUG: topolog.r0: Router(r0):  cmd_status("['/bin/bash', '-c', 'clear ip ospf neighbor']", pre_cmd: "['/usr/bin/nsenter', '--mount=/proc/4157893/ns/mnt', '--net=/proc/4157893/ns/net', '--uts=/proc/4157893/ns/uts', '-F', '--wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0']" use_pty: False kwargs: {'stdout': -1, 'stderr': -2, 'encoding': 'utf-8', 'shell': False, 'stdin': None, 'env': {'LANG': 'en_US.UTF-8', 'LS_COLO)
2023-05-16 16:39:07,120.120 WARNING: topolog.r0: Router(r0): proc failed: rc 1 pid 4161077
        args: /usr/bin/nsenter --mount=/proc/4157893/ns/mnt --net=/proc/4157893/ns/net --uts=/proc/4157893/ns/uts -F --wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0 /bin/bash -c clear ip ospf neighbor
        stdout: Usage: clear [options]

Options:
  -T TERM     use this instead of $TERM
  -V          print curses-version
  -x          do not try to clear scrollback
        stderr: *empty*

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-17 09:20:46 -04:00
Donald Sharp
98f71533f6
Merge pull request #13529 from pguibert6WIND/bgp_vpnv6_per_nexthop_fix
topotests: fix bgp_vpnv6_per_nexthop, syncing with bgp rib
2023-05-17 07:56:07 -04:00
Russ White
18978d1280
Merge pull request #13526 from opensourcerouting/fix/show_table_version_per_subgrp
bgpd: Show the real table version for a decent peer subgroup
2023-05-16 10:14:04 -04:00
Russ White
425fc1f5b7
Merge pull request #12949 from opensourcerouting/ospf-unplanned-gr
OSPF GR for unplanned outages
2023-05-16 08:37:19 -04:00
Philippe Guibert
e82cd92b19 topotests: bgp_vpnv6_per_nexthop_label, use only global ipv6 addresses
The test is modified so as to use global ipv6 addresses for nexthop
resolution.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-16 12:40:40 +02:00
David Lamparter
cf0eeb3dc1
Merge pull request #12050 from LabNConsulting/working/lb/topotest-220909 2023-05-16 08:31:06 +02:00
Donatas Abraitis
f913ee30ff tests: Drop tableVersion from EVPN PIM test case
tableVersion always incorrectly showed 0 instead of a decent value. Let's get rid
of this from the partial output at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-16 09:06:06 +03:00