Commit Graph

3495 Commits

Author SHA1 Message Date
Donald Sharp
afe11d5edf tests: snmp tests sometimes fail with Unable to bind
the snmp tests are using zebra.conf to setup the
address that they are binding to and immediately
after that they are starting snmpd.  If snmpd
starts up *before* zebra has installed the address
the bind on the address will fail.  Causing the entire
test to fail.  Modify the snmpd.conf for all our
snmp tests to bind to all addresses.  Things still
work and we no longer have an issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-12 13:05:05 -04:00
Louis Scalbert
7acdaff7e2 topotests: check route import in bgp_vpnv4_noretain
Check route import in bgp_vpnv4_noretain

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-09-12 15:18:02 +02:00
Louis Scalbert
142c029725 topotest: fix bgp_vpnv4_noretain test descriptions
Fix bgp_vpnv4_noretain test descriptions

Fixes: 22dfa04b78 ("topotests: more tests in bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-09-12 15:18:02 +02:00
Russ White
7b8f81bcb6
Merge pull request #14379 from donaldsharp/peer_connection_part_two
Peer connection part two
2023-09-12 08:51:50 -04:00
Russ White
48d6039e14
Merge pull request #13724 from cscarpitta/feature/isisd-srv6-support
isisd: Add support for SRv6 uSID (RFC 9352)
2023-09-12 08:33:42 -04:00
Carmine Scarpitta
6d22a6e5db tests: Add isis_srv6_topo1 test for IS-IS SRv6
Add a new topotest `isis_srv6_topo1` for verifying SRv6 functionalities
in IS-IS (RFC 9352).

This topotest consists of nine tests:

* Network convergence after applying SRv6 configuration
* Disable SRv6 Locator on zebra on r1
* Enable SRv6 Locator on zebra on r1
* Disable SRv6 Locator on ISIS on r1
* Enable SRv6 Locator on ISIS on r1
* Disable SRv6 on ISIS on r1
* Enable SRv6 on ISIS on r1
* Disable SRv6 on zebra on r1
* Enable SRv6 on zebra on r1

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:58 +02:00
Carmine Scarpitta
0078f6f53a tests: Update fuzz test to match expected output
Update IS-IS fuzz test to match corrected output after the introduction
of SRv6-related TLVs.

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-09-11 22:11:52 +02:00
Donald Sharp
7094cc7f42 bgpd: bgp_packet pass connection around
Modify all the receive functions to pass around the actual
connection being acted upon.  Modify the collision detection
function to look at the possible two connections.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-10 08:31:25 -04:00
Donald Sharp
4eef430b03
Merge pull request #14225 from opensourcerouting/bug/topostest_grpc
topotest: Command using wrong python version
2023-09-06 09:00:25 -04:00
Donald Sharp
58201b3d63
Merge pull request #14344 from opensourcerouting/freebsd-printf-sync-20230903
lib/printf: sync with FreeBSD for ISO C23 enhancements
2023-09-06 07:59:15 -04:00
Russ White
92515dce64
Merge pull request #14285 from opensourcerouting/feature/graceful_restart_dynamic_capability
bgpd: Handle Graceful Restart capability using dynamic capabilities
2023-09-05 09:37:49 -04:00
Russ White
0d378c66af
Merge pull request #14234 from Pdoijode/pdoijode/frr-bgp-nexthop-find-fix-1
bgpd: set ifindex only for v6 nexthops and nexthops that match peer's LL
2023-09-05 08:23:49 -04:00
David Lamparter
48eee77b51 tests: exercise %b printfrr format specifier
Added by ISO C23 / N2630, implementation imported from FreeBSD.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-09-03 23:34:03 +02:00
Donatas Abraitis
e89fd723ee
Merge pull request #14118 from GaladrielZhao/master
bgpd: Convert from struct bgp_node to struct bgp_dest
2023-08-30 17:43:29 +03:00
Donatas Abraitis
23fa9b4107 tests: Check if GR settings can be changed via BGP dynamic capabilities
restart-time and/or notification support.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-30 17:18:53 +03:00
Rodrigo Nardi
bf5a32589c topotest: Command using wrong python version
Changing command from python to python3.

Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
2023-08-30 10:59:33 -03:00
Russ White
fa0dd3d6d0
Merge pull request #14252 from LabNConsulting/ziemba-pbr-bugfix-match-dscp-numeric
pbrd: fix dscp field value computation
2023-08-29 08:05:17 -04:00
Naveen Guggarigoud
bff44a8f77 tests: Adding a bgp router id chaos test case.
This is test when ospf and bgp router ids are same.

Signed-off-by: Naveen Guggarigoud <nguggarigoud@vmware.com>
2023-08-29 06:57:07 +00:00
Yuqing Zhao
6e7f305e54 bgpd: Convert from struct bgp_node to struct bgp_dest
This is based on @donaldsharp's work

The current code base is the struct bgp_node data structure.
The problem with this is that it creates a bunch of
extra data per route_node.
The table structure generates ‘holder’ nodes
that are never going to receive bgp routes,
and now the memory of those nodes is allocated
as if they are a full bgp_node.

After splitting up the bgp_node into bgp_dest and route_node,
the memory of ‘holder’ node which does not have any bgp data
will be allocated as the route_node, not the bgp_node,
and the memory usage is reduced.
The memory usage of BGP node will be reduced from 200B to 96B.
The total memory usage optimization of this part is ~16.00%.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Yuqing Zhao <xiaopanghu99@163.com>
2023-08-22 09:35:46 +08:00
Pooja Jagadeesh Doijode
4777c8376a bgpd: set ifindex only v6 nexthops and nexthops that match peer's LL
For v4 nexthops, ifindex was being set. Modified the check to set
ifindex only for v6 nexthops. Also modified the check to set ifindex
only if the v6 nexthop matches peer's LL address.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-08-21 16:45:09 -07:00
G. Paul Ziemba
1efae6b537 pbrd: fix dscp field value computation
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-08-21 13:27:50 -07:00
Donatas Abraitis
451fb24b17
Merge pull request #8790 from donaldsharp/peer_connection
Peer connection
2023-08-21 20:22:53 +03:00
Donald Sharp
9f4c654c59 tests: static_simple gives up after 3 seconds
Under heavy system load we can see that the static_simple
test is giving up too early in this micronet run:

8-17 15:00:27,105 DEBUG: topo: Waiting for [0.1]s as initial delay
2023-08-17 15:00:27,206 DEBUG: r1: cmd_status("/bin/bash -c 'ip -4 route show'")
2023-08-17 15:00:28,209 DEBUG: r1:
	stdout: 101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1
2023-08-17 15:00:28,209 DEBUG: topo: checking kernel routing table:
101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1

2023-08-17 15:00:28,210  INFO: topo: Function raised exception: Failed to find
  '10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20'
   in
  '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1
  '
assert None
 +  where None = <function search at 0x7f405b7bb0a0>('10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20', '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1 \n')
 +    where <function search at 0x7f405b7bb0a0> = re.search
2023-08-17 15:00:28,210 DEBUG: topo: Sleeping 2s until next retry with 3.0 retry time left
2023-08-17 15:00:30,211 DEBUG: r1: cmd_status("/bin/bash -c 'ip -4 route show'")
2023-08-17 15:00:31,703 DEBUG: r1:
	stdout: 101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1
2023-08-17 15:00:31,703 DEBUG: topo: checking kernel routing table:
101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1

2023-08-17 15:00:31,704  INFO: topo: Function raised exception: Failed to find
  '10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20'
   in
  '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1
  '
assert None
 +  where None = <function search at 0x7f405b7bb0a0>('10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20', '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1 \n')
 +    where <function search at 0x7f405b7bb0a0> = re.search
2023-08-17 15:00:31,704  INFO: topo: Retry timeout of 3s reached
2023-08-17 15:00:31,704  INFO: topo: Spawn collection of support bundle for r1
2023-08-17 15:00:31,704 DEBUG: r1: cmd_status("/bin/bash -c 'mkdir -p /tmp/topotests/static_simple.test_static_simple/r1/support_bundles/test_static_cli'")
2023-08-17 15:00:31,710 DEBUG: r1: popen("/usr/lib/frr/generate_support_bundle.py --log-dir=/tmp/topotests/static_simple.test_static_simple/r1/support_bundles/test_static_cli")
2023-08-17 15:00:31,711 DEBUG: topo: Waiting on support bundle for r1
2023-08-17 15:00:31,751 DEBUG: topo: RETRY DIAG: [failure] Sleeping 2s until next retry with 2.2 retry time left - too see if timeout was too short
2023-08-17 15:00:33,751 DEBUG: r1: cmd_status("/bin/bash -c 'ip -4 route show'")
2023-08-17 15:00:35,137 DEBUG: r1:
	stdout: 10.0.0.0/8 nhid 12 via 101.0.0.2 dev r1-eth0 proto 196 metric 20...
2023-08-17 15:00:35,137 DEBUG: topo: checking kernel routing table:
10.0.0.0/8 nhid 12 via 101.0.0.2 dev r1-eth0 proto 196 metric 20
101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1

2023-08-17 15:00:35,137 DEBUG: topo: Function returned None
2023-08-17 15:00:35,138  WARN: topo: RETRY DIAGNOSTIC: SUCCEED after FAILED with requested timeout of 3.0s; however, succeeded in 8.0s, investigate timeout timing
2023-08-17 15:00:35,138  INFO: topo: Function raised exception: Failed to find
  '10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20'
   in
  '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1
  '
assert None
 +  where None = <function search at 0x7f405b7bb0a0>('10.0.0.0/8(?: nhid [0-9]+)? via 101.0.0.2 dev r1-eth0 proto (static|196) metric 20', '101.0.0.0/24 dev r1-eth0 proto kernel scope link src 101.0.0.1 \n')
 +    where <function search at 0x7f405b7bb0a0> = re.search
2023-08-17 15:00:35,138 DEBUG: topo: RETRY DIAG: [failure] Sleeping 2s until next retry with 0.2 retry time left - too see if timeout was too short
2023-08-17 15:00:37,139 DEBUG: r1: cmd_status("/bin/bash -c 'ip -4 route show'")
2023-08-17 15:00:37,247 DEBUG: r1:
	stdout: 10.0.0.0/8 nhid 12 via 101.0.0.2 dev r1-eth0 proto 196 metric 20...

Of course it works in the extra couple of times it tries but the test still fails.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-20 18:43:48 -04:00
Donald Sharp
3e5a31b24e bgpd: Convert struct peer_connection to dynamically allocated
As part of the conversion to a `struct peer_connection` it will
be desirable to have 2 pointers one for when we open a connection
and one for when we receive a connection.  Start this actual
conversion over to this in `struct peer`.  If this sounds confusing
take a look at the bgp state machine for connections and how
it resolves the processing of this router opening -vs- this
router receiving an open.  At some point in time the state
machine decides that we are keeping one of the two connections.

Future commits will allow us to untangle the peer/doppelganger
duality with this abstraction.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-18 09:29:04 -04:00
Donald Sharp
e20c23fa5b bgpd: Move status and ostatus to struct peer_connection
The status and ostatus are a function of the `struct peer_connection`
move it into that data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-18 09:29:04 -04:00
Donald Sharp
c528b3b153 bgpd: Move t_write and t_read into struct peer_connection
Move the peer->t_write and peer->t_read into `struct peer_connection`
as that these are properties of the connection.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
P# Please enter the commit message for your changes. Lines starting
2023-08-18 09:29:04 -04:00
Donald Sharp
1f32eb30d9 bgpd: Start abstraction of struct peer_connection
BGP tracks connections based upon the peer.  But the problem
with this is that the doppelganger structure for it is being
created.  This has introduced a bunch of fragileness in that
the peer exists independently of the connections to it.

The whole point of the doppelganger structure was to allow
BGP to both accept and initiate tcp connections and then
when we get one to a `good` state we collapse into the
appropriate one.  The problem with this is that having
2 peer structures for this creates a situation where
we have to make sure we are configing the `right` one
and also make sure that we collapse the two independent
peer structures into 1 acting peer.  This makes no sense
let's abstract out the peer into having 2 connection
one for incoming connections and one for outgoing connections
then we can easily collapse down without having to do crazy
stuff.  In addition people adding new features don't need
to have to go touch a million places in the code.

This is the start of this abstraction.  In this commit
we'll just pull out the fd and input/output buffers
into a connection data structure.  Future commits
will abstract further.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-18 09:29:04 -04:00
Donatas Abraitis
d02fae5836 zebra: Show NHT resolve via default status on/off
```
donatas-laptop# show ip nht
VRF default:
 Resolve via default: on
192.168.10.123
 resolved via connected
 is directly connected, wlp82s0 (vrf default)
 Client list: bgp(fd 21)
donatas-laptop# show ip nht json
{
  "default":{
    "ipv4":{
      "resolveViaDefault":true,
      "192.168.10.123":{
        "nhtConnected":false,
        "clientList":[
          {
            "protocol":"bgp",
            "socket":21,
            "protocolFiltered":"none"
          }
        ],
        "nexthops":[
          {
            "flags":3,
            "fib":true,
            "directlyConnected":true,
            "interfaceIndex":3,
            "interfaceName":"wlp82s0",
            "vrf":"default",
            "active":true
          }
        ],
        "resolvedProtocol":"connected"
      }
    }
  }
}
donatas-laptop# show ip nht vrf all

VRF default:
 Resolve via default: on
192.168.10.123
 resolved via connected
 is directly connected, wlp82s0 (vrf default)
 Client list: bgp(fd 21)
donatas-laptop# show ip nht vrf all json
{
  "default":{
    "ipv4":{
      "resolveViaDefault":true,
      "192.168.10.123":{
        "nhtConnected":false,
        "clientList":[
          {
            "protocol":"bgp",
            "socket":21,
            "protocolFiltered":"none"
          }
        ],
        "nexthops":[
          {
            "flags":3,
            "fib":true,
            "directlyConnected":true,
            "interfaceIndex":3,
            "interfaceName":"wlp82s0",
            "vrf":"default",
            "active":true
          }
        ],
        "resolvedProtocol":"connected"
      }
    }
  }
}
donatas-laptop#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-17 21:45:55 +03:00
Donald Sharp
bd6a00e8f7
Merge pull request #14181 from opensourcerouting/fix/bgpd_labeled_unicast_set_explicit_null
bgpd: Assign explicit-null for default-originate according to the AFI
2023-08-16 09:25:49 -04:00
mobash-rasool
2b4e038711
Merge pull request #14193 from donaldsharp/pim_vxlan_weirdness
Do not look into pim's eyes, pim gets mad
2023-08-15 22:26:21 +05:30
Donald Sharp
77014daf3a
Merge pull request #14016 from mjstapp/event_exec_ptr
* : include event ptr in event_execute api
2023-08-15 11:52:49 -04:00
Donatas Abraitis
0c7d6dfdf0
Merge pull request #14126 from LabNConsulting/ziemba-pbr-actions-mangling
pbrd: (3/3) add packet mangling actions (src/dst ip-addr/port, dscp, ecn)
2023-08-13 16:39:07 +03:00
Donald Sharp
9276533bbd tests: Make bgp_evpn_mh a 3 level clos
The tests were originally tor --- spine
lets add a tor -- leaf -- spine.  At this
point this change was to allow me to test
some funkiness I am seeing in pim vxlan setups
when the leaf is acting as the intermediate routers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-11 23:51:07 -04:00
Donatas Abraitis
e7dce035ab tests: Check if labeled IPv6 unicast default route works too
Also, check if remote label is explicit null according to the AFI.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-11 10:52:39 +03:00
Philippe Guibert
17c3f31642 topotests: add static mpls routing test
There is no test that checks for the mpls interface
configuration.
The new test checks that mpls configuration per
interface works when value is enabled or disabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-08-10 18:13:21 +02:00
Quentin Young
e0c1b43814 tests: amalgamate check_ping
✂️📋

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2023-08-09 15:46:29 -04:00
G. Paul Ziemba
ba240bcfa3 pbrd: add packet mangling actions (src/dst ip-addr/port, dscp, ecn)
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-08-09 12:11:43 -07:00
Donatas Abraitis
df04c23c8f
Merge pull request #14073 from fdumontet6WIND/as_path_replace_reg
bgpd: add set as-path replace acl-list command
2023-08-09 15:28:58 +03:00
Russ White
a84dee73d1
Merge pull request #14154 from opensourcerouting/feature/bgpd_handle_role_capability_using_dynamic_capability
bgpd: Handle role capability using dynamic capability
2023-08-08 10:47:04 -04:00
Francois Dumontet
459e1cd903 tests: add one test to bgp_set_aspath_replace.py
add support of  set as-path replace as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-08-07 12:30:34 +02:00
Donald Sharp
529203905b
Merge pull request #14151 from opensourcerouting/fix/improve_addpath_selected_test
tests: Improve bgp_addpath_best_selected topotest
2023-08-06 17:01:16 -04:00
Donatas Abraitis
6d91d1c768
Merge pull request #14149 from donaldsharp/cleanup_bad_commands
Cleanup bad commands
2023-08-06 20:10:23 +03:00
Donatas Abraitis
2b5236dbb3 tests: Check if role capability is exchanged via dynamic capability
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-05 22:57:06 +03:00
Donatas Abraitis
0ba5225b92 tests: Drop duplicate neighbor definition
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-04 23:22:38 +03:00
Donald Sharp
d65249aa65
Merge pull request #14148 from opensourcerouting/fix/tests_bgp_addpath_failing_sometimes
tests: Use a correct syntax for defining keepalive/hold timers
2023-08-04 15:44:10 -04:00
Donatas Abraitis
dcf133fdf6 tests: Improve bgp_addpath_best_selected topotest
Test everything else only after we have an initial good state.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-04 22:34:17 +03:00
Donald Sharp
d676e8c412 tests: isis_snmp, ldpd doesn't talk to snmp
isis_snmp.test_isis_snmp/r1/ldpd.log:2023/08/04 12:49:54 LDP: [SHWNK-NWT5S][EC 100663304] No such command on config line 8: agentx

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:06:56 -04:00
Donald Sharp
5eceb87d06 tests: babel_topo1 Another no such command
babel_topo1.test_babel_topo1/r3/babeld.log:2023/08/04 12:46:55 BABELD: [SHWNK-NWT5S][EC 100663304] No such command on config line 17:  redistirbute ipv6 connected

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:05:42 -04:00
Donald Sharp
27de57ec33 tests: config_timing calls non-existent command
./config_timing.test_config_timing/r1/zebra.log:2023/08/04 12:34:29 ZEBRA: [SHWNK-NWT5S][EC 100663304] No such command on config line 7: exit-route-map
./config_timing.test_config_timing/r1/zebra.log:2023/08/04 12:34:29 ZEBRA: [SHWNK-NWT5S][EC 100663304] No such command on config line 10: exit-route-map

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:04:48 -04:00
Donald Sharp
8487fd07d6 tests: bfd_ospf_topo1 there is no passive interface command
./bfd_ospf_topo1.test_bfd_ospf_topo1/rt3/ospfd.log:2023/08/04 12:46:58 OSPF: [SHWNK-NWT5S][EC 100663304] No such command on config line 28:  passive interface lo
./bfd_ospf_topo1.test_bfd_ospf_topo1/rt5/ospfd.log:2023/08/04 12:46:59 OSPF: [SHWNK-NWT5S][EC 100663304] No such command on config line 27:  passive interface lo
./bfd_ospf_topo1.test_bfd_ospf_topo1/rt1/ospfd.log:2023/08/04 12:46:56 OSPF: [SHWNK-NWT5S][EC 100663304] No such command on config line 30:  passive interface lo
./bfd_ospf_topo1.test_bfd_ospf_topo1/rt4/ospfd.log:2023/08/04 12:47:00 OSPF: [SHWNK-NWT5S][EC 100663304] No such command on config line 27:  passive interface lo
./bfd_ospf_topo1.test_bfd_ospf_topo1/rt2/ospfd.log:2023/08/04 12:46:57 OSPF: [SHWNK-NWT5S][EC 100663304] No such command on config line 28:  passive interface lo

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:03:44 -04:00
Donald Sharp
965405e25a tests: ospf6_gr_topo1 attempts, but fails to set the password
Irrelevant and let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:01:54 -04:00
Donald Sharp
59f24a5b06 tests: cspf_topo1 has import-te in sharpd.conf
This will never work, let's remove

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 13:00:36 -04:00
Donald Sharp
a3dda89f45 tests: bgp_update_delay is not even using frr cli syntax
Let's just remove it.   Looks like iproute2 configuration

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 12:58:53 -04:00
Donald Sharp
dd02d8926c tests: bgp_vpnv4_noretain test turns on isis but never uses it
The test was reading in the bgp config for the isis config and
clearly the test is working without this.  So let's remove
from the test the usage of isisd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-04 12:56:11 -04:00
Donatas Abraitis
40558baf47 tests: Use a correct syntax for defining keepalive/hold timers
BGP: [SHWNK-NWT5S][EC 100663304] No such command on config line 2:  timers 3 10

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-04 19:31:05 +03:00
Donatas Abraitis
8bf9ea0611 tests: Check if we can handle software version capability dynamicaly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-03 17:08:32 +03:00
Donald Sharp
cbbbf64f9a tests: Remove unused file in isis_snmp test
The */show_ip_route.ref files are never used, let's remove them
to prevent any future issues.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-02 07:15:59 -04:00
Jafar Al-Gharaibeh
ec8ae8f093
Merge pull request #14125 from opensourcerouting/fix/drop_unused_lua_stuff
lib: Do not use time_t as a special Lua encoder/decoder
2023-08-01 23:52:56 -05:00
Donald Sharp
369bdcaa1e tests: Convert d1 and d2 to output and expected in gen_json_diff_report
The output of gen_json_diff_report is used all over the place and
it outputs d1 and d2.  Let's change this to output and expected
as that is how it is used.  Should help with debugging.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-01 07:57:16 -04:00
Donald Sharp
29848dbe98 tests: Run black over lib/topotest.py
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-01 07:57:16 -04:00
Donald Sharp
0099493f1e tests: Start using output and expected vs d1 and d2
Let us start using output and expected in lib/topotest.py
because when we see output it is confusing what d1 is
versus what d2 is.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-01 07:57:16 -04:00
Donatas Abraitis
27dbf81a73 lib: Do not use time_t as a special Lua encoder/decoder
This is purely an integer (long long/long), and causes issues for 32-bit systems.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-01 14:08:25 +03:00
Farid Mihoub
6e01399077 tests: test set extended-comm-list <> delete command
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-07-31 11:52:40 +02:00
Donatas Abraitis
27330655f3
Merge pull request #14112 from donaldsharp/test_sponging
Test sponging
2023-07-31 10:02:36 +03:00
Donald Sharp
15bf9baa98 tests: Convert isis to use 1 and 10 for hello/multiplier
Current isis tests use a variety of hello timers as well
as hello-multiplier, let's modify all of the isis test
cases to use 1 and 10.  This cleans up some spurious test
failures I was seeing locally.  As an example without
these changes running isis_tilfa_topo1 2r6 times I would
see 5-10 test failures now I am seeing ~2 test failures.

In any event part of the problem was that some tests were
not fully converged when looking at them under heavy
system load.  Changing this to 1/10 gives us 10 chances
to see the incoming packet.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-29 13:39:37 -04:00
Donald Sharp
940ac2a6fd tests: bfd_bgp_cbit_topo3 allow bgp to converge before testing
This test was failing upstream a bunch of times.  Upon examining
the log files as well as the test script it was noticed that
the bfd peers were checked to see that they had come up.  But
both the timers used for bgp as well as not checking that bgp
has actually come up would cause the test to fail in subsuquent
steps if bgp has not come up.  Test that bgp peering is actually
established before testing link down events.  It's possible
this test might need to be revisited to ensure that the routes
are actually installed and ready to go before as well, but I am
not seeing that right now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-29 13:39:37 -04:00
Donald Sharp
e566e565c5 tests: Fix zebra_seg6_route to give more time for routes to be installed
This test is failing upstream regularly, when inspecting the log
files we see that the route being looked for is in a queued state
when the test fails.  Give this test more time for when the
system is under severe load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-29 13:39:37 -04:00
Donald Sharp
3984301417 tests: isis_te_topo1 can fail occassionally
Upstream ( and locally ) this test fails.  The adj-sid value
being looked for in the testing is a dynamic value that is
assigned based upon how the network comes up.  The reality
is that there is no enforced order of what the adj-sid
can be.  As such this test looking for this value makes
no sense.  Let's remove that from the test.

Additionally bring the isis hello-interval to 1 down
from 3 to make things converge faster.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-29 13:39:37 -04:00
Donald Sharp
b0e3fcfe8c tests: zebra_netlink ensure the address is installed
Ran test under high load and system rejected the sharp
install of routes.  Only reason that that would happen
would be if the address had not been set by the kernel
yet.  The test log files had timestamp precision and the
addition of the sharp routes was under 1/10 of a second
after the address was attempted to be installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-29 13:39:37 -04:00
Renato Westphal
2dd4cad60b tests: increase wait timer in TI-LFA topotest
Starting from step 11, this topotest focuses on validating the TI-LFA
switchover functionality, where the backup nexthops are activated
after an adjacency expires, either with or without BFD.

Currently, the test checks the RIB shortly after the switchover using
a tight 5 seconds interval to ensure that the RIB update is due to the
switchover and not an SPF update (which is configured with an initial
delay of 15 seconds). However, it was observed that the kernel might
take longer than 5 seconds to install routes when the system is under
heavy load. To account for that, double the wait interval so that
this topotest will succeed even in those conditions.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-07-29 14:18:39 -03:00
Renato Westphal
174a3d1b6e tests: ensure BFD session is up before proceeding to the next step
In this topotest, BFD is configured at the end of step 13. However,
in certain cases where the testing machine is exceptionally fast (e.g.,
Donald's quantum computer), there is a possibility that the interface
shutdown event from step 14 may occur before BFD has had sufficient
time to establish the session, which leads to a test failure. To fix
this problem, ensure the BFD session is up before proceeding to the
next step.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-07-29 14:18:39 -03:00
Renato Westphal
824b1d299a tests: increase hello multiplier in TI-LFA topotest
In this topotest, the IS-IS hello interval is set to 1 for fast
convergence. However, the current hello multiplier of 3 results in a
tight IS-IS adjacency holdtime of 3 seconds. This tight timeframe can
cause failures when the testing machine is running multiple tests at
full capacity. To improve stability under such conditions, this commit
raises the hello multiplier to 10, providing a more forgiving holdtime
and reducing the likelihood of failures.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-07-29 14:10:31 -03:00
Russ White
3f043d027f
Merge pull request #14050 from LabNConsulting/ziemba-pbr-zapi-common
pbrd: 2/3 zapi PBR common encode/decode
2023-07-25 10:55:50 -04:00
Russ White
6109c9a36b
Merge pull request #14086 from qlyoung/fix-strncpy-warning
tests: fix strncpy warning
2023-07-25 10:23:35 -04:00
Mark Stapp
adca5c22c5 * : include event ptr in event_execute api
Include an event ptr-to-ptr in the event_execute() api
call, like the various schedule api calls. This allows the
execute() api to cancel an existing scheduled task if that
task is being executed inline.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-07-25 10:17:48 -04:00
Russ White
82d8e7d5fa
Merge pull request #13945 from pguibert6WIND/redistribute_isis_table
Redistribute isis table
2023-07-25 10:16:46 -04:00
Quentin Young
64c549e68c tests: fix strncpy warning
GCC/clang warns about using strncpy in such a way that it does not copy
the null byte of a string; as implemented it was fine, but to fix the
warning, just use strlcat which was purpose made for the task being
accomplished here.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2023-07-24 19:03:24 -04:00
Donatas Abraitis
3a58764e3a
Merge pull request #14034 from LabNConsulting/aceelindem/ospf_prefix_suppression
ospfd: Implement OSPF prefix-suppression as specified in RFC 6860
2023-07-21 10:14:22 +03:00
Acee
e2eea4fe8e ospfd: Implement OSPF prefix-suppression as specified in RFC 6860
Signed-off-by: Acee <aceelindem@gmail.com>
2023-07-20 14:56:43 -04:00
G. Paul Ziemba
580a98b798 lib: zapi PBR common encode/decode
bgpd, pbrd: use common pbr encoder
    zebra: use common pbr decoder
    tests: pbr_topo1: check more filter fields

    Purpose:
	1. Reduce likelihood of zapi format mismatches when adding
	   PBR fields due to multiple parallel encoder implementations
	2. Encourage common PBR structure usage among various daemons
	3. Reduce coding errors via explicit per-field enable flags

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-20 08:10:45 -07:00
Donald Sharp
1b1d256f03
Merge pull request #14026 from LabNConsulting/pbr-add-vlan-filters
pbrd: 1/3: add vty support for vlan filtering and send to zebra
2023-07-20 08:01:24 -04:00
G. Paul Ziemba
8b330fe8b7 pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (doc, tests)
Subset: doc and tests

    doc
	PBR section updated with new fields and some copy-editing

    tests
	pbr_topo1: ensure new vlan fields arrive at zebra

    Changes by:
	Josh Werner <joshuawerner@mitre.org>
	Eli Baum <ebaum@mitre.org>
	G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-19 08:15:45 -07:00
Kuldeep Kashyap
3066746f5f tests: Update join state in verify_upstream_iif API
When JoinState is not passed to API it is expected to
be in Joined state, there was a minor bug in API, where
it was printng JoinState as None, which is default value
in API. Updated value to print Joined when verification
fails.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-07-19 19:21:01 +05:30
Francois Dumontet
291d334595 tests: add one test to bgp_exclude_aspath_exclude.py
add support of  set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-07-19 10:58:15 +02:00
Donald Sharp
37940809ad
Merge pull request #14037 from opensourcerouting/feature/enable_software_capability_for_datacenter_profile_by_default
bgpd: Enable software version capability for datacenter profile
2023-07-18 09:19:19 -04:00
Russ White
8593341164
Merge pull request #13868 from zice312963205/zly_mapflag
bgpd:Fixing a conflict issue between rmap_in_change_flag and rmap_out…
2023-07-18 09:14:50 -04:00
Russ White
a510c23641
Merge pull request #12964 from FRIDM636/bmp-basic-test
Add basic bgp bmp test
2023-07-18 08:53:07 -04:00
Donatas Abraitis
83d6a6a6e8
Merge pull request #14009 from rgangam-PAN/master
test_grpc.cpp Fix Compilation Error and RuntimePath for finding grpc.so
2023-07-18 09:47:10 +03:00
Donatas Abraitis
30db544508 bgpd: Send software-version capability by default
Useful to have it for datacenter profile only, disabled for traditional.

If the peer is not established or established, but has no description set,
we will show the FRR version instead, which is kinda handy to have instead of
nothing.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-18 09:42:48 +03:00
Donatas Abraitis
612f32c834 tests: Add SPDX-License-Identifier for bgp_software_version topotest
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-18 09:42:09 +03:00
Jack.zhang
2b4b4aeb67 test: fix the topotest case for the bug fix
Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
2023-07-18 14:19:46 +08:00
G. Paul Ziemba
e4a3fe6610 tests: test_babel_topo1: tolerate slow results
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-07-16 14:35:25 -07:00
Donald Sharp
7b52fccc62
Merge pull request #14019 from LabNConsulting/chopps/fix-mgmtd-assert
fix double lock bug and cmd resume early bugs
2023-07-15 16:05:09 -04:00
Donald Sharp
c26aa79ad0
Merge pull request #14020 from LabNConsulting/chopps/check-bt-cores-per-test
check for bt and cores per test
2023-07-15 15:59:25 -04:00
Donald Sharp
b4dd2fd841
Merge pull request #14008 from LabNConsulting/chopps/fix-backtrace
tests: fix/improve the printing of backtrace from cores
2023-07-15 15:59:15 -04:00
Christian Hopps
fd743a6a8e tests: backtraces/cores now fail tests
Previously we just raised an error for the test file with possibly all tests
passing. Now we fail any test that produces new backtraces or cores. This
just works a lot better with analysis and even CI.

Also be less verbose to the console after failure runs, just show error
level and above logs. The log files still capture all levels (DEBUG).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-07-15 00:26:03 -04:00
Christian Hopps
884fe82ceb tests: add regression test for issue $13920
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-07-14 19:29:57 -04:00
Christian Hopps
2a1787aef8 tests: fix/improve the printing of backtrace from cores
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-07-14 11:12:39 -04:00
Donatas Abraitis
31a985729e
Merge pull request #13993 from achernavin22/fix-rmap-on-match2
lib: fix on-match when added to existing route-map entry
2023-07-14 12:05:02 +03:00
Rajesh Gangam
509c7e5cd9 tests: Fix Compilation Error and RuntimePath changes for test_grpc
The runtime path for grpc.so has been changed for test_grpc.cpp
and also there were couple of definitions which are duplicate,
hence renamed them.

Signed-off-by: Rajesh Gangam <rajeshgangam@gmail.com>
2023-07-14 01:17:35 +00:00
Alexander Chernavin
633eb6ee77 lib: fix on-match when added to existing route-map entry
Currently, "on-match (next|goto)" only works if already present in a
route-map entry when the route-map is applied to the routes. However, if
the command is added to an existing route-map entry, the route-map is
not reapplied to the routes in order to accommodate the changes. And
service restart is needed. The problem is that setting the command
doesn't signal about the change to the listener (i.e. to a routing
daemon).

With this fix, signal to the listener about addition of "on-match
(next|goto)" to a route-map entry.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-07-13 08:40:36 +00:00
Donald Sharp
0cbd5855a9 ospf6d: Convert ospf6_lsa_unlock to a better api
Make the ospf6_lsa_unlock take the same parameters
that the ospf_lsa_unlock does to make it consistent
and to also ensure that no-one can make the mistake
of getting the pointer cleared up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-12 17:56:29 -04:00
Farid Mihoub
d748544769 topotests: add basic bgp bmp test
Test BMP messages logging.
Configure the BMP monitoring policy, add and withdraw IPv4/v6 prefixes.
Check if the received messages coincide with the monitored router BGP
session activity.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-07-12 14:54:06 +02:00
Farid Mihoub
875511c466 topotests: add basic bmp collector
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
2023-07-12 14:54:06 +02:00
Philippe Guibert
23cd58e857 topotests: add isis redistribute table functionality
Add a test to ensure that isis redistribution works
well.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-07-12 14:06:00 +02:00
Russ White
916feb7acc
Merge pull request #13885 from donaldsharp/tests_need_to_be_stricter
Tests need to be stricter
2023-07-11 11:49:38 -04:00
Russ White
89aba318f7
Merge pull request #13876 from LabNConsulting/mjs/nhrp_resolving
Allow NHRP routes to validate incoming nexthops
2023-07-11 11:48:16 -04:00
Russ White
6e89a5db22
Merge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable
ospfd: Configurable interface-level 'capability opaque' support
2023-07-11 11:47:32 -04:00
Russ White
220d7b1a89
Merge pull request #13948 from opensourcerouting/fix/bgpd_rfc7606_adjustments
bgpd: Some rfc7606 adjustments
2023-07-11 10:19:30 -04:00
Mark Stapp
bf465adc57 tests: add route-install test using NHRP tunnel
Add a test-case to the NHRP test that installs routes over the
NHRP tunnel endpoint routes. This confirms that zebra will use
NHRP routes when validating incoming routes from other daemons
(sharpd in this test).

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-07-10 16:43:53 -04:00
David Schweizer
59640b7223
tests: fix BGP delayopen timer expiration test
The changes allow the test to correctly pass in case the connection
between two peers is be established in less than 0.5 seconds after the
delayopen timer expires.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2023-07-10 15:46:05 +02:00
Donald Sharp
162b61ec16 tests: bgp_flowspec expand timings
Attempt to set the hold time in the bgp flowspec exabgp
config.  In addition it was noticed that upstream bgp_flowspec
tests are still not negotiating peering within the time frame
specified.  This is because the first tcp packet is missed
and no keepalive/hold time are negotiated and exabgp will
not attempt a reconnect for quite some time.  Make this
test slower when things go south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
377e92bc89 tests: Fix wrong config line in bgp_l3vpn_to_bgp_vrf
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
f5c44adb73 tests: isis_tilfa_topo1 fails sometimes due to insufficient time
The isis_tilfa_topo1 test is failing because insufficient time was
given for isis to converge on the system under system load.  Extend
the time and decrease the hello-interval timers to give it more
of a chance to converge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
ce51339205 tests: bgp_vpnv4_per_nexthop_label is failing
The test is failing because it assumes a json key
is always present when it is not.  Test for it
before having the test fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
481c540d28 tests: zebra_rib route-map run times fixup
I have a local test run where the sharp route-map usage
was being checked for 5 seconds.  I saw usages going up
for each 1 second check and the 5th one was at 497 out
of 500.  Looks like the system was really loaded.  Let's
give it more time to coalesce under heavy load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
9b38d8fec9 tests: Do not remove core files
Tests are removing core files and we are missing some
of them because of this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
a8510639ad tests: If a core file is generated fail the test
If a .dmp file is found in the test log directories
fail the test.

Issue: #13788
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donald Sharp
caa278d0c7 tests: Look for zlog_backtrace in ci system
There are parts of our daemons that upon certain types
of errors that a zlog_backtrace is auto-generated.
It is desirable for this to be caught and have the
test auto-failed.

Issue: #13787
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10 09:06:40 -04:00
Donatas Abraitis
bea517b669 tests: Ignore test_darr for git
This file is generated after `make check`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-08 22:41:34 +03:00
Donatas Abraitis
c1ccfa977a bgpd: Check if originator-id attribute is not received via eBGP session
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-07 23:01:13 +03:00
Donald Sharp
3b496e9b5d
Merge pull request #13915 from pguibert6WIND/bgp_vpnv6_per_nexthop_better_test
topotests: label per nexthop ipv6 test adds add a while loop for mpls…
2023-07-06 16:21:19 -04:00
Donatas Abraitis
2ec7477a26
Merge pull request #13808 from anlancs/fix/zebra-kernel-route-reserved
zebra: fix wrong nexthop check for kernel routes
2023-07-06 09:01:21 +03:00
Philippe Guibert
48f73cbd2f topotests: label per nexthop ipv6 test adds add a while loop for mpls table
The bgp_vpnv6_per_nexthop_label tests only check to see if the mpls labels
are installed one time. Test runs show that all but one label is installed.
More than likely the test has asked for data while zebra is still installing
it. the mpls_label_check functions must check this result multiple times as
that system may be under heavy load.

A loop is introduced in order to let zebra check the mpls table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-07-05 21:58:38 +02:00
Donald Sharp
806b0ca085
Merge pull request #13916 from pguibert6WIND/vpnv4_asbr_test_complement
topotests: bgp_vpnv4_asbr, wait that mpls entry is installed
2023-07-03 08:34:01 -04:00
Philippe Guibert
37b602a69d topotests: bgp_vpnv4_asbr, wait that mpls entry is installed
Ensure in the test that MPLS entries are installed before
declaring the test fails.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-07-03 10:27:23 +02:00
anlan_cs
019ac03e5b tests: Check if kernel routes work with changed vrf
Check `show ip route` for specific kernel routes after
the interface as their nexthop changes vrf.

After moving interface's vrf, there should be no kernel
route in old vrf.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-07-02 10:30:09 +08:00
Donatas Abraitis
3b02d99f33
Merge pull request #13836 from pguibert6WIND/set_aspath_replace_with_configured_asn
bgpd: add 'set as-path replace' with a configured ASN
2023-06-30 12:39:55 +03:00
Jafar Al-Gharaibeh
6f0aef2ef8
Merge pull request #13866 from LabNConsulting/mgmtd/incllang
Changes for inclusive language and other cleanup
2023-06-29 17:14:21 -05:00
Donald Sharp
c65e7e7c3f tests: Fix broken check_ping run_and_expect semantics
*again*.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-29 10:42:11 -04:00
Philippe Guibert
a3f0a1f5ed bgpd: add 'set as-path replace' with a configured ASN
There is no route-map set action to replace any ASN,
or a part of an ASN, with a configured ASN.

The current commit adds a new command to use a configured
ASN as replacement, instead of using the local as number.

> set as-path replace any 65500

Update the 'bgp_set_aspath_replace' test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-28 21:21:55 +02:00
Acee
e72549c8f6 ospfd: Configurable interface-level 'capability opaque' support
Add support for "[no] ip ospf capbility opaque" at the interface
    level with the default being capability opaque enabled. The command
    "no ip ospf capability opaque" will disable opaque LSA database
    exchange and flooding on the interface. A change in configuration
    will result in the interface being flapped to update our options
    for neighbors but no attempt will be made to purge existing LSAs
    as in dense topologies, these may received by neighbors through
    different interfaces.

    Topotests are added to test both the configuration and the LSA
    opaque flooding suppression.

Signed-off-by: Acee <aceelindem@gmail.com>
2023-06-28 13:03:48 -04:00
Christian Hopps
e6e0c5bd25 lib: add dynamic array type
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-27 18:00:56 -04:00
Russ White
4a7d9469f2
Merge pull request #13826 from opensourcerouting/fix/ripng_match_ipv6_acls
ripng: match ipv6 address [prefix-list] CMDs
2023-06-27 11:31:23 -04:00
Donatas Abraitis
53785cdd43
Merge pull request #13628 from kuldeepkash/uplink_mcast_tests
tests: Add multicast-pim-multi-uplink test suite
2023-06-27 13:34:17 +03:00
Donatas Abraitis
4199f032e5
Merge pull request #13722 from fdumontet6WIND/color_extcomm
bgpd,lib,yang: add colored extended communities support
2023-06-27 13:03:22 +03:00
Francois Dumontet
9ec092c6a2 tests: add bgp colored extended community test
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2023-06-26 14:27:27 +02:00
Kuldeep Kashyap
e3122819e9 tests: Add multicast-pim-multi-uplink-topo3 suite
Added 4 new test cases to verify multicast PIM
uplink(8 uplink) functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-06-26 09:30:04 +05:30
Kuldeep Kashyap
e350fb986e tests: Add multicast-pim-multi-uplink-topo2 suite
Added 4 new test cases to verify multicast PIM
uplink(8 uplink) functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-06-26 09:30:04 +05:30
Jafar Al-Gharaibeh
499eae6c6b
Merge pull request #13795 from LabNConsulting/chopps/mgmt-lock-cleanup
mgmt lock simplification
2023-06-22 13:31:27 -05:00
Donatas Abraitis
2d4da959a6 tests: Check if match ipv6 address [prefix-list] CMDs work for ripng
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-22 00:14:03 +03:00
Russ White
be4cfbd2b8
Merge pull request #13790 from pguibert6WIND/set_aspath_exclude
bgpd: add 'set as-path exclude all' command
2023-06-21 08:48:21 -04:00
Donatas Abraitis
508deadf3d tests: Adjust tests for BGP LU labelpool output
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-20 20:46:34 +03:00
Russ White
4d9fb376c8
Merge pull request #13728 from opensourcerouting/fix/addpath_drop_non_best_addpaths
bgpd: Implement neighbor X addpath-tx-best-selected command
2023-06-20 09:20:36 -04:00
Russ White
554c2e0350
Merge pull request #13750 from louis-6wind/fix-no-retain-memory-usage
bgpd: fix memory usage of vpn no retain
2023-06-20 09:19:50 -04:00
Russ White
c57667022c
Merge pull request #13769 from opensourcerouting/fix/bgp_peer-group_show_advertised
bgpd: Allow using peer-group for listing advertised-routes, etc.
2023-06-20 09:18:52 -04:00
Russ White
2cfc0ba8e9
Merge pull request #13665 from pguibert6WIND/issue_13616_pr
topotests: label per nexthop test adds add a while loop for mpls table
2023-06-20 09:18:16 -04:00
Russ White
514d3b397a
Merge pull request #13666 from pguibert6WIND/issue_13638_pr
topotests: structural issues in bgp_local_as_dotplus_private_remove
2023-06-20 09:17:51 -04:00
Russ White
68da3eab07
Merge pull request #13524 from pguibert6WIND/mpls_vpn_lsr_redistribute
MPLS vpn LSR redistribute
2023-06-20 09:13:33 -04:00
Russ White
56a10caa03
Merge pull request #12971 from taspelund/trey/mac_vrf_soo_upstream
bgpd: Add MAC-VRF Site-of-Origin support
2023-06-20 09:08:28 -04:00
Philippe Guibert
f2732f531f topotests: label per nexthop test adds add a while loop for mpls table
The bgp_vpnv4_per_nexthop_label tests only check to see if the mpls labels
are installed one time. Test runs show that all but one label is installed.
More than likely the test has asked for data while zebra is still installing
it. the mpls_label_check functions must check this result multiple times as
that system may be under heavy load.

A loop is introduced in order to let zebra check the mpls table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-20 09:09:22 +02:00
Philippe Guibert
d1e16777d5 topotests: structural issues in bgp_local_as_dotplus_private_remove
This test has several issues:
A) The convergence function is spamming the show neighbor command until success,
if the neighbor never comes up the test will never finish. This adds unnecessary
load to an already loaded test system.  Use run_and_expect to properly wait for
the neighbor relationship to come up.
B) The convergence function should not sleep for 1 second *After* the neighbor
is established
C) The _bgp_as_path() function fails if the prefix has not been received yet.
This looking for the prefix data should be within a run_and_expect() functionality.
Else a loaded test system will fail in this function because while we may be in
an established state, prefixes might not yet have been exchanged and there is no
point in failing the test without giving the system some time to actually converge.

Fix those points, similarly to what has been fixed in
bgp_local_as_private_remove test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-20 09:08:33 +02:00
Philippe Guibert
92550adfc7 bgpd: add 'set as-path exclude all' command
It is not possible to flush all the incoming as-path list
from a given BGP update.

Add a route-map set command to remove all as-paths
from a given AS path. Add the necessary tests.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-19 18:04:44 +02:00
Christian Hopps
df0173ceeb mgmtd: KISS the locking code
Move away from things like "lock if not locked" type code, require the
user has locked prior to geting to that point.

For now we warn if we are taking a lock we already had; however, this
should really be a failure point.

New requirements:

SETCFG -
  not implicit commit - requires user has locked candidate DS and they
    must unlock after

  implicit commit - requires user has locked candidate and running DS
    both locks will be unlocked on reply to the SETCFG

COMMITCFG -
  requires user has locked candidate and running DS and they must unlock
  after

  rollback - this code now get both locks and then does an unlock and
  early return thing on the adapter side. It needs to be un-special
  cased in follow up work that would also include tests for this
  functionality.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-19 00:13:28 -04:00
Louis Scalbert
e3d2aeac17 topotests: import vpn to default vrf in bgp_vpnv4_noretain
Test that importing VPN prefixes into the default VRF is possible with
the no retain feature.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:44 +02:00
Louis Scalbert
22dfa04b78 topotests: more tests in bgp_vpnv4_noretain
Add more VRFs in bgp_vpnv4_noretain and test combinations of no-retain
/ retain and import / un-import.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:34 +02:00
Louis Scalbert
d629c2f419 topotests: check protocol convergence at init in bgp_vpnv4_noretain
Check that the BGP session is Established before starting the tests.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
1a2b340892 topotests: check r2 vpn table in bgp_vpnv4_noretain
Remove no retain in r2 and check that r2 VPN table remains the same
after r1 configuration changes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
9aa2e5b1cd topotests: do not import r1 vrf1 to itself bgp_vpnv4_noretain
Do not import r1 vrf1 to itself in order to check that r1 vrf1 prefixes
are only in VPN table because it is needed for advertising the prefixes
to other routers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
a92a2683a3 topotests: filter out void RD in bgp_vpnv4_noretain
Filter out route-distinguishers that have no prefix in "show bgp table
json"

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
fe993cb25f topotests: router relative variables in bgp_vpnv4_noretain
Change IP addresses, label, RD and RT to match the router number
and VRF number.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
bf636d3712 topotests: apply style to bgp_vpnv4_noretain
Apply style cosmetic changes to bgp_vpnv4_noretain with "black".

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Louis Scalbert
c2435c67f4 topotests: cosmetic changes to bgp_vpnv4_noretain
Cosmetic changes to bgp_vpnv4_noretain to prepare the next commit.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-16 14:18:25 +02:00
Philippe Guibert
7b3c6f8934 topotests: mpls vpn routes redistribution, add asbr test
This setup demonstrates the redistribution and the proper
switching operations in an asbr device.
The setup interconnects an internal AS with an external
connected AS.
- the iBGP AS uses BGP-LU as MPLS transport
- the eBGP peering is directly connected and does use the
'mpls bgp forwarding' configuration to accept exterior
updates.

The setup performs the following tests:
- it checks for end to end connectivity from one interior
host h1 to two external hosts h2, and h3.
- it checks that the proper label values are advertised
by the ASBR to the iBGP peer, and the eBGP peer.
- it checks that the 'show mpls table' has additional
MPLS entries that permit transit mpls traffic to transit
across the ASBR. That behaviour is possible with the
'mpls bgp allocate-label-on-nexthop-change' command.
- it checks that withdraw of routes will remve the MPLS
entries.
- it checks that by unconfiguring the 'next-hop-self' option,
the external routes advertised to the internal maintain the
next-hop.
- it checks that a second prefix advertised by r3 with the
same RD, but different label value is using a new label on r2,
and that this new label value is used.
- it checks that when filtering out prefixes from r1, on r2,
then the MPLS label is deallocated, and the MPLS entry is not
present.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-06-16 10:55:11 +02:00
Christian Hopps
78dfcceeae
Merge pull request #13767 from opensourcerouting/fix/convert_rip_topo1_to_polling
tests: Convert rip/ripng tests using run_and_expect
2023-06-13 04:20:49 -04:00
Donatas Abraitis
e0db9a05bd
Merge pull request #13763 from LabNConsulting/mgmtd/simplify
fix 'exit' bug in config file processing, et al.
2023-06-13 11:10:18 +03:00
Donald Sharp
6ec1065217 tests: test_bgp_flowspec_topo.py changes as per linter
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-12 09:22:51 -04:00
Donald Sharp
773376a3c3 tests: The bgp_flowspec frequently fails try to gather more data
Add a bit of code to allow the bgp_flowspec topotest to gather
data when something goes wrong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-12 09:22:51 -04:00
Donatas Abraitis
7ac46d8a08 tests: Check if neighbor X advertised-routes cmd works for peer-groups
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-12 15:20:08 +03:00
Donatas Abraitis
48008be43f tests: Apply black formatting for rip_topo1/ripng_topo1
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-12 11:45:03 +03:00
Donatas Abraitis
717f180a49 tests: Use run_and_expect() for ripng_topo1
Avoid checking once and failing immediately.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-12 11:40:09 +03:00
Donatas Abraitis
3349754a80 tests: Use run_and_expect() for rip_topo1
Avoid checking once and failing immediately.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-12 11:38:01 +03:00
Christian Hopps
dac48df52a tests: add mgmtd config test
Testing early exits/ends from config files loaded with `vtysh -f cfgfile`
as well as `vtysh < cfgfile`, verify the same as non-mgmtd behavior.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-12 03:23:51 -04:00
Donald Sharp
ae88ba4b52 tests: Fix missing assert for test case in bgp_suppress_fib
Test was attempting to test the 60.0.0.0 route but was querying
10.0.0.3 and ignoring the result.  Let's fix it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-09 09:25:29 -04:00
Jafar Al-Gharaibeh
e48e92e76c
Merge pull request #13734 from LabNConsulting/chopps/removeunused
remove mentions of socat
2023-06-08 23:46:45 -05:00
Quentin Young
cb827d9f55
Merge pull request #13650 from opensourcerouting/feature/bgpd_default_originate_route_map_timer
bgpd: Add an ability to control default-originate route-map timer
2023-06-08 12:05:35 -04:00
Christian Hopps
17054f373e doc: update doc removing socat req + remove unused tests code
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-08 11:03:18 -04:00
Christian Hopps
b28bc2561e tests: convert old pim test to more cleanly use pytest fixture
This is a good way to run a per-test background helper process. Here the
helper object is created before the test function requesting it (through param
name match), and then cleaned up after the test function exits (pass or failed).

A context manager is used to further guarantee the cleanup is done.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-08 04:55:32 -04:00
Christian Hopps
efedb18976 tests: fixing pim6 topotest bugs
- Remove use of bespoke socat
- Use ipv6 support in mcast-tester.py
- do not run processes in the background behind munet/micronet's
  back with `&` (ever) -- use popen or the helper class

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-08 04:55:32 -04:00
Christian Hopps
71231d304f tests: mcast-tester.py handles IPv6
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-08 02:39:09 -04:00
Donatas Abraitis
0ec8b2d869 tests: Test neighbor X addpath-tx-best-selected command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-07 22:27:28 +03:00
Donatas Abraitis
7f0c12d5b3
Merge pull request #13622 from kuldeepkash/bgp_always_compare_med
tests: Adding bgp_always_compare_med testuite
2023-06-07 09:36:15 +03:00
Donald Sharp
8625fe0f45 tests: Babel tests do not need to log to eigrp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-06 11:59:20 -04:00
Donald Sharp
da877b5ced
Merge pull request #13690 from LabNConsulting/chopps/mgmtd-cleanup
Chopps/mgmtd cleanup
2023-06-06 07:22:31 -04:00
Martin Winter
6a771192de
Merge pull request #13618 from LabNConsulting/chopps/fixlogging 2023-06-06 02:35:20 -07:00
Donatas Abraitis
fecc953b3c
Merge pull request #13670 from donaldsharp/coverity_99
Coverity 99
2023-06-05 22:33:55 +03:00
Christian Hopps
ee235c606f tests: mgmtd: add prologue to bigconf tests
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-05 13:53:51 -04:00
Donald Sharp
05cb9e55a7
Merge pull request #13658 from louis-6wind/fix-flex-algo2
isisd: fix wrongly disabled flex-algorithm
2023-06-05 12:43:01 -04:00
Christian Hopps
9c57c2900a tests: fix some broken logging
- make sure we close and remove all handlers for named logs on each reuse.
- test module level exec.log no longer truncated to last test case output
- cleanup the log names, and make sure they are present in all exec logs
- keep separate exec logs for each pytest worker when running in distributed mode
- disabled code due to CI infra can't handle it: add per test case exec logs

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-05 12:42:57 -04:00
Donald Sharp
0889f6d894 tests: Rename a test to test_bgp_gr_functionality_topo3.py
Since the test was not named test_bgp_gr_functionality_topo3.py
pytest was not picking it up to run.  Let's run it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-06-05 07:57:49 -04:00
Christian Hopps
be3c453556 tests: pause (with CLI) at step() functions when run with --pause
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-04 17:38:19 -04:00
Donald Sharp
84af55b268 tests: new mgmt_startup tests are failing due to insufficient time
The tests are failing due to heavily loaded system and insufficient
time for large configs to be handled.  Increasing the time
allows the tests to complete locally for me under heavy load.

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

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

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

Fixes: 1a61ef95b2 ("tests: add isis_sr_flex_algo_topo1 for flex-algo")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-06-01 14:14:51 +02:00
Donatas Abraitis
1bfbdc17f2 tests: Check if bgp default-originate timer command works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-31 22:58:32 +03:00
Donald Sharp
22c10bbdaa tests: Actually loop if ping fails
The usage of run_and_expect doesn't work if the function
being called as the run part asserts.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-30 15:43:42 -04:00
Donatas Abraitis
147c7a2de3
Merge pull request #13631 from donaldsharp/fix_some_ping_issues
various issues
2023-05-30 21:26:24 +03:00
Trey Aspelund
6510458757 tests: add topotest for EVPN MAC-VRF SoO
Adds topotest to cover the new EVPN MAC-VRF Site-of-Origin feature.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2023-05-30 15:25:37 +00:00
Christian Hopps
7cd87abc5e tests: add unified config tests
- simple unified test
- unified test with late backend startup test

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 04:09:29 -04:00
Christian Hopps
e3c4bd2472 tests: add some more mgmtd tests
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00
Christian Hopps
5ba5613077 lib: mgmtd: add manual vty server start option and use it
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30 02:10:20 -04:00
Kuldeep Kashyap
ac9c7ac8ba tests: Adding framework support for bgp_always_compare_med
Added/enhanced bgp.py to support config/
unconfig bgp always compare med related
configurations.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-05-29 13:20:15 +05:30
Kuldeep Kashyap
9bd040b2fa tests: Adding bgp_always_compare_med testuite
Automated 5 different scenarios to verify BGP
always compare med functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-05-29 13:07:54 +05:30
Donald Sharp
131153ea22 tests: Allow ping to run multiple times before failing
the bgp_default_originate test brings up the topology and
then immediately pings.  Which sometimes fails.  This is
of course possible since the first ping might actually fail
due to arp going on.  So let's give it a second chance or two.
Especially since the test, at this point, is just installing
a default route.

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

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

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

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

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

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

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-22 10:52:54 -04:00
Donald Sharp
af53f97f34 tests: Add exit stanzas to pre-generated config
A bunch of tests rely on pre-generated config from
json files.  These tests were not putting `exit` stanzas
and a bunch of the tests as a result are silently failing
to configure properly at all, as commands were being sent
to the wrong daemons.

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

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

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

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

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

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

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

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-19 14:57:56 +03:00
Donatas Abraitis
a8bc67a989
Merge pull request #13369 from samanvithab/bgpd_fix
lib : fix duplicate prefix list delete
2023-05-18 10:24:41 +03:00
Donatas Abraitis
c374605ecb
Merge pull request #13541 from LabNConsulting/chopps/fixtestdefconf
tests: fix implicit config file and recently added logic error
2023-05-18 09:44:38 +03:00
Christian Hopps
f3525b0b17 tests: fix implicit config file and recently added logic error
- Restore default of looking for a daemon config underneath the router directory
if no config file was specified.
- Recent change for adding unified config support had a logic bug, fix
- Update the one test that conflicted with this default
- comment out asyncio option causing warnings if asyncio wasn't installed.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-17 16:05:53 -04:00
Christian Hopps
fea00bad20 tests: fix pylint error, and update style in lib/*.py
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-17 13:42:32 -04:00
Donald Sharp
244d5d0a16 tests: Change order of config files
Our CI test system is configuring interfaces like this:

int A
  <ospfX config>

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

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

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

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

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

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

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

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

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

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