Commit Graph

3911 Commits

Author SHA1 Message Date
Carmine Scarpitta
5351018240 tests: Add json to verify rt1 SRv6 locators
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
af0499e028 tests: Add json to verify rt1 ipv6 routes
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
b8d40ea6d6 tests: Add json to verify rt1 ip routes
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
740c073692 tests: Add json to verify rt1 vpn rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
020fe7d766 tests: Add json to verify rt1 vrf20 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
cb968ad782 tests: Add json to verify rt1 vrf10 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
89b3886429 tests: Add zebra configuration for rt1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
d305ff4e31 tests: Add sharp configuration for rt1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
e61f48b902 tests: Add ISIS configuration for rt1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
dc1b3c4869 tests: Add BGP configuration for rt1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
613fd9a631 tests: Add zebra configuration for dst
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
e82f79ff75 tests: Add sharp configuration for dst
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
4de80634cc tests: Add json to verify ce6 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
2b62990b3b tests: Add zebra configuration for ce6
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
8d171d4d32 tests: Add BGP configuration for ce6
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
afbcc80db1 tests: Add json to verify ce5 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
f4231f36a8 tests: Add zebra configuration for ce5
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:03 +02:00
Carmine Scarpitta
fe0074ca56 tests: Add BGP configuration for ce5
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
153e5df38e tests: Add json to verify ce4 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
95ef7956cf tests: Add zebra configuration for ce4
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
b3dc1d4b4f tests: Add BGP configuration for ce4
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
948c3a37ca tests: Add json to verify ce3 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
9275d8423d tests: Add zebra configuration for ce3
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
7a907a9042 tests: Add BGP configuration for ce3
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
eb6458cec3 tests: Add json to verify ce2 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
b8cc37e6fe tests: Add zebra configuration for ce2
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
0c116a5e7a tests: Add BGP configuration for ce2
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
b8121539ac tests: Add json to verify ce1 rib
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
f88c7a7d73 tests: Add zebra configuration for ce1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Carmine Scarpitta
220f7fd588 tests: Add BGP configuration for ce1
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-06 23:08:02 +02:00
Donatas Abraitis
f3f96f95bd
Merge pull request #16746 from Jafaral/nhrp-test
tests: nhrp, use unified config, remove misleading error log
2024-09-06 09:43:00 +03:00
Donald Sharp
340d51fc3a
Merge pull request #16751 from opensourcerouting/fix/solo_peer-group
bgpd: Some peer-groups related changes/fixes
2024-09-05 17:42:20 -04:00
Martin Winter
97f14c5e5e
tests: Skip bgp_l3vpn vrf tests on 32bit systems
Tests may fail because of limited memory on 32bit system

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2024-09-05 15:57:35 +02:00
Donatas Abraitis
b63315f15d tests: Check if we can use solo with a peer-group
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-05 16:31:36 +03:00
Donatas Abraitis
014acb15d6 tests: Add valid, bestpath, and selectionReason to JSON files
They are expected in router_vrf_json_cmp_exact_filter(), because it has
exact=True.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-05 12:49:42 +03:00
Donatas Abraitis
34f7a5730b tests: Check if VPN routes can be imported with a next-hop in a default VRF
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-05 11:38:07 +03:00
Jafar Al-Gharaibeh
2054b49c40 tests: nhrp, use unified config, remove misleading error log
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-05 00:00:52 -05:00
Christian Hopps
a88f3c2d1c tests: improve example munet test
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-03 00:45:55 -04:00
Christian Hopps
08253740ef tests: fix munet native topotest runs
Enabe/fix using a munet.yaml config file for topology configuration.
Easier test writing.

This also uses the standard `frrinit.sh` to launch and teardown
FRR, so we actually test what most users use.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-03 00:45:48 -04:00
Jafar Al-Gharaibeh
745cd3e6bf
Merge pull request #16711 from donaldsharp/memory_type_stuff
Memory type stuff
2024-09-01 19:44:29 -04:00
Donatas Abraitis
2931b78537
Merge pull request #16698 from louis-6wind/fix-nhrp-redundancy
nhrpd, test: fix nhrp_redundancy topotest
2024-09-01 20:30:02 +03:00
Donald Sharp
d97c535c1e *: Create termtable specific temp memory
When trying to track down a MTYPE_TMP memory leak
it's harder to search for it when you happen to
have some usage of ttable_dump.  Let's just give
it it's own memory type so that we can avoid
confusion in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-01 13:07:46 -04:00
Donald Sharp
3bf359b04e
Merge pull request #16701 from Jafaral/unified-config
tests: detect all daemons correctly when using frr.conf
2024-08-31 08:56:55 -04:00
Jafar Al-Gharaibeh
02256fd23b tests: detect all daemons correctly when using frr.conf
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-08-30 14:35:31 -05:00
Louis Scalbert
64ad1dca42 tests: use private addresses in nhrp_redundancy
Use private addresses in nhrp_redundancy.

> cd tests/topotests/nhrp_redundancy
> git grep 176.16  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|176.16|172.16|g' -i
> git grep 5.5.5.  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|5.5.5.|10.5.5.|g' -i
> git grep 4.4.4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|4.4.4.|10.4.4.|g' -i

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
94ba96747b tests: check show ip nhrp shorcut in nhrp_redundancy
Check show ip nhrp shorcut in nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
25e10819e3 tests: fix iptables command in nhrp_redundancy
Replace --nflog-range argument by --nflog-range due to:

> 2024-08-30 10:44:54,816 INFO: topo: input: iptables -A FORWARD -i nhs3-gre0 -o nhs3-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128
> 2024-08-30 10:44:54,819 INFO: topo: output: warn: --nflog-range has never worked and is no longer supported, please use --nflog-size insted

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
2933d7f236 tests: fix nhs1 down check in nhrp_redundancy
Fully check the NHRP convergence after setting nhs1 down. Otherwise the
ping may pass because the previous shortcut is still present.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
432b60d194 tests: fix nhc1 route check after nhs1 down
After setting down nhs1, the test is checking that nhc1 routing table
matches routes in nhc1/nhrp_route.json. It is incorrect because it
checks that the NHRP route to nhs1 is still present but it should have
disappeared.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
7a082e04f4 tests: simplify nhrp_redundancy convergence
Simplify nhrp_redundancy convergence code. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
76d84020a8 tests: rename router variables in nhrp_redundancy
Rename router variables in nhrp_redundancy to match the actual name.
Cosmetic change to help debugging.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:22 +02:00
Louis Scalbert
5f058cdef7 tests: rename routers in nhrp_redundancy
Rename routers in nhrp_redundancy to match the diagram. Cosmetic change.

> cd tests/topotests/nhrp_redundancy
> git grep r1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r1|nhs1|g' -i
> git grep r2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r2|nhs2|g' -i
> git grep r3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r3|nhs3|g' -i
> git grep r4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r4|nhc1|g' -i
> git grep r5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r5|nhc2|g' -i
> git grep r6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r6|router|g' -i
> git grep r7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r7|host|g' -i
>
> git grep R1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R1|nhs1|g' -i
> git grep R2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R2|nhs2|g' -i
> git grep R3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R3|nhs3|g' -i
> git grep R4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R4|nhc1|g' -i
> git grep R5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R5|nhc2|g' -i
> git grep R6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R6|router|g' -i
> git grep R7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R7|host|g' -i
>
> mv r1 nhs1
> mv r2 nhs2
> mv r3 nhs3
> mv r4 nhc1
> mv r5 nhc2
> mv r6 router
> mv r7 host

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:59:07 +02:00
Louis Scalbert
f04191f559 tests: apply black nhrp_redundancy
Apply black nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 14:55:34 +02:00
Louis Scalbert
43cc850def tests: fix prefix length in nhrp_redundancy
The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP
client 1 nhc1 (aka. r5) are not reachable via NHRP.

