Commit Graph

3558 Commits

Author SHA1 Message Date
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
Christian Hopps
30d3b4d47e tests: use raw string for doc to avoid deprecated python warning
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps
e855436cc6 tests: all errors go to log (and thus stderr)
Only output requested information to stdout so it can be
filtered and captured in shell variables etc...

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps
5032be4f1c tests: fix pim test to wait for actual OSPF route convergence
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
Christian Hopps
cd5791c12e tests: fix multiple grpc-client.py running in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-31 05:16:22 -04:00
dleroy
a7037ab234 tests: add a topotest to verify nhrp shortcuts in a redundant nhs topology
Contains 2 testcases. The first does a basic configuration/connectivity.
The second testcase initiates a shortcut through the primary NHS,
verifies shortcut routes are installed. Primary NHS interface brought
down and verify that the shortcut is not impacted. Finally verify that
after the shortcut expires, it is able to be re-established via a backup
NHS.

Signed-off-by: dleroy <dleroy@labn.net>
2024-05-30 12:25:07 -07:00
Donald Sharp
f766686bce tests: Fix zebra_seg6_route
Locally this test would occassionally fail for me
because the connected route the sharp route being
installed has not fully come up yet due to heavy
load and start up slowness.  Add a bit of code
to look for the problem and make sure it doesn't
happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-29 14:52:44 -04:00
Igor Ryzhov
f8abf96440
Merge pull request #15082 from louis-6wind/fix-iff-lower-up
lib: take into account the Linux IFF_LOWER_UP flag
2024-05-29 00:01:20 +03:00
Russ White
ffaddf36a6
Merge pull request #16023 from opensourcerouting/fix/rpki_show_stuff
bgpd: Split `rpki cache` command into separate per SSH/TCP
2024-05-28 10:23:10 -04:00
Donald Sharp
c2b44a8bbe
Merge pull request #16091 from y-bharath14/srib-topotests-commits
tests: Organizing variables using format method
2024-05-28 10:07:12 -04:00
Y Bharath
95426606b1 tests: Organizing variables using format method
Using format method to look code more presentable and readable

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2024-05-27 13:12:30 +05:30
Donatas Abraitis
c362af18e9
Merge pull request #16044 from louis-6wind/fix-loopback-leak
bgpd: fix route leaking from the default l3vrf
2024-05-24 10:13:01 +03:00
Donatas Abraitis
043cff5286 bgpd: Split rpki cache command into separate per SSH/TCP
Current command (bundled two into one) is absolutely wrong.

When you configure TCP session with the source, the command thinks, that
it's a SSH session with a username.

It's much better to split this into two separate commands where it's much
easier to do the changes in the future (if more options comes in).

Yes, this is a breaking change, but there is no other proper way to overcome
this.

Bonus note how it looks, which also can lead to crashes (due to port 0x0):

