Commit Graph

3080 Commits

Author SHA1 Message Date
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
Christian Hopps
44701495bb tests: improve bgp test determinism
don't grep the tail of a log file after running a previous test, there could be
(and have been) other items added to the log in between.

add before and after count of shutdown messages to very the actual message shows
up as the test intended, and keep the search for the shutdown message.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-12 20:36:50 -04:00
Donatas Abraitis
edc886635d
Merge pull request #13463 from pguibert6WIND/mpls_alloc_per_nh_2
Mpls allocatio mode per nexthop
2023-05-12 20:56:01 +03:00
Donald Sharp
907183cb35
Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit
ripd: Implement allow-ecmp X command
2023-05-11 20:31:46 -04:00
Donald Sharp
f1af873fef
Merge pull request #13490 from Jafaral/fix-ospf-asbr-test
tests: improve log messages, clear neighbors to avoid bad state
2023-05-11 20:31:21 -04:00
Jafar Al-Gharaibeh
1fdd28a730 tests: reset neighbor state machine to avoid bad/stale state
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-11 09:51:26 -05:00
Donald Sharp
4ce530f750
Merge pull request #13507 from opensourcerouting/feature/bgp_route-map_match_source-protocol
bgpd: Implement match source-protocol for route-maps
2023-05-11 09:38:57 -04:00
Lou Berger
083d367279 topotest: all_protocol_startup - respect TOPOTESTS_CHECK_STDERR environ variable
Signed-off-by: Lou Berger <lberger@labn.net>
2023-05-11 07:46:19 -04:00
Lou Berger
d4977708f0 topotest: add --memleaks topotest option
Signed-off-by: Lou Berger <lberger@labn.net>
2023-05-11 07:46:19 -04:00
Lou Berger
c6686550c3 topotests: fix looging of memstat results
Signed-off-by: Lou Berger <lberger@labn.net>
2023-05-11 07:46:18 -04:00
Donatas Abraitis
9c3ffc80db tests: Check if match source-protocol route-map cmd works for BGP
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-11 11:40:42 +03:00
Jafar Al-Gharaibeh
ba607fdfcb tests: log the router id in ospf tests, improve log in a couple of places
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-10 23:47:03 -05:00
Jafar Al-Gharaibeh
bc05bccbdc
Merge pull request #13489 from LabNConsulting/ospf-opaque-stale-fix
ospfd: OSPF opaque LSA stale processing fix and topotests.
2023-05-10 15:51:21 -05:00
Christian Hopps
b81bb36960 tests: update to munet 0.13.3, restoring GNU screen functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-10 09:47:57 +00:00
Acee
4e7eb1e62c ospfd: OSPF opaque LSA stale processing fix and topotests.
1. Fix OSPF opaque LSA processing to preserve the stale opaque
            LSAs in the Link State Database for 60 seconds consistent with
            what is done for other LSA types.
         2. Add a topotest that tests for cases where ospfd is restarted
            and a stale OSPF opaque LSA exists in the OSPF routing domain
            both when the LSA is purged and when the LSA is reoriginagted
            with a more recent instance.

Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-09 16:51:03 -04:00
Philippe Guibert
37a02a8dcb topotests: add bgp_vpnv6 test allocation
This test demonstrates that a label is allocated for each
ipv6 next-hop. IPv6 test introduces link local ipv6 addresses
as next hops, and compared to IPv4, one can have two different
next-hops depending if the next-hop is defined by a global
address (static route redistributed) or a bgp peer.