The issue was not seen in the FRR official CI because the tests were
skipped because iptables were missing in CI machines.

It solves the 16690 issue.

Fixes: https://github.com/FRRouting/frr/issues/16690
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 13:55:31 +02:00
Jafar Al-Gharaibeh
5752fc86ee tests: increase the timeout for packet padding check
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-08-29 11:40:50 -05:00
Jafar Al-Gharaibeh
77e1a26faa
Merge pull request #16664 from mjstapp/igor_debug_simplify
*: simplify frrlib debug
2024-08-29 11:51:53 -04:00
Mark Stapp
ac2d9bae5c
Merge pull request #16680 from donaldsharp/route_scale_minor_changes
tests: Fix route-scale at higher ecmp
2024-08-29 08:17:34 -04:00
Jafar Al-Gharaibeh
12a3d5a748
Merge pull request #16683 from donaldsharp/test_ospf_netns_vrf_failure
tests: ospf_netns_vrf should give more time for coming up
2024-08-29 01:12:40 -04:00
Jafar Al-Gharaibeh
648566c6fb
Merge pull request #16682 from donaldsharp/bgp_suppress_test
tests: Ensure bgp suppress fib has a chance to transmit data to peer
2024-08-29 01:12:17 -04:00
Jafar Al-Gharaibeh
216ed8c796
Merge pull request #16673 from donaldsharp/default_original_sin
tests: Fix bgp_default_originate_topo1_3
2024-08-28 15:30:12 -04:00
Donald Sharp
ce74a6b0a8 tests: Fix route-scale at higher ecmp
Recent commits moved the default retries to 60, but
the higher ecmp counts were over-riding to 40.  Let's
make it 80.

Noticed this when I went looking at failures on 386 platforms
in our ci.  Route scale is timing out when deleting routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-28 15:18:24 -04:00
Donald Sharp
d58c44cebe tests: ospf_netns_vrf should give more time for coming up
Test fails:

            test_func = partial(
                topotest.router_json_cmp,
                router,
                "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
                expected,
            )
            _, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
            assertmsg = '"{}" JSON output mismatches'.format(rname)
>           assert diff is None, assertmsg
E           AssertionError: "r1" JSON output mismatches
E           assert Generated JSON diff error report:
E
E             > $->r1-ospf-cust1->areas->0.0.0.0->nbrFullAdjacentCounter: output has element with value '1' but in expected it has value '2'

/home/sharpd/frr2/tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py:239: AssertionError

Support bundle has this data:
r1# show ip ospf vrf all neighbor
% 2024/08/28 14:55:54.763

VRF Name: r1-ospf-cust1

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.255.3        1 Full/DR         10.547s           39.456s 10.0.3.1        r1-eth1:10.0.3.2                     0     0     0
10.0.255.2        1 Full/Backup     0.543s            38.378s 10.0.3.3        r1-eth1:10.0.3.2                     1     0     0

So immediately after the test fails this test, the neighbor comes up.
Let's give the test a bit more time for failure to not happen

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-28 15:10:04 -04:00
Donald Sharp
3797454a2a tests: Ensure bgp suppress fib has a chance to transmit data to peer
Giving only 5 seconds to pass bgp data to peers on a heavily
loaded system is a recipe for not having fun.  Add more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-28 15:05:40 -04:00
Mark Stapp
8b23abf36e
Merge pull request #16300 from donaldsharp/local_connected
Local connected
2024-08-28 14:10:14 -04:00
Donald Sharp
598d9a1f17 tests: Fix bgp_default_originate_topo1_3
This test was killing bgp on r1 and r2
and then immediately testing that the
default route transitioned.  Unfortunately
the test was written that under load the
system might be in a bad state.  Let's
modify the code to check for a bgp version
change and then that the bgp state has
come back up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-28 11:09:32 -04:00
Igor Ryzhov
82e52e0f21 lib: common debug config output
Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27 09:53:02 -04:00
Igor Ryzhov
5dac696154 lib: rework debug init
The debug library allows to register a `debug_set_all` callback which
should enable all debugs in a daemon. This callback is implemented
exactly the same in each daemon. Instead of duplicating the code, rework
the lib to allow registration of each debug type, and implement the
common code only once in the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27 09:53:02 -04:00
Mark Stapp
17fffbad1b
Merge pull request #16656 from donaldsharp/minor_fix_for_pim_dr_nondr
tests: Allow convergence before adding multicast routes
2024-08-27 08:17:46 -04:00
Donald Sharp
37dd51867f tests: Add some tests to show new behavior works as expected
a) A noprefix address by itself should not create a connected route.
   This was pre-existing.
b) A noprefix address with a corresponding route should result in a
   connected route.  This is how NetworkManager appears to work.
   This is new behavior, so a new test.
c) A route is added to the system from someone else.
   This is new behavior, so a new test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-27 06:25:34 -04:00
Jafar Al-Gharaibeh
0d745741c9 tests: Fix frequent ospfv3 basic functionality test failure
The dead timer is set to 4 seconds, while the hello interval is set to 6535.
This test will only pass of the platform is fast enough for ospfv3 to
converge in 4 seconds. These timers were already tested multiple time earlier.
This test should just make sure that the boundary value 65535 is configurable,

Other changes in this commit:
  - add sequence numbers to the dead intervals tests to make it easier to
    track test faliures.
  - swap the config order in one test to match order with all other tests.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-08-26 16:35:37 -05:00
Donald Sharp
3c4ffcacfe tests: Allow convergence before adding multicast routes
Current code adds a new vlan interface, sets up ospf and
pim on it and immediately starts shoving data down the pipes.
This of course has the fun thing where the IGP and pim do not
always come up in a nice neat manner and the test is looking
for state from a nice neat come up, even though pim is `working`
correctly it is not correct for what the test wants.

Modify the code to ensure that ospf is up and has propagated
the route where it is needed as well as that pim neighbors have
properly come up, then initiate the multicast streams and igmp
reports.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-26 16:02:46 -04:00
Donald Sharp
3d8ccdb115
Merge pull request #16615 from Jafaral/revert-v4-v6-bgp
Revert ipv4-mapped ipv6 and 6vpe nexthop in BGP
2024-08-22 17:57:38 -04:00
Jafar Al-Gharaibeh
741c030395 Revert "Merge pull request #15368 from louis-6wind/fix-6pe"
This reverts commit df98e88368, reversing
changes made to b652119235.
2024-08-22 10:38:09 -05:00
Donald Sharp
05c17eff06
Merge pull request #16450 from nabahr/static_joins
PIM: Implement static IGMP joins without an IGMP report
2024-08-22 11:32:56 -04:00
Jafar Al-Gharaibeh
879460ce27
Merge pull request #16613 from donaldsharp/weight_issues
Weight issues
2024-08-22 11:19:54 -04:00
Jafar Al-Gharaibeh
db71bebc2a
Merge pull request #16620 from LabNConsulting/new-munet-0-14-10
tests: update munet to 0.14.10
2024-08-22 11:14:18 -04:00
Donatas Abraitis
18e2d0d1a9
Merge pull request #16621 from LabNConsulting/fix-grpc-client
tests: dont print sys.path when running grpc-query.py
2024-08-22 09:41:34 +02:00
Christian Hopps
436e4d9755 tests: dont print sys.path when running grpc-query.py
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>
2024-08-21 22:07:25 -04:00
Christian Hopps
cff1103843 tests: update munet to 0.14.10
Changes:

- mutini: handle possible missed zombie cleanup leading to test hangs
- mutini: also we avoid logging in the signal handler which was causing
  an exception.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-08-21 21:05:48 -04:00
Jafar Al-Gharaibeh
0097489b4a Revert "Merge pull request #15614 from louis-6wind/fix-6pe-address"
This reverts commit b3600d82dc, reversing
changes made to 51119823d0.
2024-08-21 13:37:43 -05:00
Jafar Al-Gharaibeh
0d2d20825e Revert "Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6"
This reverts commit cc0fdd3b1d, reversing
changes made to 4e208087fd.
2024-08-21 13:26:50 -05:00
Donald Sharp
b62de7de2e zebra, tests: Connected and Local routes should have a weight of 1
All routes received by zebra from upper level protocols have a weight
of 1.  Let's just make everything extremely consistent in our code.
Lot's of tests needed to be fixed up to make this work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-21 10:17:47 -04:00
Dmytro Shytyi
e23005f407 topotest: test_bgp_snmp_bgpv4v2_notification
This test checks the bgp crash on rt2 when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password 8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: test if rt2 bgp is crashed.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2024-08-21 15:27:12 +02:00
Nathan Bahr
7ce2a1b8fb tests: Added new topotest for pim igmp static groups
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>
2024-08-15 17:10:32 +00:00
Mark Stapp
6de80911b0
Merge pull request #16586 from donaldsharp/fix_route_scale_startup
tests: Fix route_scale startup issues
2024-08-15 09:21:12 -04:00
Donald Sharp
b0c86804f8 tests: Fix route_scale startup issues
Upstream CI is frequently running into a situation where
the routes are not being installed.  These routes
start at the beginning and suddenly in the middle
they start working properly.

D   1.0.15.183/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D   1.0.15.184/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D   1.0.15.185/32 [150/0] via 192.168.0.1, r1-eth0 inactive, weight 1, 00:10:17
                          via 192.168.1.1, r1-eth1 inactive, weight 1, 00:10:17
D>* 1.0.15.186/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17
  *                       via 192.168.1.1, r1-eth1, weight 1, 00:10:17
D>* 1.0.15.187/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17
  *                       via 192.168.1.1, r1-eth1, weight 1, 00:10:17
D>* 1.0.15.188/32 [150/0] via 192.168.0.1, r1-eth0, weight 1, 00:10:17

Turning on some debugs showed that the failed installed routes are
trying to be matched against the default route.  Thus implying
all the connected routes for the test are not yet successfully
installed.  Let's modify the test(s) on startup to just ensure
that the connected routes are installed correctly.  I am no
longer seeing the problem after this change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-14 10:18:41 -04:00
Mark Stapp
dd146614df tests: add retries to nhg tests in all_proto_startup
The all_protocol_startup topotest needs to allow for some delay
between configuring nexthop-groups and their installation. Add
some wait periods in a couple of nhg test cases.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-08-14 08:37:00 -04:00
Donald Sharp
1563d9f9c8 tests: Fix bgp_duplicate_nexthop python warning
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-12 13:55:26 -04:00
Donald Sharp
c4fdc837c0
Merge pull request #16534 from opensourcerouting/fix/start_ldpd_if_unified
doc: Document on how to start specific daemons with unified config in topotests
2024-08-12 10:25:54 -04:00
Donatas Abraitis
cc0fdd3b1d
Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6
bgpd: fixes for ipv4 mapped ipv6 address
2024-08-12 15:37:36 +03:00
Donatas Abraitis
79cbde8095 tests: Convert self.unified_config to boolean
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-08-11 13:32:11 +03:00
Christian Hopps
2ee9f4d11f tests: wait for test client to connect before running test
Vtysh has been improved to startup very quickly this exposed a race in this
test, where the `clear ip rip...` command ran before the test client that
handles it had finished connecting to mgmtd. Add a retried check for the test
client being connected before issuing the `clear ip rip ...` test command.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-08-07 09:35:52 -04:00
Mark Stapp
975e1a36f6
Merge pull request #16501 from donaldsharp/preprocess_vtysh
Preprocess vtysh
2024-08-02 07:27:04 -04:00
Donald Sharp
9af1f5e823 tests: need aggressive timers in bgp_prefix_list_any
Add some timers to make convergence happan as fast as possible
when a connection fails on the intial attempt.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-31 11:44:06 -04:00
Donald Sharp
b52346efe4 tests: need aggressive timers in bgp_route_map_match_ipv6_nexthop
Add some timers to make the convergence happen as fast as possible
when a connection fails on the initial attempt.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-31 11:01:54 -04:00
Donald Sharp
08bf9cd9f5 tests: Shorten reconnect timer when something goes wrong
When running bfd_bgp_cbit_topo3 and an intial connection
goes wrong, try to connect again as fast as possible as
that the timer is 2 minutes otherwise and the test will
never come back from it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-31 10:47:12 -04:00
Donald Sharp
6f2aea5a13 tests: Increase route_scale timeouts
This test is frequently failing in the upstream CI.  Most
log failures are stating that we expected something like
1 million routes but we have 900k+.  Looks like the system
is just loaded a bit more than expected.  Let's give these
tests a bit more time to complete.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-31 10:45:38 -04:00
David Lamparter
4bc41193e8 vtysh, lib: preprocess CLI graphs
Store a parsed and built graph of the CLI nodes in vtysh, rather than
parsing and building that graph every time vtysh starts up.

This provides a 3x to 5x reduction in vtysh startup overhead:

`vtysh -c 'configure' -c 'interface lo' -c 'do show version'`

- before: 92.9M cycles, 1114 samples
- after: 16.5M cycles, 330 samples

This improvement is particularly visible for users scripting `vtysh -c`
calls, which notably includes topotests.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-07-31 08:08:53 -04:00
Rafael Zalamena
e900c9ba31 topotests: test MSDP authentication
Modify existing MSDP topology to use authentication.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-29 11:41:39 -03:00
Donald Sharp
1877596ebc
Merge pull request #12484 from opensourcerouting/msdp-filter
pimd: MSDP SA filtering support
2024-07-29 10:25:14 -04:00
Donald Sharp
bc50bcb4cf
Merge pull request #16492 from LabNConsulting/ziemba/topotests-lib-bgprib-wait
tests: topotests/lib: add wait to RequireVpnRoutes, RequireUnicastRoutes
2024-07-29 07:56:00 -04:00
Donald Sharp
9ce5a04882
Merge pull request #16490 from adrianomarto/master
tests: Test MSDP RPF
2024-07-28 15:27:45 -04:00
G. Paul Ziemba
460703f3e8 tests: add wait to RequireVpnRoutes, RequireUnicastRoutes
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2024-07-28 09:00:49 -07:00
Adriano Marto Reis
e64d15b17a tests: Test MSDP RPF
Adding a MSDP test with multiple possible routes.

Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
2024-07-28 14:34:24 +10:00
Rafael Zalamena
7b650fb836 topotests: test MSDP SA filtering
Modify existing MSDP topology to use test SA filtering:
- Add new multicast host (so we get two sources for same group)
- Test group only filtering
- Test source / group filtering

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-27 11:32:51 -03:00
Donald Sharp
ce3cea38dd tests: Run black on bgp_vpnv[4|6]_per_nexthop_label
I did not have my formatting right, let's get it
right for these two.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-26 14:19:53 -04:00
Donald Sharp
77a296cb08 tests: Fix test_bgp_vpnv6_per_nexthop_label.py to handle timing changes
So the test script is making changes to a vpn configuration by
changing something fundamental about the vpn.  This is causing
a window where routes we are interested in are:
present ( from pre-change ) then
withdrawn ( the test change causes this ) then
present ( with the new data )

