Commit Graph

3176 Commits

Author SHA1 Message Date
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
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
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
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