This test checks that:
- The labels are correctly allocated per connected next-hop.
- The default label is used for non connected prefixes.
- The withdraw operation frees the MPLS entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the
associated label will be found out.
- When a prefix moves from one peer to one another behind the
vrf, then the MPLS switching operation for return
traffic is changing the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- Also, when unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09 21:01:08 +02:00
Philippe Guibert
ae5a6bc1f6 topotests: add bgp mpls allocation per next-hop test
A new test suite checks for the mpls label allocation
per nexthop mode. This test checks that:
- The labels are correctly allocated per connected
next-hop.
- The default label is used for non connected prefixes
- The withdraw operation frees the mpls entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the associated
label will be found out.
- When a prefix moves from one peer to one another behind the vrf,
then the MPLS switching operation for return traffic is changing
the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- When unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-05-09 21:00:57 +02:00
Donald Sharp
788db21e73
Merge pull request #13438 from gpnaveen/vrf_on_loopback
tests: removing un used loopback interface from bgp admin dist.
2023-05-09 13:39:18 -04:00
Donald Sharp
ebfbce2e54
Merge pull request #13460 from Jafaral/ospf-fix2
tests: remove sleep ospf test
2023-05-09 13:37:40 -04:00
Donald Sharp
b03eecbd2e
Merge pull request #13470 from crosser/fix-test-frrscript
test_frrscript: fix dep for out of tree build
2023-05-09 11:30:17 -04:00
Samanvitha B Bhargav
accafb6b78 tests: Verify duplicate prefix list delete fix
Added topotest cases for the modification of added
prefix lists.

Author: Vijay kumar Gupta <vijayg@vmware.com>
Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
2023-05-09 03:51:45 -07:00
Jafar Al-Gharaibeh
3446fec118 tests: remove sleep ospf test
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-08 23:08:35 -05:00
Martin Winter
6a3631468d tests: Fix ospfv3 output to include Graceful Restart info
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-05-08 21:47:44 -03:00
Renato Westphal
763c4113aa tests: add tests for OSPF GR unplanned outages
Reuse the exiting GR topotests since planned and unplanned GR should
behave the same.

The only difference is that for unplanned GR there's no preparation
phase. The OSPF daemons are just killed (SIGTERM) and restarted
normally. The tests then proceed to do the same checks they do for
planned GRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-08 21:47:44 -03:00
Eugene Crosser
5b2ee104c2 tests: Fix out of tree build for lua scripting
test_frrscript is run from the `tests` directory and expects the sample
lua script `script1.lua` to be present in the `lib` directory. When the
package is built out of tree (which always happens when a debian
package is built), and scripting is enabled, test fails because the lua
file is not present in the `tests/lib/` subdir of the _build_ directory.

Fix this by adding `script1.lua` as an extra dependency for
`test_frrscript`, and a recipe that copies the file from the source tree
to the build tree (note: it needs to be marked ".PHONY" because
otherwise `make` thinks that it already exists, in the source tree).

After this commit, the following command starts to work:

    dpkg-buildpackage --build-profiles=pkg.frr.lua -b -uc