The test code was trying to test for this by checking
to see if the prefix was there, but due to timing issues
it's not always there when we look for it.

Modify the test to get the vpn table version prior to
the change( as that it should not be moving around ) and
then change the test for the prefix to look for a version
that is later than the vpn's table version.  Then we know
that it is *after* everything has stabilized again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-26 14:19:49 -04:00
Donald Sharp
6914cceea2 tests: Fix test_bgp_vpnv4_per_nexthop_label.py to handle timing changes
So the test script is making changes to a vpn configuration by
changing something fundamental about the vpn.  This is causing
a window where routes we are interested in are:
present ( from pre-change ) then
withdrawn ( the test change causes this ) then
present ( with the new data )

The test code was trying to test for this by checking
to see if the prefix was there, but due to timing issues
it's not always there when we look for it.

Modify the test to get the vpn table version prior to
the change( as that it should not be moving around ) and
then change the test for the prefix to look for a version
that is later than the vpn's table version.  Then we know
that it is *after* everything has stabilized again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-26 14:19:43 -04:00
Donald Sharp
c682ddd100 tests: Increase timing of bgp_duplicate_nexthop
a) Make timers more aggressive for this test
b) Double run_and_expect time for one sub test.

These two changes cause this test to pass regularly for
me when this test used to fail regularly for me.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-26 14:19:39 -04:00
Donatas Abraitis
23c756ce68
Merge pull request #16472 from donaldsharp/msdp_bug
pimd: Fix msdp setting of sa->rp
2024-07-25 21:09:19 +03:00
Donald Sharp
c4b4c242ec pimd: Fix msdp setting of sa->rp
The code is clearly incorrect.  After consultation with
the original author this is the decided change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-25 07:50:32 -04:00
Donald Sharp
bd86964db8
Merge pull request #16455 from opensourcerouting/fix/bgp_gr_notifications_timing_flake
tests: Delay initial OPEN after we do `clear bgp`
2024-07-24 13:17:31 -04:00
Donald Sharp
b2654e35e5
Merge pull request #16232 from zhou-run/202406171755
isisd: Even after configuring "no hostname dynamic", the topology still displays the hostname.
2024-07-24 10:30:34 -04:00
Donald Sharp
a694be6019
Merge pull request #16240 from y-bharath14/srib-topotest-f
tests: Avoid using unused modules and variables at FRR test suites
2024-07-24 10:28:43 -04:00
Donatas Abraitis
91e67abb61 tests: Delay initial OPEN after we do clear bgp
Under some circumstances it might happen that the session is quickly UP in the
middle of `clear bgp ...` and `shutdown`. That leads to session be UP, and
the stale routes being cleared quickly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-24 14:30:32 +03:00
Louis Scalbert
d618436211 topotests: bgp_nexthop_mp_ipv4_6, test ipv4-mapped
Test that a IPv4-mapped IPv6 is sent from a peer that has no global IPv6
address.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-07-24 10:20:11 +02:00
Russ White
fba472e848
Merge pull request #16376 from c-po/ospfd-ldp-sync
ospfd: fix internal ldp-sync state flags when feature is disabled
2024-07-23 10:51:46 -04:00
Russ White
9db9128c27
Merge pull request #16330 from donaldsharp/nhg_going_down
zebra: Properly note that a nhg's nexthop has gone down
2024-07-23 10:49:49 -04:00
Donatas Abraitis
8eb78b2d89
Merge pull request #16341 from crosser/preserve-needed-rmacs
zebra: evpn: not coerce VTEP IP to IPv4 in nh_list
2024-07-22 02:53:26 -07:00
Carmine Scarpitta
e3282e26e4 tests: Fix warnings in bgp_srv6l3vpn_to_bgp_vrf3
When performing the `bgp_srv6l3vpn_to_bgp_vrf3` topotest, the following
warnings are observed:

```
2024-07-21 08:01:51,390 WARNING: r1: Router(r1): proc failed: rc 127 pid 52974
	args: /usr/bin/nsenter --mount=/proc/52322/ns/mnt --net=/proc/52322/ns/net --uts=/proc/52322/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,522 WARNING: r2: Router(r2): proc failed: rc 127 pid 52984
	args: /usr/bin/nsenter --mount=/proc/52397/ns/mnt --net=/proc/52397/ns/net --uts=/proc/52397/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/r2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,632 WARNING: ce1: Router(ce1): proc failed: rc 127 pid 52994
	args: /usr/bin/nsenter --mount=/proc/52472/ns/mnt --net=/proc/52472/ns/net --uts=/proc/52472/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,757 WARNING: ce2: Router(ce2): proc failed: rc 127 pid 53004
	args: /usr/bin/nsenter --mount=/proc/52547/ns/mnt --net=/proc/52547/ns/net --uts=/proc/52547/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,878 WARNING: ce3: Router(ce3): proc failed: rc 127 pid 53014
	args: /usr/bin/nsenter --mount=/proc/52622/ns/mnt --net=/proc/52622/ns/net --uts=/proc/52622/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce3/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,997 WARNING: ce4: Router(ce4): proc failed: rc 127 pid 53024
	args: /usr/bin/nsenter --mount=/proc/52697/ns/mnt --net=/proc/52697/ns/net --uts=/proc/52697/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce4/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,109 WARNING: ce5: Router(ce5): proc failed: rc 127 pid 53034
	args: /usr/bin/nsenter --mount=/proc/52772/ns/mnt --net=/proc/52772/ns/net --uts=/proc/52772/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce5/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,225 WARNING: ce6: Router(ce6): proc failed: rc 127 pid 53044
	args: /usr/bin/nsenter --mount=/proc/52847/ns/mnt --net=/proc/52847/ns/net --uts=/proc/52847/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf3/ce6/setup.sh: No such file or directory
	stderr: *empty*
````

This occurs because the topotest attempts to execute the `setup.sh`
file, and the file does not exist.

Let's fix the issue by checking if the `setup.sh` file exists and
executing it only if it does.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-07-21 09:43:06 +02:00
Carmine Scarpitta
5d76346266 tests: Fix warnings in bgp_srv6l3vpn_to_bgp_vrf2
When performing the `bgp_srv6l3vpn_to_bgp_vrf2` topotest, the following
warnings are observed:

```
2024-07-21 08:01:51,390 WARNING: r1: Router(r1): proc failed: rc 127 pid 52974
	args: /usr/bin/nsenter --mount=/proc/52322/ns/mnt --net=/proc/52322/ns/net --uts=/proc/52322/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,522 WARNING: r2: Router(r2): proc failed: rc 127 pid 52984
	args: /usr/bin/nsenter --mount=/proc/52397/ns/mnt --net=/proc/52397/ns/net --uts=/proc/52397/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/r2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,632 WARNING: ce1: Router(ce1): proc failed: rc 127 pid 52994
	args: /usr/bin/nsenter --mount=/proc/52472/ns/mnt --net=/proc/52472/ns/net --uts=/proc/52472/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,757 WARNING: ce2: Router(ce2): proc failed: rc 127 pid 53004
	args: /usr/bin/nsenter --mount=/proc/52547/ns/mnt --net=/proc/52547/ns/net --uts=/proc/52547/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,878 WARNING: ce3: Router(ce3): proc failed: rc 127 pid 53014
	args: /usr/bin/nsenter --mount=/proc/52622/ns/mnt --net=/proc/52622/ns/net --uts=/proc/52622/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce3/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,997 WARNING: ce4: Router(ce4): proc failed: rc 127 pid 53024
	args: /usr/bin/nsenter --mount=/proc/52697/ns/mnt --net=/proc/52697/ns/net --uts=/proc/52697/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce4/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,109 WARNING: ce5: Router(ce5): proc failed: rc 127 pid 53034
	args: /usr/bin/nsenter --mount=/proc/52772/ns/mnt --net=/proc/52772/ns/net --uts=/proc/52772/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce5/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,225 WARNING: ce6: Router(ce6): proc failed: rc 127 pid 53044
	args: /usr/bin/nsenter --mount=/proc/52847/ns/mnt --net=/proc/52847/ns/net --uts=/proc/52847/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf2/ce6/setup.sh: No such file or directory
	stderr: *empty*