```
(gdb) p *cache->tr_config.ssh_config
$11 = {host = 0x5555562f9cd0 "1.1.1.1", port = 0, bindaddr = 0x0,
  username = 0x55555629ad00 "",
  server_hostkey_path = 0x7ffff53667a0 <rpki_create_socket> "Uf\017\357\300H\211\345AWAVAUATSH\201", <incomplete sequence \354\230>, client_privkey_path = 0x0,
  data = 0x0, new_socket = 0x51, connect_timeout = 4143762592,
  password = 0x7ffff6fccca0 <main_arena+96> "\300\"0VUU"}
(gdb) p *cache->tr_config.tcp_config
$12 = {host = 0x5555562f9cd0 "1.1.1.1", port = 0x0, bindaddr = 0x0,
  data = 0x55555629ad00, new_socket = 0x7ffff53667a0 <rpki_create_socket>,
  connect_timeout = 0}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-21 14:23:15 +03:00
Louis Scalbert
31fc89b230 bgpd, tests: fix route leaking from the default l3vrf
Leaked route from the l3VRF are installed with the loopback as the
nexthop interface instead of the real interface.

> B>* 10.0.0.0/30 [20/0] is directly connected, lo (vrf default), weight 1, 00:21:01

Routing of packet from a L3VRF to the default L3VRF destined to a leak
prefix fails because of the default routing rules on Linux.

> 0:      from all lookup local
> 1000:   from all lookup [l3mdev-table]
> 32766:  from all lookup main
> 32767:  from all lookup default

When the packet is received in the loopback interface, the local rules
are checked without match, then the l3mdev-table says to route to the
loopback. A routing loop occurs (TTL is decreasing).

> 12:26:27.928748 ens37 In  IP (tos 0x0, ttl 64, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64
> 12:26:27.928784 red   Out IP (tos 0x0, ttl 63, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64
> 12:26:27.928797 ens38 Out IP (tos 0x0, ttl 63, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64

Do not set the lo interface as a nexthop interface. Keep the real
interface where possible.

Fixes: db7cf73a33 ("bgpd: fix interface on leaks from redistribute connected")
Fixes: 067fbab4e4 ("bgpd: fix interface on leaks from network statement")
Fixes: 8a02d9fe1e ("bgpd: Set nh ifindex to VRF's interface, not the real")
Fixes: https://github.com/FRRouting/frr/issues/15909
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-05-20 14:12:28 +02:00
Donald Sharp
e41b4a755e
Merge pull request #16012 from LabNConsulting/chopps/improve-grpc-test
tests: improve the grpc query client and topotest
2024-05-17 11:48:27 -04:00
Christian Hopps
07a084f921 tests: embed YANG in mgmtd unit-test bin
`make check` should run w/o installing FRR first. Thus we need to embed
the yang modules otherwise mgmtd unit-test fails.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-17 00:54:20 -04:00
Christian Hopps
9dc02dd338 tests: improve the grpc query client and topotest
- Add separate get, get-config, get-state operations to query command, as
well as switching default output to JSON.
- Add an `--xml` to change the output format.
- move printss to logging.debug so output is a machine parseable result.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-15 00:16:33 -04:00
Piotr Suchy
70e5005cba lib, vtysh, topotests: fix 'show ip[v6] access-list ... json' formatting
Similarly to recently fixed 'show ip[v6] prefix-list ...' - PR#15750,
json output is not valid for 'show ip[v6] access-list ... json' commands,
as it goes through all the running daemons and for each one it calls
'filter_show' creating a new json object. To aggreagate the output
and create a valid json that can later be parsed, the commands were
moved to vtysh and formatted accordingly

Signed-off-by: Piotr Suchy <piotrsuchy@proton.me>
2024-05-14 13:22:20 +02:00
Russ White
2e0208602b
Merge pull request #15911 from opensourcerouting/feature/bgpd_dampening_per_neighbor
bgpd: per-neighbor dampening support
2024-05-13 13:55:24 -04:00
Donald Sharp
b6f1b32c8a
Merge pull request #15961 from opensourcerouting/fix/allow_using_match_tag_0
lib: Allow doing match/set tag untagged
2024-05-13 09:59:36 -04:00
Donatas Abraitis
b3600d82dc
Merge pull request #15614 from louis-6wind/fix-6pe-address
bgpd: fix ipv4-mapped ipv6 on non 6pe
2024-05-10 22:55:12 +03:00
Donatas Abraitis
adce8e066c tests: Check if set/match tag untagged works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-10 10:25:26 +03:00
Christian Hopps
0939f77b39 tests: fix mis-spelled cryptographic-algorithm keyword in test
Also update to use a newer hashing function while we are here.

fixes #15923

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-09 04:34:32 -04:00
Russ White
ae01d44596
Merge pull request #15899 from gromit1811/ospf6_ecmp_inter_area_bugfix_15777_pr
ospf6d: Fix nexthop computation for inter-area multi-ABR ECMP
2024-05-07 10:48:32 -04:00
Russ White
ee853851bd
Merge pull request #15895 from opensourcerouting/fix/ignore_attributes_if_discard_is_configured
bgpd: Ignore validating the attribute flags if path-attribute is configured
2024-05-07 10:44:38 -04:00
Christian Hopps
c54bc7a8dd
Merge pull request #15594 from idryzhov/mgmt-rpc
mgmtd: implement YANG RPC/action support
2024-05-06 16:05:50 -04:00
Martin Buck
217e505a67 tests: Modify inter-area ECMP topotest to also test redundant ABRs
So far, this test only convered redundant paths to one ABR, now it checks
redundant paths to redundant ABRs, covering both cases. Useful as a
regression test for #15777.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2024-05-03 09:49:24 +02:00
Donatas Abraitis
709bdcbb23 tests: Check if dampening per-peer works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Christian Hopps
727633a046 tests: remove reliance on time.sleep
Use proper retry loop to wait for state to converge, not some arbitrary delay.

fixes #15878

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-02 06:10:48 -04:00
Donatas Abraitis
f58227c91e tests: Check if iBGP session can drop invalid AIGP attribute
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-01 16:33:52 +03:00
Donald Sharp
edac3efdc5
Merge pull request #15864 from opensourcerouting/fix/graceful_restart_per_neighbor
tests: Check if Graceful Restart per-neighbor works as expected
2024-04-29 09:16:36 -04:00
Donatas Abraitis
422e0dd256 tests: Apply black formatting from what frrbot suggested to be happy
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-28 12:51:22 +03:00
Donatas Abraitis
2ea6d2cca0 tests: Add missing check_router_status for bgp_tcp_mss test
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-28 12:51:22 +03:00
Donatas Abraitis
1a1c2a9f84 tests: Apply black formatting for all tests/topotests
It's just annoying when the linter tells to apply the formatting for the code
you didn't touch.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:19:32 +03:00
Donatas Abraitis
086df4bfaa tests: Drop duplicate pytestmark per file
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:18:15 +03:00
Donatas Abraitis
ede5f5092a tests: Drop debug statements from bgp_gr_restart_retain_routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:09:40 +03:00
Donatas Abraitis
e41012bebe tests: Check if Graceful Restart per-neighbor works as expected
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:06:19 +03:00
Donatas Abraitis
1c1de46878 tests: Use a single frr.conf for bgp_gr_restart_retain_routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:00:36 +03:00
Russ White
f19817f71d
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
2024-04-26 14:41:05 -04:00
Louis Scalbert
efbf234510 topotests: add lower_up to expected interface flags
Add lower_up to expected interface flags.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-26 17:11:53 +02:00
Donald Sharp
f8e9f7fb0e
Merge pull request #15744 from pguibert6WIND/snmp_oid_line73_error
topotests: lib, fix filter out "At line 73 in /usr/share/snmp/mibs/ie…
2024-04-26 07:38:42 -04:00
Donatas Abraitis
0d0350aef0
Merge pull request #15783 from LabNConsulting/aceelindem/ospf-neighbor-filter
ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interface
2024-04-24 22:30:11 +03:00
Donald Sharp
99ae329047
Merge pull request #15801 from LabNConsulting/chopps/new-munet
Improve coverage functionality
2024-04-23 12:58:48 -04:00
Philippe Guibert
5e7bb79f11 topotests: lib, fix filter out "At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU" message
When testing SNMP service on FRR, the following error message may
appear on some distros.

> # snmpwalk -v2c -c public .1.3.6 1.1.1.1 <OID>
> Bad operator (INTEGER): At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU
> [..then result ..]
>

The error message is due to the /etc/snmp/snmp.conf file. By default, this
file is used by both snmp server and client side. The net-snmp MIB parsing
routing loads MIBS, to bind oids with the naming scheme used by the MIBS.

> # cat /etc/frr/snmp.conf
> [snmp]
> mibs +ALL
>

A potential fix would consist in modifying the SNMPv2-PDU.mib file: the
problem is known on ubuntu distros, as the snmp-mibs-downloader package
has not updated the SNMPv2-PDU.mib file.

The choice is done to not modify the original distro where the test is run
on. Fix the topotests by ignoring the 'SNMPv2-PDU line 73" error message, and
keep the other error messages that may happen, for instance, when an
unknown oid name value is requested.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-23 14:24:51 +02:00
Louis Scalbert
f1b8364ab3 topotests: update bgp_vrf_leaking_5549_routes
Before the patch-set, ce1 was sending an IPv6 Link-local as global and
link-local nexthop to pe1.

Set bgp_vrf_leaking_5549_routes in accordance with the previous fixes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
04c220bedb tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6
Test ipv6 global removal in bgp_nexthop_mp_ipv4_6

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Louis Scalbert
62913cb15d topotests: add bgp_nexthop_mp_ipv4_6 test
Add bgp_nexthop_mp_ipv4_6 topotest to test to nexhop value with
MP-BGP IPv4 and IPv6 on IPv4 peering. The test has route-reflector,
route-server, iBGP and eBGP peers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-23 11:28:36 +02:00
Donatas Abraitis
593a806510 tests: Check if extended link bandwidth can be more than 25gbps
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Donatas Abraitis
055cc0488b tests: Check if extended link bandwidth is considered into also
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-22 17:50:08 +03:00
Igor Ryzhov
3c8336c845 tests: add topotest for mgmtd rpc processing
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22 16:36:23 +03:00