Signed-off-by: Eugene Crosser <crosser@average.org>
2023-05-09 02:05:44 +02:00
Donatas Abraitis
1da2aac4e3 tests: Adjust AIGP metric numbers for iBGP setup
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-08 23:34:33 +03:00
Donald Sharp
bdcc5df5c3 tests: ospf_metric_propagation should not look for a specific vrfId
There is no guarantee that the vrfId is going to be the same across
tests, as that the vrfId is chosen based upon the ifindex of the
vrf device.  As such we should not be looking for the vrfId, but
the correct vrf name.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-08 08:06:30 -04:00
Donald Sharp
cb7c6fc2b9 tests: ospf_metric_propagation is looking for a specific ifindex
The test ospf_metric_propagation is looking for a specific ifindex
this ifindex is not guaranteed to be any particular value by the underlying
OS.  So let's remove this test for it.  As a side note I am seeing
tests fail in upstream CI because of this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-08 07:47:49 -04:00
Naveen Guggarigoud
2c435e98ad tests: removing un used loopback interface from bgp admin dist.
Signed-off-by: Naveen Guggarigoud <nguggarigoud@vmware.com>
2023-05-05 05:20:40 +00:00
Jafar Al-Gharaibeh
f92f88d361 tests: clear the ospf neighbor to force a state change
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-04 08:27:17 -05:00
Donatas Abraitis
66e0f6c456 tests: Check RIP allow-ecmp an arbitrary number of paths
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:23:26 +03:00
Donatas Abraitis
4972a6ee7f tests: Check if RIP allow-ecmp command can inject specified number of routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:02:42 +03:00
Donatas Abraitis
786e2b8bdb Revert "MPLS allocation mode per next hop"
Broken tests, let's revert now.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-03 13:52:46 +03:00
Donatas Abraitis
99a1ab0b21
Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh
MPLS allocation mode per next hop
2023-05-02 18:36:45 +03:00
Russ White
ccf08bda1a
Merge pull request #13377 from donaldsharp/ospf_dead_interval
tests: Increase the dead interval to be longer for neighbor testing
2023-05-02 10:25:46 -04:00
Donald Sharp
fa8d4970d2
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification
tests: Do not try establishing a connection from r1 to r2
2023-05-02 08:42:43 -04:00
Donatas Abraitis
bec4eeedc4
Merge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto
bgpd, tests: srv6 "no sid vpn export auto" per AF in vtysh
2023-05-01 22:07:03 +03:00
Donald Sharp
4c5f1eeb60
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
startup log timestamp precision build option
2023-05-01 09:51:46 -04:00
Christian Hopps
3e09791861 tests: change topotest log timestamp precision to 6.
- Often millisecond precision is not good enough to differentiate things that
occur directly one after another, and things that have some pause in between,
increase to microsecond precision (reporting)

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29 02:36:17 -04:00
Dmytro Shytyi
4eef588ac3 tests: validate sid export per-vrf and per-af
Verify activation and desactivation of per-vrf and per-af
sid export. Modify the configuration of r2 and verify that
changes are reflected in r1 and on connectivity between ce1 and c2.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-04-28 22:51:12 +02:00
Carmine Scarpitta
778d75a6f2 tests: Fix bgp_srv6l3vpn_to_bgp_vrf3 topotest
The `bgp_srv6l3vpn_to_bgp_vrf3` topotest tests the SRv6 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.

The `bgp send-extra-data zebra` option has been accidentally commented
out in commit 2007e2dbd0.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by re-adding
the missing `bgp send-extra-data zebra` option.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-04-28 17:37:03 +02:00
Donatas Abraitis
47074a99e4 tests: Do not try establishing a connection from r1 to r2
If r1 becomes the "server" (= local port 179), then it initiates the connection
after sending BGP Notification (BFD Down) and r2 resets the last error code.

Telling r1 do not connect to r2, fixes the issue.

Tested with `pytest -s -n 48` at least 20 times - no failures.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-26 21:51:33 +03:00
Russ White
257fddaeb6
Merge pull request #13246 from opensourcerouting/rip-bfd
ripd: support BFD integration
2023-04-25 11:54:32 -04:00
Russ White
0ed5c87cfe
Merge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list
ripd: Create non default passive interface if defined so
2023-04-25 11:07:31 -04:00
Russ White
4855ca5e56
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community
bgpd: Add Node Target Extended Communities support
2023-04-25 11:06:23 -04:00
Donald Sharp
7a59014e7d tests: Run black on test_ospf_lan.py
frrbot unhappy.
Let's bring a smile to it's life.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:54:07 -04:00
Donald Sharp
a602765471 tests: Increase the dead interval to be longer for neighbor testing
the ospf_basic_functionality/test_ospf_lan.py script is setting
up a lan env that will have 4 ospf routers on it and shutting/no
shutting interfaces with various priorities to see that ospf
is properly choosing roles.  I am consistently seeing the
ospf_basic_functionality/test_ospf_lan.py script failing
where it is saying a neighbor is not in the correct state.

Upon examination of the logs we are seeing this:

2023/04/24 09:16:42 OSPF: [M7Q4P-46WDR] vty[7]@(config)# interface r0-s1-eth0  <----- This is where we no shut the interface
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:53 OSPF: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task ospf_ism_event (556af08a5b4c) ran for 6038ms (cpu time 0ms)
2023/04/24 09:16:53 OSPF: [HKQ2F-8D0MY][EC 100663315] Thread Starvation: {(thread *)0x556af19da020 arg=0x556af19c0dd0 timer  r=-5.086     ospf_ase_calculate_timer() &ospf->t_ase_calc from ospfd/ospf_ase.c:635} was scheduled to pop greater than 4s ago
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@> enable
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@# show ip ospf neighbor all
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable

This test is setting the dead interval to 4 seconds, seeing a 6 second delay where the os has gone to town
(probably because of the high load on the system ) and not choosing the correct neighbor as the DR.

OSPF when coming up and after seeing the first neighbor, goes into a waiting period before
the DR is elected.  If the neighbor does send it's hello packets but they are not processed
before the wait timer pops because of the starvation event, then the wrong neighbor
will be elected DR.  Let's give this test a bit more time to decide who the
DR is in case everything goes a bit south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:52:31 -04:00
Christian Hopps
1a68b13867 tests: fix missed passing pytestconfig arg
Remove the local ConfigOptionProxy and actually use the munet one.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Christian Hopps
7d12017bd8 tests: import munet 0.13.2
fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Donald Sharp
ea4163ce49
Merge pull request #13365 from LabNConsulting/chopps/add-perf-option
Add ability to profile daemons in topotest with --perf
2023-04-24 07:38:45 -04:00
Donatas Abraitis
766fcb6056
Merge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native
cfgopt in munet and native config support and example
2023-04-24 13:50:36 +03:00
Christian Hopps
e6079f4fa4 tests: add --perf and --perf-options for profiling daemons
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 21:53:44 -04:00
Donald Sharp
3eefea9249
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
lib: typesafe shenanigans
2023-04-23 15:06:59 -04:00
Christian Hopps
a929d94ff5 tests: add an example of using munet native config
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 15:02:46 -04:00
Christian Hopps
0def198cd3 tests: enable using munet native configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00
Christian Hopps
d9de3cc48b tests: munet now supports cfgopt directly
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00
Christian Hopps
67afd9293d tests: import munet version 0.13.1
- adds more generic config option handling than pytestconfig
- Change to search order for kinds.yaml

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:51:46 -04:00
Christian Hopps
9001ae5a67 tests: import munet version 0.12.16
Fixes bad fixed path use and rootcmd functionality to run things
in the root namespace (all but pid at least).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 01:29:49 -04:00
Donald Sharp
2da3174115
Merge pull request #13332 from LabNConsulting/chopps/new-opts 2023-04-22 19:51:05 -04:00
Christian Hopps
c510a9e451 munet: import 0.12.15
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-22 13:10:52 -04:00
Christian Hopps
449e25552b tests: fix ASAN file cleanup and --asan-abort option
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-22 13:10:52 -04:00
Christian Hopps
346374b04f tests: will need new pid_exists if using pid namespaces
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:13:04 -04:00
Christian Hopps
2b62abe441 tests: restore per-node logging functionality
After the munet switch we weren't passing the logger on to low-level
LinuxNamespace and thus Commander parent classes, so the lowest-level
`cmd_status` logs were missing from more specific log files in the run
directory.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
260268c45c tests: fix check for daemon startup, remove sleep hack
- 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-21 22:10:54 -04:00
Christian Hopps
ff28990ee4 tests: add --logd option
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
773fd82ed5 tests: add --pcap and --pause-at-end options
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
249ac6f0f2 tests: cleanup access to pytest config
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-21 22:10:54 -04:00
Christian Hopps
7592b2ccae tests: blacken re-format
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:48 -04:00
David Lamparter
5523a505f4 lib: fix _hash_member() crash w/ empty hash
The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.

Test case added to tests/lib/test_typelist.