````

This occurs because the topotest attempts to execute the `setup.sh`
file, and the file does not exist.

Let's fix the issue by checking if the `setup.sh` file exists and
executing it only if it does.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-07-21 09:42:52 +02:00
Carmine Scarpitta
44ee7a4abe tests: Fix warnings in bgp_srv6l3vpn_to_bgp_vrf
When performing the `bgp_srv6l3vpn_to_bgp_vrf` topotest, the following
warnings are observed:

```
2024-07-21 08:01:51,390 WARNING: r1: Router(r1): proc failed: rc 127 pid 52974
	args: /usr/bin/nsenter --mount=/proc/52322/ns/mnt --net=/proc/52322/ns/net --uts=/proc/52322/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,522 WARNING: r2: Router(r2): proc failed: rc 127 pid 52984
	args: /usr/bin/nsenter --mount=/proc/52397/ns/mnt --net=/proc/52397/ns/net --uts=/proc/52397/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,632 WARNING: ce1: Router(ce1): proc failed: rc 127 pid 52994
	args: /usr/bin/nsenter --mount=/proc/52472/ns/mnt --net=/proc/52472/ns/net --uts=/proc/52472/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce1/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,757 WARNING: ce2: Router(ce2): proc failed: rc 127 pid 53004
	args: /usr/bin/nsenter --mount=/proc/52547/ns/mnt --net=/proc/52547/ns/net --uts=/proc/52547/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce2/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,878 WARNING: ce3: Router(ce3): proc failed: rc 127 pid 53014
	args: /usr/bin/nsenter --mount=/proc/52622/ns/mnt --net=/proc/52622/ns/net --uts=/proc/52622/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce3/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:51,997 WARNING: ce4: Router(ce4): proc failed: rc 127 pid 53024
	args: /usr/bin/nsenter --mount=/proc/52697/ns/mnt --net=/proc/52697/ns/net --uts=/proc/52697/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce4/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,109 WARNING: ce5: Router(ce5): proc failed: rc 127 pid 53034
	args: /usr/bin/nsenter --mount=/proc/52772/ns/mnt --net=/proc/52772/ns/net --uts=/proc/52772/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce5/setup.sh: No such file or directory
	stderr: *empty*
2024-07-21 08:01:52,225 WARNING: ce6: Router(ce6): proc failed: rc 127 pid 53044
	args: /usr/bin/nsenter --mount=/proc/52847/ns/mnt --net=/proc/52847/ns/net --uts=/proc/52847/ns/uts -F /bin/bash -c /bin/bash /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/setup.sh
	stdout: /bin/bash: /media/workspace/frr/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/ce6/setup.sh: No such file or directory
	stderr: *empty*
````

This occurs because the topotest attempts to execute the `setup.sh`
file, and the file does not exist.

Let's fix the issue by checking if the `setup.sh` file exists and
executing it only if it does.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-07-21 09:42:32 +02:00
Nathan Bahr
ddc1c2eeae tests: OSPFv3 hello tests investigation, make assert output unique
These failing tests are hard to track down. Added numbering to each assert
to easily tell where the test fails.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-07-17 12:37:06 -05:00
Christian Breunig
5a70378a47 ospfd: fix internal ldp-sync state flags when feature is disabled
When enabling "mpls ldp-sync" under "router ospf" ospfd configures
SET_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG) so internally knowing
that the ldp-sync feature is enabled. However the flag is not cleared when
turning of the feature using "nompls ldp-sync"!

https://github.com/FRRouting/frr/issues/16375

Signed-off-by: Christian Breunig <christian@breunig.cc>
2024-07-17 10:31:15 +02:00
Donatas Abraitis
c6c0403c61 tests: Check if VRF instance has a different ASN than a default VRF
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-15 16:10:57 +03:00
Donatas Abraitis
7540364e58 tests: Check if multiple VRF instances can have different ASNs
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-15 16:10:57 +03:00
Y Bharath
5b06a17715 tests: Refactoring FRR test suites
Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-07-15 13:09:32 +05:30
Jafar Al-Gharaibeh
ad7a1f9487 tests: tweak timers to avoid frequent failures on slow CI hardware
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-07-12 11:36:52 -05:00
Russ White
52376aa4b6
Merge pull request #16229 from anlancs/ripd/fix-header-show
ripd/ripngd: use common header for display command
2024-07-09 16:12:30 -04:00
Mark Stapp
7d08b29721
Merge pull request #16342 from pguibert6WIND/duplicate_fib_proposal
Duplicate fib proposal
2024-07-09 13:48:37 -04:00
Russ White
685712df44
Merge pull request #16241 from zhou-run/202406191740
isisd: The neighbor entry still displays the deleted hostname of the neighbor.
2024-07-09 11:40:26 -04:00
Russ White
22db85a714
Merge pull request #16258 from opensourcerouting/tsan-20240620
lib, tests: fix some b0rked tests, then fix TSAN warnings
2024-07-09 11:36:24 -04:00
Russ White
29aba901d6
Merge pull request #16352 from opensourcerouting/fix/rename_test
tests: Rename BGP OAD test function
2024-07-08 23:16:20 -04:00
Philippe Guibert
731f74e35f zebra, topotests: do not set nexthop's FIB flag when DUPLICATE present
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>
2024-07-08 15:42:02 +02:00
Philippe Guibert
7dfe12eef8 topotests: bgp_peer_type_multipath_relax, adds the duplicate flag
During the bgp_peer_type_multipath_relax_test, the test does not
check the 'duplicate' flag value of the duplicate nexthop.

Fix this by adding the duplicate value in the expected json files.

Fixes: ee88563ac2 ("bgpd: Add 'bgp bestpath peer-type multipath-relax'")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-07-08 15:15:59 +02:00
Xiao Liang
66a84c7c10 tests: Add IPv6 network adv/withdraw case in bgp_evpn_rt5 topotest
Note that withdrawing IPv6 route should not affect IPv4.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2024-07-08 10:32:03 +02:00
zhou-run
f54970ff43 isisd: The neighbor entry still displays the deleted hostname of the neighbor
1. The lsp_update_data() function will check for the presence of the ISIS_TLV_DYNAMIC_HOSTNAME in the LSP, and then call isis_dynhn_insert() to add a hostname entry corresponding to the LSP ID. However, when the ISIS_TLV_DYNAMIC_HOSTNAME is not present in the LSP, the hostname entry corresponding to the LSP ID should also be deleted.
2. The command “show isis neighbor” invokes isis_adj_name() to display the System ID or hostname, but it does not check the area->dynhostname flag.
3. When the LSP expires and is removed, the corresponding hostname entry should also be deleted.
4. The TLV for LSP fragmentation will not contain the hostname and should be skipped.

Signed-off-by: zhou-run <zhou.run@h3c.com>
2024-07-08 15:53:46 +08:00
Donatas Abraitis
6477f73c0b tests: Rename BGP OAD test function
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-07 18:26:30 +03:00
Donatas Abraitis
cd9bb4dd7e tests: Extended bgp_remote_as_auto topotest with unnumbered case
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-05 15:57:52 +03:00
anlan_cs
b707ed8fe9 tests: update tests for ripd and ripngd
Since the displayed header of "show ip rip" and "show ipv6 ripng" are changed,
we should update tests of ripd and ripngd.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2024-07-05 09:54:06 +08:00
Donatas Abraitis
0dfe25697f bgpd: Implement neighbor X remote-as auto
In some cases (large scale) it's desired to avoid changing configurations, but
let the BGP to automatically handle ASN changes.

`auto` means the peering can be iBGP or eBGP. It will be automatically detected
and adjusted from the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-04 14:42:19 +03:00
Donald Sharp
266b061994 zebra: Properly note that a nhg's nexthop has gone down
Current code when a link is set down is to just mark the
nexthop group as not properly setup.  Leaving situations
where when an interface goes down and show output is
entered we see incorrect state.  This is true for anything
that would be checking those flags at that point in time.

Modify the interface down nexthop group code to notice the
nexthops appropriately ( and I mean set the appropriate flags )
and to allow a `show ip route` command to actually display
what is going on with the nexthops.

eva# show ip route 1.0.0.0
Routing entry for 1.0.0.0/32
  Known via "sharp", distance 150, metric 0, best
  Last update 00:00:06 ago
  * 192.168.44.33, via dummy1, weight 1
  * 192.168.45.33, via dummy2, weight 1

sharpd@eva:~/frr1$ sudo ip link set dummy2 down

eva# show ip route 1.0.0.0
Routing entry for 1.0.0.0/32
  Known via "sharp", distance 150, metric 0, best
  Last update 00:00:12 ago
  * 192.168.44.33, via dummy1, weight 1
    192.168.45.33, via dummy2 inactive, weight 1

Notice now that the 1.0.0.0/32 route now correctly
displays the route for the nexthop group entry.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-03 09:34:55 -04:00
Russ White
59e8f199e9
Merge pull request #16331 from opensourcerouting/feature/bgp_dampening_topotests
tests: Add basic BGP per-safi dampening topotest
2024-07-03 07:23:09 -04:00
Donatas Abraitis
7bde7a698c tests: Add basic BGP per-safi dampening topotest
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-02 17:57:06 +03:00
Donatas Abraitis
9ab41861ce
Merge pull request #16099 from Pdoijode/pdoijode/bgp-gr2
Implement BGP-wide configuration for graceful restart
2024-07-02 16:40:29 +02:00
Russ White
410947f6a7
Merge pull request #15677 from cscarpitta/isis-srv6-sid-manager
isisd: Extend IS-IS to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
2024-07-02 08:32:05 -04:00
vivek
b5682ffbf0 *: Add and use option for graceful (re)start
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>
2024-07-01 13:02:52 -07:00
Pooja Jagadeesh Doijode
ecbca1ae1b tests: Updated topotest and documentation
Added topotest and documentation for BGP wide GR configurations

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2024-07-01 13:02:52 -07:00
Donatas Abraitis
dd6a679e3a tests: Test if RFC 8212 is not involved for BGP confederations
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-27 22:53:24 +03:00
Russ White
cc3519f3e6
Merge pull request #16182 from pguibert6WIND/isis_show_route_paths_json
Isis show route paths json
2024-06-25 11:57:15 -04:00
Russ White
7a87166178
Merge pull request #15838 from fdumontet6WIND/fix_regexx_exclude
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue
2024-06-24 17:08:17 -04:00
Philippe Guibert
d0a142aae4 isisd: override json fields for monitored paths
The json output for isis route paths should use caml format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-21 15:40:23 +02:00
Philippe Guibert
ea6ad95ab5 topotests: isis_topo1_vrf, align json support on 'show isis topology' command
Add the json support from ISIS vty command.
> show isis vrf vrf1 topology json

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-21 15:40:23 +02:00
Philippe Guibert
cd68ea3447 topotests: isis_topo1, use 'show isis topology json' command
Add the json support from ISIS vty command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-21 15:40:23 +02:00
Philippe Guibert
3a2554e4a2 isisd: add json support to display spf paths in 'show isis route'
The 'show isis route json' command never displays the list of
paths. Add the json support for this sub-part.

> # show isis route json
> [..]
> "ipv6-paths":[
>  {
>   "Vertex":"rt1",
>   "Type":"",
>   "Metric":0,
>   "Next-Hop":"",
>   "Interface":"",
>   "Parent":""
>  },
>  {
>    "Vertex":"2001:db8:1000::1\/128",
>    "Type":"IP6 internal",
>    "Metric":0,
>    "Next-Hop":"",
>    "Interface":"",
>    "Parent":"rt1(4)"
>  },

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-21 15:40:23 +02:00
Philippe Guibert
df723ccfb7 isisd: show isis route uses ttable for paths
This is a preliminary commit, so that route paths are visible from json.

Before:
> IS-IS paths to level-1 routers that speak IPv6
> Vertex               Type         Metric Next-Hop             Interface Parent
> rt1
> 2001:db8:1000::1/128 IP6 internal 0                                     rt1(4)
> rt2                  TE-IS        10     rt2                  eth-rt2   rt1(4)
> rt3                  TE-IS        10     rt3                  eth-rt3   rt1(4)
> 2001:db8:1000::2/128 IP6 internal 20     rt2                  eth-rt2   rt2(4)
> 2001:db8:1000::3/128 IP6 internal 20     rt3                  eth-rt3   rt3(4)

After:
> Vertex                Type          Metric  Next-Hop  Interface  Parent
>  -------------------------------------------------------------------------
>  rt1
>  2001:db8:1000::1/128  IP6 internal  0                            rt1(4)
>  rt2                   TE-IS         10      rt2       eth-rt2    rt1(4)
>  rt3                   TE-IS         10      rt3       eth-rt3    rt1(4)
>  2001:db8:1000::2/128  IP6 internal  20      rt2       eth-rt2    rt2(4)
>  2001:db8:1000::3/128  IP6 internal  20      rt3       eth-rt3    rt3(4)

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-06-21 15:40:23 +02:00
Acee Lindem
c494702929 ospfd: Improve OSPF neighbor retransmission list granularity and precision
The current OSPF neighbor retransmission operates on a single per-neighbor
periodic timer that sends all LSAs on the list when it expires.
Additionally, since it skips the first retransmission of received LSAs so
that at least the retransmission interval (resulting in a delay of between
the retransmission interval and twice the interval. In environments where
the links are lossy on P2MP networks with "delay-reflood" configured (which
relies on neighbor retransmission in partial meshs), the implementation
is sub-optimal (to say the least).

This commit reimplements OSPF neighbor retransmission as follows:

   1. A new data structure making use the application managed
      typesafe.h doubly linked list implements an OSPF LSA
      list where each node includes a timestamp.
   2. The existing neighbor LS retransmission LSDB data structure
      is augmented with a pointer to the list node on the LSA
      list to faciliate O(1) removal when the LSA is acknowledged.
   3. The neighbor LS retransmission timer is set to the expiration
      timer of the LSA at the top of the list.
   4. When the timer expires, LSAs are retransmitted that within
      the window of the current time and a small delta (50 milli-secs
      default). The LSAs that are retransmited are given an updated
      retransmission time and moved to the end of the LSA list.
   5. Configuration is added to set the "retransmission-window" to a
      value other than 50 milliseconds.
   6. Neighbor and interface LSA retransmission counters are added
      to provide insight into the lossiness of the links. However,
      these will increment quickly on non-fully meshed P2MP networks
      with "delay-reflood" configured.
   7. Added a topotest to exercise the implementation on a non-fully
      meshed P2MP network with "delay-reflood" configured. The
      alternative was to use existing mechanisms to instroduce loss
      but these seem less determistic in a topotest.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-06-20 15:31:07 +00:00
David Lamparter
e14c94f2b7 tests: fix TSAN warnings in atomlist test
The atomlist test consists of a sequence of (MT) sub-tests, from which
counters are collected and verified.  TSAN doesn't know that these
counters are synchronized by way of the sub-test starting and finishing,
so it complains.  Just use atomics to get rid of the warning.

(This is solely an issue with the test, not the atomlist code.  There
are no warnings from that.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 15:44:46 +02:00
David Lamparter
4836ac0714 tests: silence TSAN warning on test_seqlock exit
TSAN warns about leaving the second thread dangling.  Doesn't really
matter, but just add a pthread_join to get rid of the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:16:10 +02:00
David Lamparter
8aeac1f005 tests/lib: fix seqlock test
seqlock_bump() used to return the value before bumping, but that's
unhelpful if you were to actually need it.  I had changed it to return
the value after, but the update to the test got lost at some point.

The return value is not in fact used anywhere in FRR, so while it is
a bug, it has zero impact.

NB: yes, test_seqlock is not run, which sounds wrong.  The problem here
is that (a) the test itself uses sleeps and is timing sensitive, which
would raise false positives.  And (b), the test is meaningless if
executed once.  It needs to be run millions of times under various
conditions (e.g. load) to catch rare races, and it needs to be run on
machines with "odd" memory models (in this case I used BE ppc32 and
ppc64 systems as test platforms.)

Fixes: 6046b690b5 ("lib/seqlock: avoid syscalls in no-waiter cases")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-06-20 11:02:19 +02:00
zhou-run
0db469958c isisd: Even after configuring "no hostname dynamic", the topology still displays the hostname.
The command "show isis topology" calls print_sys_hostname() to display the system ID or hostname, but it does not check the area->dynhostname flag.

Signed-off-by: zhou-run <zhou.run@h3c.com>
2024-06-19 15:44:51 +08:00
Donald Sharp
a1b21f526a
Merge pull request #16227 from y-bharath14/srib-topotest-e
tests: Avoid importing unused modules
2024-06-18 15:52:38 -04:00
Carmine Scarpitta
9e1803a772 tests: Update IS-IS SRv6 topotests
The locator is no longer split in multiple chunks.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-06-18 18:33:29 +02:00
Russ White
ae4e030813
Merge pull request #16236 from opensourcerouting/fix/recursive_weighted_ecmp
zebra: Set the weight for non-recursive next-hop
2024-06-18 11:14:00 -04:00
Russ White
627a8ac091
Merge pull request #16153 from pguibert6WIND/bgp_recursive_duplicate
bgpd: fix do not skip paths with same nexthop
2024-06-18 11:00:41 -04:00
Russ White
66ad4aaf3d
Merge pull request #16172 from LabNConsulting/dleroy/nhrpd-auth-support
nhrpd: add cisco-authentication password support
2024-06-18 10:04:24 -04:00
Russ White
e9e8a4baa4
Merge pull request #16194 from opensourcerouting/fix/bfd_profile_shutdown
bgpd: Do not start BGP session if BFD profile is in shutdown state
2024-06-18 09:57:00 -04:00
Russ White
b94fc2d2d6
Merge pull request #16195 from opensourcerouting/fix/drop_recent_confdate
ospfd: Drop `interfaceIp` from `show ip ospf neigh json`
2024-06-18 09:56:19 -04:00
Donatas Abraitis
6d5d4f7000 tests: Check if recursive weighted ECMP works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-18 12:16:54 +03: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
Donatas Abraitis
e8ce036a7b
Merge pull request #16202 from y-bharath14/srib-topotest-d
tests: suppress unused variables at topotests
2024-06-14 10:25:25 +03:00
Jafar Al-Gharaibeh
2e02bd2366
Merge pull request #16184 from LabNConsulting/chopps/fe-notify-select
mgmtd: add notification selection to front-end API
2024-06-13 00:20:09 -05:00
Y Bharath
a63bfb7566 tests: supress unused variables at topotests
For code maintainability, suppressed unused variables with "_"

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-06-12 13:56:34 +05:30
Christian Hopps
27e369487e tests: add native session-req/reply support to fe_client.py
Use this to test new native message format for creating sessions.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-11 10:37:31 -04:00
Donatas Abraitis
59f5dd686a tests: Check if BFD notification is sent and session remains in down state
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-11 15:51:21 +03:00
Donatas Abraitis
3cc01bb00b tests: Drop interfaceIp from OSPF tests
Deprecated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-06-11 15:48:23 +03:00
Philippe Guibert
d0bac2796b topotests: add bgp duplicate nexthop test
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>
2024-06-11 10:01:56 +02:00
Philippe Guibert
a6b1d38d7f topotests: add API to detect if iproute2 is json capable
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>
2024-06-11 10:01:56 +02:00
Dave LeRoy
b5540d326b nhrpd: add cisco-authentication password support
Taking over this development from https://github.com/FRRouting/frr/pull/14788

This commit addresses 4 issues found in the previous PR

1) FRR would accept messages from a spoke without authentication when FRR NHRP had auth configured.
2) The error indication was not being sent in network byte order
3) The debug print in nhrp_connection_authorized was not correctly printing the received password
4) The addresses portion of the mandatory part of the error indication was invalid on the wire (confirmed in wireshark)

Signed-off-by: Dave LeRoy <dleroy@labn.net>
Co-authored-by: Volodymyr Huti <volodymyr.huti@gmail.com>
2024-06-10 16:39:21 -07:00
Volodymyr Huti
51f0700286 nhrp: add cisco-authentication password support
Implemented:
- handling 8 char long password, aka Cisco style.
- minimal error inidication routine
- test case, password change affects conection

Signed-off-by: Volodymyr Huti <v.huti@vyos.io>
2024-06-10 16:39:21 -07:00
Renato Westphal
dc354cbfef tests: introduce method to update reference data in isis_tilfa_topo1
The isis_tilfa_topo1 topotest is comprehensive and contains a large
amount of reference data. One problem is that, when changes occur,
updating this reference data can be difficult.

To address this problem, this commit introduces a method to
automatically regenerate the reference data by setting the `REGEN_DATA`
environment variable.

Usage:
$ REGEN_DATA=true python3 ./test_isis_tilfa_topo1.py

When `REGEN_DATA` is set, the topotest regenerates reference data
from the current run instead of comparing against existing reference
data. Note that regenerated data must be manually verified for
correctness.

This commit also simplifies the reference data by replacing all diff
files with complete JSON snapshots.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2024-06-10 12:28:01 -03:00
Renato Westphal
04655c5f74 tests: rework isis_tilfa_topo1 to fix timing issues
In this topotest, steps 10-15 were added to test the IS-IS switchover
functionality. In short, two cases were tested: switchover after a
link down event and switchover after a BFD down event. Both cases
were tested in sequence on the same router, rt6. This involved the
following steps:
- Setting the SPF delay timer to 15 seconds
- Shutting down the eth-rt5 interface from the switch side
- Testing the post-switchover RIB and LIB (triggered by the link down
  event)
- Testing the post-SPF RIB and LIB
- Bringing the eth-rt5 interface back up
- Configuring a BFD session between rt6 and rt5
- Shutting down the eth-rt5 interface from the switch side once again
- Testing the post-switchover RIB and LIB (triggered by the BFD down
  event)
- Testing the post-SPF RIB and LIB

Since the time window to test the post-switchover RIB and LIB was too
narrow (10 seconds), these tests were having sporadic failures.

To resolve this problem, we can simplify the switchover test as follows:
- Setting the SPF delay timer to 60 seconds (not 15)
- Disabling "link-detect" on rt6's eth-rt5 interface
- Shutting down the eth-rt5 interface from the switch side
- On rt6, testing the post-switchover RIB and LIB (triggered by the
  BFD down event)
- On rt5, testing the post-switchover RIB and LIB (triggered by the
  link down event)

Notice how we can test both post-link-down and post-BFD-down switchover
cases simultaneously by having different "link-detect" configurations
on rt5 and rt6. Additionally, by using a larger SPF delay timer, the
time window to test the post-switchover RIB and LIB is much larger
and less prone to sporadic failures.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2024-06-10 12:28:01 -03:00
Donatas Abraitis
19c3e0eca6
Merge pull request #16093 from louis-6wind/fix-show-route-memory
zebra: fix Out Of Memory issue when displaying large route tables in JSON
2024-06-10 11:26:23 +03:00
Donald Sharp
2a00a648f1
Merge pull request #15900 from mikemallin/v6-vtep-lib-upstream
lib, bgpd, tests, zebra: prefix_sg changes for V6 VTEP
2024-06-07 14:34:11 -04:00
Dmytro Shytyi
83294afedf topotests: add bgp labeled unicast fec nexthop resolution tests
There are 3 tests with OSPF, IS-IS, BGP and MPLS configured:
1. Check the status of BGP session
between North and South == Established
2. Check the connectivity with "ping South -I North"
3. Check the label on the West.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2024-06-07 12:33:48 +02:00
Louis Scalbert
2d6dcc0c57 tests: check show route vrf all json output
Check that "show ip route vrf XXX json" and the JSON at key "XXX" of
"show ip route vrf all json" gives the same output.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07 10:13:32 +02:00
Christian Hopps
56ce19891b tests: switch test to new fe_client notify selector syntax
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:39:53 -04:00
Christian Hopps
8772e444a7 tests: add notify select support in fe client test utility
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:39:53 -04:00
Christian Hopps
e14781eb1d lib: darr: add free with element cleanup functions
- `darr_free_free` to `darr_free` each element prior to `darr_free`
  the array.
- `darr_free_func` to call `func` on each element prior to `darr_free`
  the array.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 22:38:48 -04:00
Russ White
64f447fb10
Merge pull request #11906 from louis-6wind/show_isis_db_json
isisd: fix show isis database [detail] json
2024-06-06 16:27:57 -04:00
Russ White
84af49b0ae
Merge pull request #15434 from louis-6wind/labels-hash
bgpd: move labels from extra to extra->labels and add them to adj-rib-in and adj-rib-out
2024-06-06 16:27:38 -04:00
Christian Hopps
a465000035 tests: munet: update to version 0.14.9
Topotest relevant changes:

    - add support for `timeout` arg to `cmd_*()`
    - handle invalid regexp in CLI commands
    - fix long interface name support

Full munet changelog:

    munet: 0.14.9: add support for `timeout` arg to `cmd_*()`
    munet: 0.14.8: cleanup the cleanup (kill) on launch options
    munet: 0.14.7: allow multiple extra commands for shell console init
    munet: 0.14.6:
      - qemu: gather gcda files where munet can find them
      - handle invalid regexp in CLI commands
    munet: 0.14.5:
      - (podman) pull missing images for containers
      - fix long interface name support
      - add another router example
    munet: 0.14.4: mutest: add color to PASS/FAIL indicators on tty consoles
    munet: 0.14.3: Add hostnet node that runs it's commands in the host network namespace.
    munet: 0.14.2:
      - always fail mutest tests on bad json inputs
      - improve ssh-remote for common use-case of connecting to host connected devices
      - fix ready-cmd for python v3.11+
    munet: 0.14.1: Improved host interface support.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06 08:50:05 +00:00
Louis Scalbert
3c86f776f0 bgpd: add bgp_labels hash
Add bgp_labels type and hash list.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-05 13:11:29 +02:00
Philippe Guibert
40706d5c42 topotests: add bgp test to check the ADJ-RIB-IN label value
The test is done on r2. A BGP update is received on r2, and is
filtered on r2. The RIB of r2 does not have the BGP update stored,
but the ADJ-RIB-IN is yet present. To demonstrate this, if the
inbound route-map is removed, then the BGP update should be copied
from the the ADJ-RIB-IN and added to the RIB with the label
value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-05 13:11:29 +02:00
Philippe Guibert
415befc30a topotests: add bgp test to check the ADJ-RIB-OUT label value
This test ensures that when r1 changes the label value, then
the new value is automatically propagated to remote peer.
This demonstrates that the ADJ-RIB-OUT to r2 has been correctly
updated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-05 13:11:29 +02:00
Louis Scalbert
191675451e topotests: clarify bgp_vpnv4_ebgp
Clarify bgp_vpnv4_ebgp

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-05 13:11:29 +02:00
Acee Lindem
3f359d732c ospf6d: OSPFv3 manual key authentication neglects checking the SA ID.
Also, add topotest variation to verify checking.

    This corrects https://github.com/FRRouting/frr/issues/16100.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-06-04 21:24:46 +00:00
Donatas Abraitis
07573cf98b Revert "isisd: When the metric-type is configured as "wide", the IS-IS generates incorrect metric values for IPv4 directly connected routes."
This broke these topotests:

test_isis_lsp_bits_topo1
test_isis_sr_topo1
test_isis_srv6_topo1
test_isis_tilfa_topo1
test_isis_topo1
test_isis_topo1_vrf
test_ldp_snmp_topo1
test_ldp_sync_isis_topo1

This reverts commit 39e27b840e.
2024-06-04 17:31:40 +03:00
Russ White
fb4e4b5fb2
Merge pull request #16056 from zhou-run/202405211622
isisd: When the metric-type is configured as "wide", the IS-IS generates incorrect metric values for IPv4 directly connected routes.
2024-06-04 07:53:30 -04:00
Donald Sharp
9069c93e75
Merge pull request #16124 from LabNConsulting/chopps/test-cleanup
Fix grpc-client parallel run and other small test fixes
2024-05-31 10:47:52 -04:00