Note this function is not currently used anywhere.  Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 16:30:32 +02:00
Donald Sharp
de35b3c29a
Merge pull request #13327 from opensourcerouting/fix/rip_status_align
ripd: Align show ip rip status output for sources
2023-04-21 09:41:00 -04:00
Philippe Guibert
7b343a9ed5
Merge pull request #12933 from Orange-OpenSource/link_state
lib: Update edge key in link state database
2023-04-20 18:33:21 +02:00
Donatas Abraitis
696172d7bd tests: Align show ip rip status output in tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-19 22:08:03 +03:00
Donatas Abraitis
5db1931962
Merge pull request #13166 from Jafaral/ospf-external-metric
ospfd: use rib metric as the base for set metric +/-
2023-04-19 21:11:25 +03:00
Rafael Zalamena
7001bdb7b2 topotests: RIP BFD integration topology test
Add new RIP topology to test the BFD integration and RIP ECMP:
shutdown a link and expect the RIP route change immediately instead of
regular RIP timer.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-04-19 11:17:52 -03:00
Donatas Abraitis
0a2268c28e tests: Check if RIPd passive-interface works as expected
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-18 22:37:53 +03:00
Olivier Dugeon
fd4377d9a5
Merge pull request #11667 from louis-6wind/flexalgo-mpls
isisd: Flex-Algo for SR-MPLS
2023-04-18 14:45:30 +02:00
Hiroki Shirokura
b901ee6383 tests: add isis_sr_flex_algo_topo2 for flex-algo
Add a topotest with 9 flex-algo routers to check each router's MPLS
table.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
1a61ef95b2 tests: add isis_sr_flex_algo_topo1 for flex-algo
Add a topotest to check some Flex-Algo configuration changes.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Eric Kinzie
42ac448538 isisd: add option to display isis routes as json
Append an optional parameter to "show isis route [prefix-sid]" that
formats the output as a JSON array.

Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
78774bbcd5 isisd: add isis flex-algo lsp advertisement
Deal with the packing and unpacking of following Flex-Algo
Sub-Sub-TLVs:

- Router Capability (already defined TLV 242)
	- List of the Flex-Algo Definitions (Sub-TLV 26)
		- Exclude admin group (Sub-Sub-TLV 1)
                - Include-any admin group (Sub-Sub-TLV 2)
                - Include-all admin group (Sub-Sub-TLV 3)
                - Flags (for prefix-metric) (Sub-Sub-TLV 4)

This commit splits data into multiple router capability TLVs if needed
because a TLV cannot contains more than 255 bytes.

Note that the list of SR Algorithm (Sub-TLV 19) within Router Capability
(TLV 242) is already set in a previous commit.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
0de7b43308 isisd: update isis_tlvs_add_*_reach() with multi algorithm
isis_tlvs_add_extended_ip_reach adds IS-IS Extended
IP reachability to the LSP. In this case, if the
pcfg argument is not NULL, you can add IGP
Prefix-SID as its sub tlv.

Before this commit, only one Prefix-SID can be added.
After this commit, the argument is not a single
pointer but an array of pointers, and multiple
Prefix-SIDs can be added.

This feature is necessary because Flex-Algo
requires multiple Prefix-SIDs for each Algorithm.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:11:52 +02:00
Jafar Al-Gharaibeh
360ed671bc tests: add a topotest for ospf metric propagation across vrfs/protocols
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-04-18 00:48:16 -05:00
Donald Sharp
eda79af4a4
Merge pull request #13230 from LabNConsulting/micronet-is-munet
Micronet is munet
2023-04-17 13:35:29 -04:00
Donatas Abraitis
89618e7e5e
Merge pull request #13320 from LabNConsulting/fix-show-opdata-command
Fix show opdata command
2023-04-17 14:51:38 +03:00
Hiroki Shirokura
329f87b310 isisd: update struct isis_spftree with algorithm id
The spftree has a new property called algorithm
which is id used to identify the algorithm that
separates it in the same IGP network. This is
used in Flex-Algo. In other cases than Flex-Algo,
the algorithm id is always zero.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-17 11:06:08 +02:00
Donatas Abraitis
e7fd314f06
Merge pull request #12550 from AbhishekNR/mld_join
pim6d: Implementing "ipv6 mld join"
2023-04-17 11:01:21 +03:00
Christian Hopps
9b3fd1ef69 tests: use a more specific xpath for finding the route JSON data
Rather than requesting the data for the entire model, just request the route
data for the specific prefix. This also tests the xpath code (which was
previously broken).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:18:56 -04:00
Christian Hopps
b5c12fb1f1 tests: use shlex.quote to pass command arg to vtysh
This makes sure any included quotation is properly escaped and passed
through to vtysh.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps
b70b22af95 tests: quick fix for --gdb-daemons=DAEMONLIST not working
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-17 02:15:32 -04:00
Donatas Abraitis
eee1fca3eb
Merge pull request #13141 from mjstapp/fix_ospf_json_keys
ospfd: remove deprecated json attrs for neighbor show
2023-04-16 21:33:20 +03:00
Christian Hopps
60e037780e tests: switch to munet
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 13:29:38 -04:00
Christian Hopps
c568b4ac4f tests: restart bgpd to avoid warnings in follow on tests
The tests are killing bgpd and then ending, the next test is checking for all
daemons running and spewing warnings to stderr. Restart the daemons before
ending the test (like other tests in this same module) to avoid this.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 09:39:05 -04:00
Christian Hopps
352ddc72b7 tests: import munet 0.12.12
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 08:48:19 -04:00
Christian Hopps
7c5d70611a tests: fix warning, incorrect use of is.
Remove the never-executed code.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-14 17:23:58 -04:00
Donald Sharp
e503294060 tests: Run formatting script on test_isis_advertise_high_metrics.py
Apparently this is needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-13 07:29:00 -04:00
Donald Sharp
8356f48119
Merge pull request #13284 from isabelladeleon12/fix_adv_high_metrics_ut_warning
tests: Fix topotest invalid escape sequence in isis_advertise_high_me…
2023-04-13 07:26:37 -04:00
Donatas Abraitis
0667f62411
Merge pull request #13276 from pguibert6WIND/explicit_null_complement
Explicit null complement
2023-04-13 08:56:04 +03:00
Donald Sharp
13a1758a6a
Merge pull request #13177 from mjstapp/fix_ospf_supoort_typo
ospf,ospf6: fix json key typo supoort
2023-04-12 14:26:22 -04:00
Isabella de Leon
d3f6aa39df tests: Fix topotest invalid escape sequence in isis_advertise_high_metrics test
Modify test to fix issue 13283

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-04-12 10:53:07 -07:00
Philippe Guibert
6d5f16a45c topotests: fix bgp lu explicit-null test
The label value for the given prefix was ignored,
as the compare function always returns ok.
Do return the json compare output.

Fixes: eee086e6d2 ("topotests: add topotest to check bgp lu explicit-null service")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-12 17:45:52 +02:00
Jafar Al-Gharaibeh
7a29a05023
Merge pull request #13183 from Pdoijode/pdoijode/pim-json-changes
pimd: Option to get IGMP groups and sources for a particular interface
2023-04-11 23:46:18 -05:00
Donatas Abraitis
068c4dfe0b tests: Check if Node Target Extended Communities work
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-11 23:26:33 +03:00
Mark Stapp
f827dc810c
Merge pull request #13258 from donaldsharp/evpn_ping
Evpn ping
2023-04-11 16:15:44 -04:00
Mark Stapp
425e2278d5
Merge pull request #13260 from donaldsharp/bgp_l3vpn_to_vrf_scale_up
tests: Ensure that the scale_up.py script tests for actual sharp inst…
2023-04-11 16:05:32 -04:00
Pooja Jagadeesh Doijode
5519cabe4c pimd: Option to get IGMP groups and sources for a particular interface
1. Added interface name, group address and detail option to existing
   "show ip igmp groups" so that user can retrieve all the groups
   or a particular group for an interface. Detail option shows the source
   information for the group. With that, the show command
   looks like:

   "show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"

2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present

3. Changed "detail" option to print non pretty JSON

4. Added interface name and group address to existing
   "show ip igmp sources" so that user can retrieve all the sources for
   all the groups or, all the sorces for a particular group for an
   interface. With that, the show command looks like:

   "show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-04-11 11:00:39 -07:00
Donald Sharp
66d0d2184e tests: Ensure that the scale_up.py script tests for actual sharp installed routes first
The scale_up.py script used by several tests installs 50k routes into the rib from
sharpd.  It is first looking for the results in the bgp database.  Let's ensure
that the routes are actually installed into the rib first before looking in
the bgp tables.  This should help situations where the system is under extreme
load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 10:49:34 -04:00
Philippe Guibert
eee086e6d2 topotests: add topotest to check bgp lu explicit-null service
The test ensures that the incoming prefixes are received with
the appropriate label value, and that connectivity is ensured
between prefixes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-11 16:08:15 +02:00
Donald Sharp
d6f34434e8 tests: Cleanup formatting in a couple of test scripts
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 09:16:36 -04:00
Donald Sharp
18a8f40793 tests: Fix evpn tests to ensure mac addresses will show up
Locally, the bgp_evpn_vxlan_svd_topo1 and bgp_evpn_vxlan_topo1
tests are failing for me.  Upon inspection the test is looking
for the mac addresses of the interfaces participating in the
evpn bridging on the hosts.  For some reason on my machine
these mac addresses are not in the l2 tables at all on
PE1 or PE2.  Adding quick pings solves the problems.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 09:15:13 -04:00
Jafar Al-Gharaibeh
8b985768bf
Merge pull request #13239 from opensourcerouting/fix/enable_scripting_for_docker_alpine_build
docker: Fix --enable-scripting for Docker images
2023-04-10 11:29:20 -05:00
Donatas Abraitis
897bb1675e tests: Copy script1.lua for make dist
This is needed for `make dist` when building Docker images with Lua support.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-08 21:04:07 +03:00
Christian Hopps
8d6765aa6d tests: fix cause of intermittent failure
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-08 04:03:11 +00:00
Mark Stapp
a63fecfb56 ospf,ospf6: fix json key typo supoort
Fix json key 'supoort' -> 'support'; add 1-year deprecation
notice; fix topotests to use corrected json key.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:19:01 -04:00
Mark Stapp
c42ac5f64b tests: replace deprecated ospf json keys
Replace many deprecated json keys in topotests after removing
those keys from ospfd.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:17:59 -04:00
Jafar Al-Gharaibeh
d5243675f2
Merge pull request #13109 from LabNConsulting/topotest-cleanup
minor topotest cleanup
2023-04-07 14:45:33 -05:00
Igor Ryzhov
083369e16a
Merge pull request #13228 from LabNConsulting/chopps/json-via-yang
Update ripd YANG operational state (ECMP routes)
2023-04-07 17:56:54 +03:00
Olivier Dugeon
c62067c1a6 tests: Update TE topotests to follow new Edge Key
Following replacement of Edge Key type (uint64_t by new structure), this patch
updates the various TE topotests to the new Edge Key references.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Donatas Abraitis
83c78d54c2 tests: Check if RIP allow-ecmp command works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 04:21:25 -04:00
Christian Hopps
19003d6e99 tests: don't warn with expected results
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:58:15 +00:00
Christian Hopps
fa773d1109 tests: initialize parent test namespace too
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
66707495d9 tests: cleanup infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
cd453c23f6 tests: create 8 link, switch pairs, not 8 links on one switch
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
eb9e801f8b tests: don't flush ipv6 addresses
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Donald Sharp
aa056a2a64 bgpd: Treat withdraw variable as a bool
Used as a bool, treated as a bool.  Make it a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 17:41: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