Commit Graph

2506 Commits

Author SHA1 Message Date
Donald Sharp
4378495a27 bgpd: Add vrf information to best path debugging
When debugging issues for routes in multiple vrf's.  It would
be extremely useful if the debug output had which vrf we
are acting on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-12 13:24:04 -05:00
Philippe Guibert
7f9bf69df9 topotests: bfd_topo3, remove reference to default vrf
Because this test can be run in either netns vrf mode or vrflite
vrf mode, the default vrf name has different name. When netns mode
is chosen, vrf0 name is chosen as default name, while when vrflite
mode is chosen, default name is chosen. Remove the vrf keyword from
the expected dump.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-11-12 16:42:25 +01:00
Philippe Guibert
4acedd57b6 bgp_evpn_rt5: simplify test and use default vrf name = default
default vrf name defaults to 'default' keyword.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-11-12 16:42:25 +01:00
Philippe Guibert
d02ac4c504 topotests: bgp_ecmp_topo1, use default vrf name convention
Simplify the test, and use default vrf name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-11-12 16:42:25 +01:00
Donald Sharp
7cc91e67a3 *: Convert quagga_signal_X to frr_signal_X
Naming functions/data structures more appropriately for
the project we are actually in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11 14:41:27 -05:00
David Lamparter
e536bb107d build: break up tests/subdir.am
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 14:40:03 +01:00
David Lamparter
254144e7ef build: refactor tests/subdir.am
... to put related stuff next to each other.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 13:51:44 +01:00
David Lamparter
fec9fb2985 tests: fix frr-format warnings in printfrr test
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 12:27:11 +01:00
David Lamparter
5863f58933 build: adjust silent make rules in tests
Purely aesthetic change to make these rules not stick out like a sore
thumb.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11 12:26:29 +01:00
Donald Sharp
6f0331d8b4
Merge pull request #9988 from idryzhov/ospf-gr-broken
ospfd: remove commands for broken GR helper mode
2021-11-10 14:05:38 -05:00
Igor Ryzhov
accef597df ospfd: remove commands for broken GR helper mode
Issue #9983 explains what is wrong with the GR helper mode.

To unblock the CI that fails almost all the time on the ospf_gr_topo1
test, remove the commands and disable the test. Also add a reminder to
completely remove the helper mode if no one fixes the code in a month.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-10 19:17:03 +03:00
Donatas Abraitis
37b6787730
Merge pull request #9700 from mjstapp/add_json_det_attrs
bgpd: Add 'show bgp <afi> <safi> json detail' header data
2021-11-10 16:42:30 +02:00
Igor Ryzhov
b6380d60c7
Merge pull request #9996 from opensourcerouting/resolver-fix-threads
lib: fix `struct thread **` misuse in c-ares resolver bindings
2021-11-09 13:55:44 +03:00
Russ White
d630e21a0b
Merge pull request #9924 from idryzhov/isis-nb-improvements
various isisd northbound fixes
2021-11-08 17:56:22 -05:00
Russ White
e2b5cbf7a0
Merge pull request #9995 from donaldsharp/bfd_ospf_topo1_convvergence
tests: bfd_ospf_topo1 expects unreasonable convergence times under load
2021-11-08 13:52:12 -05:00
David Lamparter
ecabab0320 tests: add c-ares "exercise" tool
This can't really be run as part of CI, it's intended as a helper
instead, to use manually after poking around in the c-ares binding code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-08 14:06:21 +01:00
David Lamparter
865dd9fe0b tests: allow common_cli.c with logging enabled
common_cli.c disables logging by default so stdio is usable as vty
without log messages getting strewn inbetween.  This the right thing for
most tests, but not all; sometimes we do want log messages.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-08 14:06:21 +01:00
Igor Ryzhov
9780353f6c tests: fix bgp_community_change_update
949aaea5 removed debugs from all topotests, but this test relies on the
debug logs so it constantly fails now.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-08 13:35:09 +03:00
Donald Sharp
7b66f10e20 tests: bfd_ospf_topo1 expects unreasonable convergence times under load
When our CI test system is under high load, expecting bfd to
converge in under 2 seconds is not going to happen.  Modify the test
suites to just ensure that things reconvderge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-07 08:38:33 -05:00
Donald Sharp
949aaea5ba tests: Remove debugs from topotests
Debugs take up a significant amount of cpu time as well as
increased disk space for storage of results. Reduce test
over head by removing the debugs, Hopefully this helps
alleviate some of the overloading that we are seeing in
our CI systems.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-07 07:45:27 -05:00
Donatas Abraitis
79fd3e0c97
Merge pull request #9958 from donaldsharp/all_protocol_nhg_replace
tests: Fix route replace test in all_protocol_startup
2021-11-06 15:11:33 +02:00
Jafar Al-Gharaibeh
3e57d69186
Merge pull request #9974 from donaldsharp/ldp_vpls_topo1_wait
tests: Ensure ospf has reconverged before continuing
2021-11-05 14:50:02 -05:00
Donald Sharp
b4bee329d2 tests: pim_basic needs to wait for event to happen under load
The test system under load looks for upstream state only
1 time immediately after sending 2 streams of S,G data
flowing.  Give the system some time to process this
and ensure that it actually shows up in a small
amount of time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-05 11:50:46 -04:00
Donald Sharp
8a019129dc tests: Ensure ospf has reconverged before continuing
The test_ldp_pseudowires_after_link_down test
shuts a link down and was blindly waiting 5 seconds
before just assuming the test system was in a sane
state.  Remove the sleep(5) and actually look for
the changed state for the route 2.2.2.2 that the
psueudowire actually depends on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-05 11:18:41 -04:00
Donald Sharp
56bce96682 tests: test_ospf_topo1.py ensure rib has time to converge
The test does this:

a) shut link down
b) test for ospf convergence
c) ensure the route is installed

When under a heavily loaded system c) is not guaranteed
to happen quickly.  Give the system 10 extra seconds
to ensure it happens.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-05 06:42:38 -04:00
Donald Sharp
8beb469fd3 tests: Fix route replace test in all_protocol_startup
The route replace test was doing this seq of events:

a) Create nhg
b) Install route w/ sharpd
c) Ensure it worked
d) Modify nhg
d) Ensure the update group replace worked

The problem is that the sharp code is doing this:

	/* Only send via ID if nhgroup has been successfully installed */
	if (nhgid && sharp_nhgroup_id_is_installed(nhgid)) {
		SET_FLAG(api.message, ZAPI_MESSAGE_NHG);
		api.nhgid = nhgid;
	} else {
		for (ALL_NEXTHOPS_PTR(nhg, nh)) {
			api_nh = &api.nexthops[i];

			zapi_nexthop_from_nexthop(api_nh, nh);

			i++;
		}
		api.nexthop_num = i;
	}

The created nhg has not been successfully installed( or at least
sharpd has not read the results yet) when it gets the command
to install the routes.  As such it passes down the individual
nexthops instead.  The route replace is never going to work.

Modify the code to add a bit of sleep to allow sharpd to
get notified when the system is under load.  At this point
there is no way to query sharpd for whether or not it
thinks it's nhg is installed properly or not.  This
test is failing all over the place for a bunch of people
let's get this fixed so people can get running

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-04 11:49:04 -04:00
ARShreenidhi
6a28d13560 tests: testcase to configure verity tcp mss in vrf
Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2021-11-03 00:17:52 -07:00
Donald Sharp
0567f3a9f3 tests: All_protocol_startup sporadic failure
the test_nexthop_groups function is failing occassionally
because the test executes 4 in succession sharp install
routes commands.  When I dumped the rib on a failed test
run there were only 2 of the 4 routes in the rib and
the two that were in were the last 2 installed.
The sharp daemon setups a event process where it
installs routes `automatically`.  If the previous
run is not finished entering a new command to install
the routes will mess up the last one from ever happening.
It is assumed that the user doesn't do stupid stuff here.
In this case I am just adding a small sleep between each
installation to just let the test proceed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-01 15:12:23 -04:00
Igor Ryzhov
65a69156b2
Merge pull request #9928 from donaldsharp/isis_topo1_fix
tests: isis_topo1 needs to wait for results under load
2021-11-01 12:25:32 +03:00
Donald Sharp
732107a4e1 tests: isis_topo1 needs to wait for results under load
the isis_topo1 test has two functions where immediately
after the test ensures that the routes are in isis
tests to see if they are in the rib.  Under system
load I am seeing this test failing because the
routes are still queued.  Modify the zebra check
for the isis routes to look for the proper results
for 10 seconds.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-31 20:08:29 -04:00
Donatas Abraitis
9cec18f1e5
Merge pull request #9916 from donaldsharp/run_and_expect_failure
tests: Fix `check_ping` function in test_bgp_srv6l3vpn_to_bgp_vrf.py
2021-10-31 20:46:14 +02:00
Igor Ryzhov
2f9a06f060 isisd: fix circuit is-type configuration
Currently, we have a lot of checks in CLI and NB layer to prevent
incompatible IS-types of circuits and areas. All these checks become
completely meaningless when the interface is moved between VRFs. If the
area IS-type is different in the new VRF, previously done checks mean
nothing and we still end up with incorrect circuit IS type. To actually
prevent incorrect IS type, all checks must be done in the processing
code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-30 03:17:49 +03:00
Martin Winter
cd206022b1
Merge pull request #9920 from donaldsharp/zebra_seg6local_race
tests: zebra_seg6local has a race condition
2021-10-30 01:36:35 +02:00
Donald Sharp
7d2cf93636 tests: Fix zebra_seg6_route to not always reinstall the same route
This code has two issues:

a) The loop to test for successful installation re-installs
the route every time it loops.  A system under load will
have issues ensuring the route is installed and repeated
attempts does not help

b) The nexthop group installation was always failing
but never noticed (because of the previous commit)
and the test was always passing, when it should
have never passed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-29 13:17:54 -04:00
Donald Sharp
b7b352c000
Merge pull request #9830 from idryzhov/config-timing-fixes
tests: test_static_timing fixes
2021-10-29 13:17:24 -04:00
Donald Sharp
25347872bf tests: zebra_seg6local has a race condition
The test is checking installing of seg6 routes by this
loop:

for up to 5 times:
    sharp install seg6 route
    show ip route and is it installed

The problem is that if the system is under heavy
load the installation may not have happened yet
and by immediately reinstalling the same route
the same thing could happen again.

Modify the code to pull the route installation
outside of the loop and to increase to 10 attempts
in case there is very heavy system load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-29 08:53:03 -04:00
Igor Ryzhov
9f25891037
Merge pull request #9851 from sartura/isis_unpack_item_ext_subtlvs_fixes
isisd: fix unpack_item_ext_subtlvs TLV parsing issues
2021-10-29 13:34:02 +03:00
Donald Sharp
6b60e7b81d tests: Fix check_ping function in test_bgp_srv6l3vpn_to_bgp_vrf.py
The check_ping function `_check` function was asserting and being
passed to the topotests.run_and_expect() functionality causing
it to not run the full range of pings if one failed the test.

So effectively it was properly detecting pass / failure but
only allowing for 1 iteration if it was going to fail.

Modify the code to not assert and act like all the other
run_and_expect functionality.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-28 15:51:46 -04:00
Juraj Vijtiuk
17b0839b35 isisd: fix unpack_item_ext_subtlvs TLV parsing issues
isis_tlvs.c would fail at multiple places if incorrect
TLVs were received in unpack_item_ext_subtlvs(),
causing stream assertion violations.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
2021-10-27 17:04:26 +00:00
Donald Sharp
f1506cf36b
Merge pull request #9902 from LabNConsulting/working/lb/lutil-wait-optimization
tests: topotests/lib/lutil.py: optimize wait to not repeat command after expected result found
2021-10-27 06:57:26 -04:00
Christian Hopps
e898d2490e
Merge pull request #9862 from donaldsharp/all_protocol_retry
tests: all_protocol_startup needs some tweaks to allow for processing
2021-10-27 00:56:06 -04:00
Russ White
a2b52cbeb4
Merge pull request #9854 from opensourcerouting/zapi-call-table
*: convert zclient callbacks to table
2021-10-26 11:33:44 -04:00
Lou Berger
fd1aebbe77
Merge pull request #9840 from donaldsharp/lu_commands
tests/topotests/lib/lutil.py
2021-10-26 11:27:34 -04:00
Lou Berger
6804af739d tests: topotests/lib/lutil.py: optimize wait to not repeat command after expected result found
Signed-off-by: Lou Berger <lberger@labn.net>
2021-10-26 10:56:50 -04:00
Donald Sharp
fc0a3f8883 tests: Attempt to fix bgp_l3vpn_to_direct timing issues
The bgp_l3vpn_to_direct test is failing sometimes because
the 2.2.2.2 route is dissapearing.  What is happening?

The log file for the failed test run shows us this:

build	15-Oct-2021 07:26:12	scripts/adjacencies.py:8 WAIT:r4:ping 2.2.2.2 -c 1: 0. packet loss:wait:PE->P2 (loopback) ping:60:0.5:
build	15-Oct-2021 07:26:12	Fri Oct 15 14:26:12 2021 (#9) scripts/adjacencies.py:8 COMMAND:r4:ping 2.2.2.2 -c 1: 0. packet loss:wait:PE->P2 (loopback) ping:
build	15-Oct-2021 07:26:12	COMMAND OUTPUT:PING 2.2.2.2 (2.2.2.2) 56(84) bytes of data.
build	15-Oct-2021 07:26:12	64 bytes from 2.2.2.2: icmp_seq=1 ttl=64 time=0.143 ms
build	15-Oct-2021 07:26:12
build	15-Oct-2021 07:26:12	--- 2.2.2.2 ping statistics ---
build	15-Oct-2021 07:26:12	1 packets transmitted, 1 received, 0% packet loss, time 0ms
build	15-Oct-2021 07:26:12	rtt min/avg/max/mdev = 0.143/0.143/0.143/0.000 ms:
build	15-Oct-2021 07:26:12	Done after 1 loops, time=0.024507761001586914, Found= 0% packet loss
build	15-Oct-2021 07:26:12	Fri Oct 15 14:26:12 2021 (#9) scripts/adjacencies.py:9 COMMAND:r4:ping 2.2.2.2 -c 1: 0. packet loss:pass:PE->P2 (loopback) ping +0.02 secs:
build	15-Oct-2021 07:26:12	2021-10-15 14:26:12,446 WARNING: topolog.r4: LinuxNamespace(r4): proc failed: rc 2 pid 28826
build	15-Oct-2021 07:26:12		args: /usr/bin/nsenter -a -t 27444 -F --wd=/tmp/topotests/bgp_l3vpn_to_bgp_direct.test_bgp_l3vpn_to_bgp_direct/r4 /bin/bash -c ping 2.2.2.2 -c 1
build	15-Oct-2021 07:26:12		stdout: connect: Network is unreachable:
build	15-Oct-2021 07:26:17	COMMAND OUTPUT:connect: Network is unreachable:
build	15-Oct-2021 07:26:17	R:9    r4     PE->P2 (loopback) ping +0.02 secs                        0    1

So the 2.2.2.2 route is coming/going and is failing on these test lines:

luCommand(
    "r1", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)
luCommand(
    "r3", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)
luCommand(
    "r4", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)

So the 2.2.2.2 routes on r1,3 and 4 are received via ospf, but are
modified by some other process to add labels ( probably ldp, since
it is running too ).  The 2nd ping to 2.2.2.2 is failing because
the 2.2.2.2 route on r4 is being replaced.  As an example here
is `ip monitor all` on r4 during boot up.  Please note timestamps
are not necessarily representative of what we will see on the
loaded ci system.

[2021-10-15T15:46:52.261456] [NEXTHOP]id 27 via 10.0.2.2 dev r4-eth0 scope link proto zebra
[2021-10-15T15:46:52.261490] [ROUTE]2.2.2.2 nhid 27 via 10.0.2.2 dev r4-eth0 proto ospf metric 20
<snip>
[2021-10-15T15:46:53.556405] [NEXTHOP]Deleted id 27 via 10.0.2.2 dev r4-eth0 scope link proto zebra
<snip>
[2021-10-15T15:46:53.566575] [NEXTHOP]id 32 via 10.0.2.2 dev r4-eth0 scope link proto zebra
[2021-10-15T15:46:53.566585] [ROUTE]2.2.2.2 nhid 32 via 10.0.2.2 dev r4-eth0 proto ospf metric 20

For a small amount of time the route was *gone*.  I believe the upstream
CI system hits that window sometimes, causing the test to fail.

This patch attempts to ensure that the 2.2.2.2 route should be learned
appropriately ( thus slowing it down ) before the test moves onto
the ping.  I suspect the long term answer might be to add a test to
the scripts/adjancies.py script to ensure that the test does not
continue until the appropriate label is in place, but I want to
make the test run a bit more perscriptive in what it is looking
for here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-25 09:16:08 -04:00
Donald Sharp
f66e42011a tests: Fix accidental 10 second wait
Recent commit 83f325901a had a accidental
turn of a 1 second wait into a 10 second wait
between retries.  10 seconds is too long.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-25 08:00:23 -04:00
Martin Winter
f641623151
tests: Fix frequent failure of ospf_gr_topo1 on slower systems
Test doesn't wait long enough when it checks the routers after
restart. On slower systems, it frequently failed as it ran out
of time

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-10-25 00:53:49 +02:00
Donald Sharp
cbdf030613
Merge pull request #9670 from LabNConsulting/chopps/fix-valgrind-fail-check
Chopps/fix valgrind fail check
2021-10-24 08:30:29 -04:00
Donald Sharp
83f325901a tests: bfd_isis_topo1 expects unreasonable convergence times under load
When our ci test system is under high load, expecting bfd to converge
in under 2 seconds is not going to happen.  Modify the test suites
to just ensure that things converge.  If we need actual functional
testing of bfd response times the topotests are not an appropriate place
to do this or we need to modify the test system to gather the data for
how long it takes after the tests are run.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 15:27:50 -04:00
Donald Sharp
1430ea83da tests: Fix bgp_ecmp_topo3 to look for a bit more state
During a local CI run, bgp_ecmp_topo3 was failing
to properly notice the fast-convergence command
issued before the interface is shut down.  As
such there exists a race condition where under
high load the zebra process can actually shut
an interface down before we have properly ensured
that fast convergence is on for ibgp.

Modify the test for in two ways:

1) Ensure that previous section makes sure
that we have properly converged for when we
bring back up the interfaces instead of
assuming that we have done so.

2) After issuing the fast-convergence command.
Ensure that bgp has fully processed it and is
ready to receive the interface down events
as triggers for shutting down the ibgp session.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 14:47:49 -04:00
Donald Sharp
e5369c471b tests: Make test_ldp_topo1.py aware of how many neighbors it needs
On a local CI run.  The test_ldp_topo1.py showed fail to converge
on r3.  r3 has 2 neighbors but only 1 was up when we got to
further steps in the test suites.

Modify the neighbor checking to `know` how many neighbors
should be operational and continue looking for them until
they are up and running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 14:18:33 -04:00
Christian Hopps
a15e5ac082 tests: fix --valgrind-memleaks option
Previously, when a valgrind memleak was discovered, would cause a
catastrophic pytest failure. Now correctly fails the current pytest as
intended.

As a result of this fix --valgrind-memleaks now works in distributed
pytest mode as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-10-22 17:44:47 +00:00
Christian Hopps
1f87861ecc tests: revert default enable of memleak tests
Revert the accidental enabling of the optional memleak tests that came
with the large micronet changeset.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-10-22 17:44:47 +00:00
Christian Hopps
f24157851b tests: fix missing space in --valgrind-extra option
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-10-22 17:44:47 +00:00
Donald Sharp
9482d96e3f tests: all_protocol_startup needs some tweaks to allow for processing
The nexthop group code is installing routes and nexthop groups
and immediately expecting zebra to have processed the results
as a result there is a situation when the CI system is under
intense load that the nexthop group might not have been processed.

Add a bit of code to allow the test to give FRR some time
to finish work before declaring it not working.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 11:28:31 -04:00
Russ White
61a7ec774c
Merge pull request #9783 from mjstapp/fix_bgp_lu_lsp
bgpd, tests: BGP-labeled-unicast advertise implicit-null in more cases
2021-10-20 18:22:01 -04:00
Igor Ryzhov
e57c66d5e9 tests: relax requirements for test_static_timing
When the CI system is heavily loaded, we might see the following failures:

```
test failed at "test_config_timing/test_static_timing": assert 20.083204 <= 19.487716
```

Currently we allow each step to run 2 times slower than the initial
measurement. Let's allow them to run 3 times slower.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-21 01:04:44 +03:00
Igor Ryzhov
925d7f925b tests: fix test_static_timing route removal
On the first step, the test creates 10000 static routes. It passes 10000
to `get_ip_networks` and it generates 10000 /22 routes.

On the fourth step, the test tries to remove 5000 previously created
routes. It passes 5000 to `get_ip_networks` and here starts the problem.
Instead of generating 5000 /22 routes, it generates 5000 /21 routes. And
the whole step is a no-op, we constantly see the following logs:
```
% Refusing to remove a non-existent route
```

To consistently generate same routes, `get_ip_networks` must always use
the same prefix length.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-21 01:04:44 +03:00
David Lamparter
5a001ddd24
Merge pull request #9855 from donaldsharp/ospf_fini 2021-10-20 19:19:43 +02:00
Mark Stapp
52e458d922
Merge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap
lib: add typesafe membership-test functions
2021-10-20 08:13:17 -04:00
Donald Sharp
e9a59a2a59 tests: When heavily loaded do not send SIGBUS so fast
Our topotests send SIGBUS 2 seconds after a SIGTERM is
initiated.  This is bad because under a heavily loaded
topotest system we may have a case where the system has
not had a chance to properly shut down the daemon.
Extend the time greatly before topotests send SIGBUS.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20 08:02:10 -04:00
David Lamparter
a243d1db93 *: convert zclient callbacks to table
This removes a giant `switch { }` block from lib/zclient.c and
harmonizes all zclient callback function types to be the same (some had
a subset of the args, some had a void return, now they all have
ZAPI_CALLBACK_ARGS and int return.)

Apart from getting rid of the giant switch, this is a minor security
benefit since the function pointers are now in a `const` array, so they
can't be overwritten by e.g. heap overflows for code execution anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-20 13:28:46 +02:00
Russ White
656b3fdceb
Merge pull request #9839 from donaldsharp/test_ospf_summarization
Test ospf summarization
2021-10-19 19:17:35 -04:00
Russ White
ed131d8b74
Merge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges
ospf6d: add support for NSSA Type-7 address ranges
2021-10-19 19:15:40 -04:00
David Lamparter
a1103bd352 build: add tests missed in .gitignore
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:58:51 +02:00
David Lamparter
40ee228da9 lib: add unsorted typesafe_anywhere()
*_anywhere(item) returns whether an item is on _any_ container.  Only
available for unsorted containers for now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:55:39 +02:00
David Lamparter
f45897e45c lib: typesafe *_member()
This provides a "is this item on this list" check, which may or may not
be faster than using *_find() for the same purpose.  (If the container
has no faster way of doing it, it falls back to using *_find().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:55:39 +02:00
David Lamparter
9de36e51fe tests: fix leak in test code
Even if it doesn't matter for an unit test in general, it hides actual
leaks in the code being tested.  Fix so any leaks will be actual bugs.
(Currently there aren't any, yay.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-19 14:55:39 +02:00
Donald Sharp
6862166ed5 tests: Fix ospf_asbr_summary_topo1.py
This script is failing occassionally in our upstream topotests.
Where it was changing route-maps and attempting to see if
summarization was working correctly.  The problem was that
the code appeared to be attempting to add route-maps to
redistribution in ospf then modifying the route-maps behavior
to affect summarization as well as the metric type of that
summarization.

The problem is of course that ospf does not appear to modify
the summary routes metric-type when the components
of that summary change it's metric-type.  So the test
is testing nothing.  In addition the test had messed
up the usage of the route-map generation code and all
the generated config was in different sequence numbers
but route-map processing would never get to those
new sequence numbers because of how route-maps are processed.

Let's just remove this part of the test instead of trying
to unwind it into anything meaningfull

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-15 11:43:44 -04:00
Donald Sharp
45cfb2495f lib: Add metric-type to possible set operations
Several tests used the route_map_create functionality
with `metric-type` but never bothered to add the
backend code to ensure it works correctly.
Add it in so it can be used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-15 11:42:06 -04:00
Donatas Abraitis
9139cc723d
Merge pull request #9825 from donaldsharp/one_sleep_twice_shy
tests: BFD timing tests under system load need more leeway
2021-10-14 15:31:23 +03:00
Renato Westphal
512901ae53
Merge pull request #9822 from donaldsharp/ospf_testing
Ospf testing
2021-10-13 23:38:44 -03:00
Igor Ryzhov
1aa12de695
Merge pull request #9761 from mjstapp/fix_topo_debug_cli
tests: remove deprecated debug cli references
2021-10-14 01:48:41 +03:00
Igor Ryzhov
e0a63f1703
Merge pull request #9796 from mjstapp/fix_topo_isis_vrf_cmds
tests: in isis_topo1_vrf, only configure valid interfaces
2021-10-14 01:44:03 +03:00
Donald Sharp
f786c3ee29 tests: BFD timing tests under system load need more leeway
We have this pattern in this test:

    # Let's kill the interface on rt2 and see what happens with the RIB and BFD on rt1
    tgen.gears["rt2"].link_enable("eth-rt1", enabled=False)

    # By default BFD provides a recovery time of 900ms plus jitter, so let's wait
    # initial 2 seconds to let the CI not suffer.
    topotest.sleep(2, 'Wait for BFD down notification')

    router_compare_json_output(
        "rt1", "show ip route ospf json", "step3/show_ip_route_rt2_down.ref", 1, 0
    )

Under a heavy CI load, interface down events and then reacting to them may not actually
happen within 2 seconds.  Allow some more grace time in the test to ensure that we
react to it in an appropriate manner.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-13 14:12:51 -04:00
Russ White
c9adeefcfa
Merge pull request #9819 from donaldsharp/deprecation_python
tests: Fix `Invalid escape sequence` warnings in test runs
2021-10-13 13:55:06 -04:00
Donald Sharp
a22d51e21e tests: Convert over to using converged to test for ospf being converged
OSPF when it is deciding on whom it should elect for DR and backup
has a process that prioritizes network stabilty over the exact
same results of who is the DR / Backups.

Essentially if we have r1 ----- r2

Let's say r1 has a higher priority, but r2 comes up first, starts
sending hello packets and then decides that it is the DR.  At some
point in time in the future, r1 comes up and then connects to r2
at that point it sees that r2 has elected itself DR and it keeps
it that way.

This is by design of the system.  With our tight ospf timers as
well as high load being experienced on our test systems.  There
exists a bunch of ospf tests that we cannot guarantee that a
consistent DR will be elected for the test.  As such let's not
even pretend that we care a bunch and just look for `Full`.
If we care about `ordering` we need to spend more time getting
the tests to actually start routers, ensure that htey are up and
running in the right order so that priority can take place.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-13 12:46:22 -04:00
Donald Sharp
48f05b233f tests: Fix Invalid escape sequence warnings in test runs
Test runs are creating these warnings:
bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:7: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_linux_mpls
  <string>:19: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>:24: DeprecationWarning: invalid escape sequence \d

bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py::test_check_scale_up
  <string>:191: DeprecationWarning: invalid escape sequence \d

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

Find and destroy these warnings

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-13 09:03:27 -04:00
Donatas Abraitis
314479e114
Merge pull request #9715 from idryzhov/cleanup-number-named-acl
*: cleanup number-named access-lists in CLI
2021-10-13 10:00:43 +03:00
Russ White
0f96b7e69b
Merge pull request #9763 from ton31337/fix/more_thread_null
More struct thread null
2021-10-12 11:49:46 -04:00
Russ White
effd4c7bdd
Merge pull request #9779 from donaldsharp/gr_repeated
Some GR fixes
2021-10-12 11:00:44 -04:00
Mark Stapp
4008633d7b tests: in isis_topo1_vrf, only configure valid interfaces
Fix a loop in the setup phase of isis_topo1_vrf: only configure
interfaces that each router actually has.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-11 17:25:46 -04:00
Russ White
99497bc4ee
Merge pull request #9471 from pguibert6WIND/table_manager_alloc2
zebra: extend table manager per vrf, add vty configuration
2021-10-08 13:49:54 -04:00
Renato Westphal
10396dc55a tests: check for received Grace-LSAs on the OSPF GR topotests
Ensure GR helpers have received a Grace-LSA before killing the
ospfd/ospf6d process that is undergoing a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-08 14:38:27 -03:00
Igor Ryzhov
7e86999140 *: cleanup number-named access-lists in CLI
There's no more difference between number-named and word-named access-lists.
This commit removes separate arguments for number-named ACLs from CLI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-08 19:25:41 +03:00
Mark Stapp
74d79ead01 tests: adjust bgp_lu_topo1 for updated BGP LU
BGP LU will use implicit-null in more situations now; adjust
the original LU topotest to align with that. Node R2 uses
imp-null now, while R1 continues to allocate labels.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-08 09:11:51 -04:00
Mark Stapp
8734a29c8f tests: add bgp_lu_topo2 test suite
Add a second BGP labelled-unicast (BGP-LU) test suite, with
an additional router and some additional tests.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-08 09:11:51 -04:00
Donald Sharp
6255aad0bc tests: Fix ospf[6]_gr_topo1 tests to work better under load
2 things:

a) Each test was setting up for graceful restart with calls to
`graceful-restart prepare ip[v6] ospf`, then sleeping for
3 or 5 seconds.  Then killing the ospf process.  Under heavy
load there is no guarantee that zebra has received/processed
this signal.  Write some code to ensure that this happens

b) Tests are issuing commands in this order:
   1) issue gr prepare command
   2) kill router
   3) <ensure routes were still installed in zebra>
   4) start router
   5) <ensure routes were stil installed in zebra>

Imagine that the system is under some load and there is
a small amount of time before step 5 happens.  In this
case ospf could have come up and started neighbor relations
and also started installing routes.  If zebra receives
a new route before step 5 is issued then the route could
be in a state where it is not installed, because it is
being sent to the kernel for installation.  This would
fail the test because it would only look 1 time.  This
is fixed by giving time on restart for the routes to
be in the installed state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-08 08:35:16 -04:00
Igor Ryzhov
1c49e8138e bgpd: fix crash when using "show bgp vrf all"
Any command that uses `peer_lookup_in_view` crashes when "vrf all" is
used, because bgp is NULL in this case.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-08 11:42:13 +03:00
Donatas Abraitis
1a8e5aea78 tests: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-08 08:56:42 +03:00
Mark Stapp
c0fa628e99 tests: clean up all_proto_startup a bit
Remove references to the deprecated "CLI()" function; clean up
a couple of string escapes; make one test-case sensitive to
previous failures.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-06 13:49:52 -04:00
Mark Stapp
a1985a2dc9 tests: remove deprecated debug cli from some tests
Some tests had commented-out references to the old "CLI()"
function. Remove those so they're not confusing in the future,
and replace at least one with a comment that uses the
'mininet_cli()' function.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-06 10:51:04 -04:00
Mobashshera Rasool
0d16f9d824 tests: Modify the script to verify the hello stats increment
Co-authored-by: Vijay Gupta <vijayg@vmware.com>
Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-10-06 07:34:58 -07:00
Donald Sharp
11ed589224
Merge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv
topotests: improve bfd_ospf_topo1 test
2021-10-06 06:40:36 -04:00
Renato Westphal
343e16cec5 tests: extend topotest to test NSSA ranges
Test NSSA address ranges, including the "cost" and "not-advertise"
options.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Renato Westphal
cb81dd25e5 tests: update ospf6_topo2's ospf6d configs
* Add new debug directives for NSSA LSAs;
* Remove the "debug ospf6 gr helper" command since it doesn't make
  sense for this test (not to mention it was renamed to "debug ospf6
  graceful-restart");
* Migrate to the new interface-level command to enable OSPFv3 on
  interfaces ("interface WORD area A.B.C.D" was deprecated).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-10-05 21:25:55 -03:00
Rafael Zalamena
2d28cbe661 topotests: justify code sleep
Document the `sleep` statement so people know that we are sleeping
because we are waiting for the BFD down notification. If we don't
sleep here it is possible that we get outdated `show` command results.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:41:33 -03:00
Rafael Zalamena
8ff24fd29e topotests: decrease result check frequency
Call the `show` commands less often to reduce the CPU pressure.

Also increase the wait time from 60 to 80 seconds to have spare room
for failures (4 times more). This is the latest measure wait time:

> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:40:14 -03:00
Rafael Zalamena
a6ce07852c topotests: increase OSPF convergence speed
Reduce timers so we send hello packets more often and reduce dead
interval to converge faster.

Previous test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 47.20 seconds

New test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-10-05 12:38:40 -03:00
Donatas Abraitis
feabd51dae tests: Do not explicitly set the thread pointer to NULL
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-04 19:29:06 +03:00
Mark Stapp
f89211f7c9 tests: fix log string in topotests/lib/bgprib.py
Correct a log string in a method in bgprib.py - cut-and-paste
error, maybe?

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-01 08:06:35 -04:00
Igor Ryzhov
ac32b03f98
Merge pull request #9694 from mjstapp/fix_topo_pim_cmp
tests: fix string comparison in lib/pim.py
2021-09-30 12:40:55 +03:00
Mark Stapp
94e8feaa9f tests: fix string comparison in lib/pim.py
Use correct string comparison syntax in lib/pim.py

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-09-29 11:49:43 -04:00
David Lamparter
a89bae26f7
Merge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages
frrmod_load(): fix error messages
2021-09-29 14:35:35 +02:00
Lou Berger
1b9ebabb27 tests: get bgp_l3vpn_to_bgp_vrf running, also improve logging
Signed-off-by: Lou Berger <lberger@labn.net>
2021-09-28 11:29:46 -04:00
Russ White
b8beb67ef5
Merge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate
ospf6d: add a knob to generate Type-7 default routes
2021-09-24 13:42:49 -04:00
Donald Sharp
e39ea73486
Merge pull request #9647 from opensourcerouting/ospf-gr-cmd-rename
ospfd, ospf6d: rename the "graceful-restart helper-only" command
2021-09-22 14:53:40 -04:00
Donald Sharp
86b2043033
Merge pull request #9646 from LabNConsulting/ziemba/skiplist-level-counters-int
lib: skiplist: clean up level counter implementation
2021-09-22 07:21:14 -04:00
G. Paul Ziemba
c324b10f28 lib: skiplist: clean up level counter implementation
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-09-21 17:03:53 -07:00
Renato Westphal
6735622c24 ospf6d: implement Type-7 default routes for NSSA areas
Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:47:13 -03:00
Renato Westphal
210429c747 ospf6d: don't generate Type-7 LSA for route created by "default-information-originate"
The route created by the "default-information-originate" command
isn't a regular external route. As such, an NSSA ABR shouldn't
originate a corresponding Type-7 LSA for it (there's a separate
configuration knob to generate Type-7 default routes).

While here, fix a small issue in ospf6_asbr_redistribute_add()
where routes created by "default-information-originate" were being
displayed with an incorrect "unknown" type.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:43:45 -03:00
Renato Westphal
242a9767f7 ospf6d: fix metric type of NSSA Type-7 LSAs
Fix wrong comparison since route->path.metric_type is always set
to either 1 or 2. The OSPF6_PATH_TYPE_EXTERNAL2 constant, whose
value is 4, refers to a route type so its usage was incorrect here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:43:45 -03:00
Renato Westphal
859bce816b ospfd: rename the "graceful-restart helper-only" command
Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Start a deprecation cycle of one year before removing the original
command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 17:42:03 -03:00
Philippe Guibert
42d4b30e00 zebra: extend table manager per vrf, add vty configuration
Because vrf backend may be based on namespaces, each vrf can
use in the [16-(2^32-1)] range table identifier for daemons that
request it. Extend the table manager to be hosted by vrf.

That possibility is disabled in the case the vrf backend is vrflite.
In that case, all vrf context use the same table manager instance.

Add a configuration command to be able to configure the wished
range of tables to use. This is a solution that permits to give
chunks to bgp daemon when it works with bgp flowspec entries and
wants to use specific iptables that do not override vrf tables.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-09-21 18:37:30 +02:00
Russ White
2075387e77
Merge pull request #9546 from proelbtn/add-support-for-perfix-sid-type-5
Add support for Prefix-SID (Type 5)
2021-09-21 11:36:53 -04:00
Renato Westphal
6b513b4c92 ospf6d: rename the "graceful-restart helper-only" command
Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-21 11:51:36 -03:00
Renato Westphal
f4f0098ca0 ospf6d: rework filtering commands to be in line with ospfd
Issue #9535 describes how the export-list/import-list commands work
differently on ospfd and ospf6d.

In short:
* On ospfd, "area A.B.C.D export-list" filters which internal
  routes an ABR exports to other areas. On ospf6d, instead, that
  command filters which inter-area routes an ABR exports to the
  configured area (which is quite counter-intuitive). In other words,
  both commands do the same but in opposite directions.
* On ospfd, "area A.B.C.D import-list" filters which inter-area
  routes an ABR imports into the configured area. On ospf6d, that
  command filters which inter-area routes an interior router accepts.
* On both daemons, "area A.B.C.D filter-list prefix NAME <in|out>"
  works exactly the same as import/export lists, but using prefix-lists
  instead of ACLs.

The inconsistency on how those commands work is undesirable. This
PR proposes to adapt the ospf6d commands to behave like they do
in ospfd.

These changes are obviously backward incompatible and this PR doesn't
propose any mitigation strategy other than warning users about the
changes in the next release notes. Since these ospf6d commands are
undocumented and work in such a peculiar way, it's unlikely many
users will be affected (if any at all).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-20 13:06:35 -03:00
Russ White
88dde69cb6
Merge pull request #9632 from donaldsharp/no_forced_wait
tests: Do not do a initial_timeout of 2 seconds for verify_bgp_rib
2021-09-17 12:22:36 -04:00
Russ White
ca45d9e5bf
Merge pull request #8985 from opensourcerouting/ospf6d-gr
ospf6d: introduce support for Graceful Restart (restarting mode)
2021-09-17 12:22:07 -04:00
Jafar Al-Gharaibeh
7c3ea1c424
Merge pull request #9619 from AnuradhaKaruppiah/lttng-updates
lttng build updates
2021-09-16 14:55:43 -05:00
Donald Sharp
4367df1575 tests: Do not do a initial_timeout of 2 seconds for verify_bgp_rib
A bunch of tests have this pattern:

a) Install a new prefix into bgp
b) Run this loop:
foreach (router in topology) {
	verify_bgp_rib(router)
}

This is to ensure that the prefix is actually disseminated.
The problem with this, of course, is that a wait of 2 seconds
for every item in that loop makes no sense.  As that the initial
router verification of it's bgp rib will wait 2 seconds and
all the remaining bgp routers in the topology will have gotten
the data.  So we end up waiting a bunch of extra time.

Remove the initial_wait time for verify_bgp_rib.  Also
increase the failure wait time to 30 seconds.  This is
to give a bigger window for bgp to send it's data for
our test systems that could be under heavy load.  In the
normal case tests will never hit this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-16 15:12:13 -04:00
Renato Westphal
b1c1004fb9 tests: add OSPFv3 graceful restart topotest
Add a new topotest that features a topology with seven routers spread
across four OSPF areas:
* 1 backbone area;
* 1 regular non-backbone area (0.0.0.1);
* 1 stub area (0.0.0.2);
* 1 NSSA area (0.0.0.3).

All routers have both GR and GR helper functionality enabled in
the configuration. The test consists of restarting each router,
one at time, and checking that all forwarding planes (and LSDBs)
are kept intact during those restarts.

A successful run takes about three minutes to finish.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-16 12:26:48 -03:00
Donald Sharp
6aed8082b6 tests: Fix make check builds on some bsd variants
Compilation is warning that a memcpy is only copying
the first (sizeof pointer) into memory.  This is not
what we really want.  Although it does beg the question about
why this memcpy is needed( or what it is doing ).  I'm going
to just fix the memcpy and call it a day.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-15 21:10:24 -04:00
Donald Sharp
827ddd5a1d
Merge pull request #9596 from LabNConsulting/ziemba/printfrr-nexthop
printfrr %pNHcg, %pNHci
2021-09-15 20:23:30 -04:00
Anuradha Karuppiah
c038cddff8 tests: include lttng libs in the bgp tests build
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-09-15 11:22:08 -07:00
G. Paul Ziemba
016cfe701e lib,doc,tests: printfrr %pNHcg, %pNHci
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-09-14 10:06:57 -07:00
G. Paul Ziemba
52fad8f656 lib/module.c and callers of frrmod_load(): fix error messages
frrmod_load() attempts to dlopen() several possible paths
    (constructed from its basename argument) until one succeeds.

    Each dlopen() attempt may fail for a different reason, and
    the important one might not be the last one. Example:

	dlopen(a/foo): file not found
	dlopen(b/foo): symbol "bar" missing
	dlopen(c/foo): file not found

    Previous code reported only the most recent error. Now frrmod_load()
    describes each dlopen() failure.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-09-14 09:51:49 -07:00
Igor Ryzhov
b8c01bba53
Merge pull request #9486 from slankdev/slankdev-srv6-no-cli-1
CLI to delete SRv6 locator
2021-09-14 19:04:03 +03:00
Hiroki Shirokura
d4a94e93e5 topotests: bgp_srv6l3vpn_to_bgp_vrf bgp locator unset test case
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-13 23:32:09 +00:00
Christian Hopps
3a1ef6784f
Merge pull request #9589 from donaldsharp/route_scale_cleanup
tests: Break up route_scale into 2 separate tests
2021-09-13 14:12:27 -04:00
Donald Sharp
0b4c566b1c
Merge pull request #9587 from opensourcerouting/all-proto-test-fix
tests: Fix BGP check in all_protocol_startup
2021-09-13 13:57:49 -04:00
Igor Ryzhov
fa1b629254
Merge pull request #9543 from donaldsharp/actually_set_mpls_data
tests: Fix wrong setting of mpls being turned on
2021-09-13 19:31:53 +03:00
Donald Sharp
2d0d440a2b
Merge pull request #9600 from kuldeepkash/cut_execution_time
tests: Optimize test_multicast_pim_sm_topo1.py execution time
2021-09-13 08:35:08 -04:00
Donald Sharp
2fdfc842f8
Merge pull request #9571 from LabNConsulting/chopps/impr-zeb-netlink
tests: increase wait and update test
2021-09-13 08:32:54 -04:00
Igor Ryzhov
4731dc4518
Merge pull request #9599 from Enigamict/fixtypo
tests: fix typo in zebra.conf
2021-09-13 13:41:15 +03:00
Donatas Abraitis
7d18da9671
Merge pull request #9586 from idryzhov/bgp-default-originate-rmap-fixes
BGP default-originate with route-map fixes
2021-09-12 20:50:36 +03:00
Donatas Abraitis
0f64a435db
Merge pull request #9475 from iqras23/change1
bgpd: VRF-Lite fix nexthop type
2021-09-12 20:47:18 +03:00
Kuldeep Kashyap
77e7e50ea6 tests: Optimize test_multicast_pim_sm_topo1.py
1. Optimized test: test_clear_pim_neighbors_and_mroute_p0 run time by clearing
mroute and verifying mroutes separately. Execution time is reduced from almots 10 mins
to ~220 sec.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-09-12 16:34:09 +05:30
enigamict
eaa4bbc353 tests: fix typo in zebra.conf
Signed-off-by: enigamict <mochienper@gmail.com>
2021-09-11 20:33:12 +09:00
Russ White
5bdc0346dc
Merge pull request #9594 from donaldsharp/strict_prototypes
Strict prototypes
2021-09-10 14:23:49 -04:00
Donald Sharp
0d39b8f2f0
Merge pull request #9573 from LabNConsulting/chopps/update-template
tests: update the test template and doc
2021-09-10 10:49:00 -04:00
Donald Sharp
ac60528b5c tests: Break up route_scale into 2 separate tests
route_scale run is 500+ seconds.  Break it up into
2 separate tests.  This should reduce run time a slight
bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-10 08:27:49 -04:00
Quentin Young
32acb4a7ad
Merge pull request #9497 from opensourcerouting/cli-better-no 2021-09-09 12:22:53 -04:00
Donald Sharp
9b8a1ad49e tests: We follow strict prototyping rules
Compiling with -Wstrict-prototypes is causing some complaints
during compiling. Make things happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-09 06:33:12 -04:00
Martin Winter
87980f1311
tests: Fix BGP check in all_protocol_startup
Fix issue of topotest failures with BGP status Connect or Idle
instead of the expected Active

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-09-09 02:31:13 +02:00
Igor Ryzhov
68d4b72ff3 tests: add one more check for default-originate with route-map
Make sure that we don't set communities from a random RIB route when
originating the default route.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-08 23:37:50 +03:00
Christian Hopps
1375385adf
tests: increase wait and update test
Modernize the test a bit, generate expected results rather than load from
file, and add a general json_cmp with retry function and use it.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-08 15:25:52 -04:00
Donald Sharp
930d7c4921
Merge pull request #9582 from LabNConsulting/chopps/fix-xterm-windows
tests: fix xterm windows for topotests, better errors
2021-09-08 13:57:39 -04:00
Christian Hopps
9b6f04c07c tests: update the test template and doc
- Update the template and documentation to use newer pytest fixutres for
setup and teardown, as well as skipping tests when the suite fails.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-08 13:09:41 -04:00
Mark Stapp
75ec7bdb5d
Merge pull request #9572 from LabNConsulting/chopps/fix-cleanup
tests: deal with parallel exit of process we are reaping
2021-09-08 12:26:51 -04:00
Donald Sharp
4fcda740dc
Merge pull request #9566 from LabNConsulting/chopps/easy-fancy-json-setup
tests: new improved simple JSON template w/ doc update
2021-09-08 11:29:52 -04:00
Donald Sharp
b041a12749 tests: Set mask to a default value for addKernelRoute
When looking for a implied host route it is not necessary
to add the `/32` to an ip route add.  As such masks
will not be set in this case.  Set the value of masks
to a known good value so that when the route installation
fails the test for it actually being there will tell you
that the route is not there -vs- complaining about mask
being uninited.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-08 07:53:04 -04:00
Donald Sharp
51eb2eef3c tests: Remove unneeded calls to addKernelRoutes
There is no need to add calls to addKernelRoutes for
groups.  They do not need to be routed via the
normal kernel methodology.

Tests run successfully with this change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-08 07:53:04 -04:00
Christian Hopps
1726edc301
tests: fix xterm windows for topotests, better errors
- Fix xterm support to work, previously it mostly didn't, not it should
in all cases (i.e., single or dist mode).

- Catch when the user tries to use various window requiring topotests
features (e.g., --cli-on-error) but isn't running under supported
system (e.g., byobu/tmux/xterm), and fail the run with an explanation.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-07 15:50:59 -04:00
Renato Westphal
fee16c7ef3 tests: extend the ospf6_topo2 to test totally stub NSSAs
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-09-07 11:43:36 -03:00
Hiroki Shirokura
6d39d7c0dd topotests: bgp_srv6l3vpn_to_bgp_vrf locator update test case
If the SRv6 locator is deleted in zebra, zclient(bgpd)
which allocates SIDs from the locator will update the
RIBs which use those SIDs and make them invalid.
This will cause the VPNv6 route to be withdrawn and
the VPN to stop.

If the SRv6 locator is added again, zclient(bgpd) will
allocate the SIDs from the locator again, and VPNv6
will be re-established.

This commit add a test case to confirm this.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 12:54:39 +00:00
Hiroki Shirokura
9529336a22 topotests: refactor bgp_srv6l3vpn_to_bgp_vrf
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 12:54:39 +00:00
Hiroki Shirokura
e08c56634c topotests: update test cases about srv6 locator deletion
Before this PR, in case of get locator chunk zapi from
zclient, zebra precreated a down state locator and set
the chunk ownership. After this PR, this is no longer
done, and chunks are no longer automatically generated.

In this commit, we will make a test update to check the
corresponding detailed behavior.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 12:54:39 +00:00
Kantesh Mundaragi
0789eb69e5 bgpd: VRF-Lite fix nexthop type
Description:
Change is intended for fixing the following issues related to vrf route leaking:

Routes with special nexthops i.e. blackhole/sink routes when imported,
are not programmed into the FIB and corresponding nexthop is set as 'inactive',
nexthop interface as 'unknown'.

While importing/leaking routes between VRFs, in case of special nexthop(ipv4/ipv6)
once bgp announces route(s) to zebra, nexthop type is incorrectly set as
NEXTHOP_TYPE_IPV6_IFINDEX/NEXTHOP_TYPE_IFINDEX
i.e. directly connected even though we are not able to resolve through an interface.
This leads to nexthop_active_check marking nexthop !NEXTHOP_FLAG_ACTIVE.
Unable to find the active nexthop(s), route is not programmed into the FIB.

Whenever BGP leaks routes, set the correct nexthop type, so that route gets resolved
and correctly programmed into the FIB, in the imported vrf.

Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2021-09-07 01:50:06 -07:00
Hiroki Shirokura
c84159a90a topotests: update file format and resolving id
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 07:07:18 +00:00
Hiroki Shirokura
e03862c34a topotests: to create pid file of topotest router
Create a pid file for the router created by topotest.
By executing nsenter directly against this pid, developers
can execute commands directly from outside the unet shell.
This allows the developer to use script, tab completion, etc.,
and improves efficiency.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-09-07 03:55:04 +00:00
Christian Hopps
20b31fffc1 tests: deal with parallel exit of process we are reaping
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-06 16:54:36 -04:00
Christian Hopps
0254774578 tests: refactor parallel reset/load config for non-json
Refactor the bgp_auth test to create common_config code to allow
non-json based tests to reset routers and load configs in parallel.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-06 11:18:48 -04:00
Christian Hopps
b668944766
tests: speed up bgp_auth test (24m -> 12m)
- Reduce OSPF timers to 1 and 4
- Reduce BGP connect timer to 5
- Apply configs in parallel as single file
- Remove the switches as all links are p2p, perhaps this will help with
  reliability?

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-05 05:41:04 -04:00
Christian Hopps
36c1949730
tests: new improved simple JSON template w/ doc update
Utilizes new pytest fixtures to completely factor out setup and teardown
functionality. Supply the JSON config and write your tests.

"The best topotest template yet!"

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-05 02:45:13 -04:00
Christian Hopps
a53c08bc13 tests: cleanup: rerun changed files through black
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
4953ca977f tests: cleanup - remove unused imports
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
57f774f56d tests: Disable test which fails under micronet
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
f862fe55a4 tests: use common exa-receive.py script
New generic script uses a new default node specific log dir to avoid
collisions when running in parallel.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
2905398814 tests: add generic exa-receive.py script
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Martin Winter
62c608a9fb tests: Make bgp_multiview_topo1 predictable
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-09-04 09:04:47 -04:00
Christian Hopps
0ce28e746e tests: remove unneeded mcast group kernel routes and sysctl
- The PIM tests do not need kernel routes to help them bind joins and
sources to specific interfaces. They should do that themselves directly.
Also do not change system wide "rp_filter" sysctl away from the value
required by everyone else.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
784ad2307e tests: add back a 10 second delay to see if this fixes the failures
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
04464749b6 tests: keep revisions of configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
1973df1d39 tests: use new helper object for mcast-tester and iperf
- Decrease igmp query interval to fix pim test run times

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
a5124c49d3 tests: add helper object for mcast-tester and iperf tool.
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
86dc61d1b2 tests: remove legacy Topo class from micronet
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
fe50239bc6 tests: remove legacy Topo class from infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:47 -04:00
Christian Hopps
e82b531df9 tests: remove legacy Topo class (fixes many pylint errors)
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
d7d21c3a19 tests: fix pylint test errors
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
c8e5983d8e tests: fix pylint infra errors
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
351bc82cac tests: micronet: update defaults for results+logging
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
8db751b853 tests: micronet: adapt tests
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
4958158787 tests: micronet: update infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:46 -04:00
Christian Hopps
6a5433ef0b tests: NEW micronet replacement for mininet
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 09:04:21 -04:00
Christian Hopps
bc51ce6810 tests: improve vxlan test determinism
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 04:47:20 -04:00
Christian Hopps
49549fe2d7 tests: summarize XML test results
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-04 04:47:20 -04:00
Donatas Abraitis
cb747ed90b tests: Check if disable-addpath-rx knob works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-09-03 15:05:03 +03:00
Ryoga Saito
b69210fa1b tests: update bgp_srv6l3vpn_to_bgp_vrf
SID allocation is changed, so there is need to update topotest

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
2021-09-03 01:19:49 +00:00
Donald Sharp
131de270dc tests: Fix wrong setting of mpls being turned on
There were some tests where we were turning on mpls on
interface names that don't exist for certain `machines`
in the topology.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-02 11:29:35 -04:00
Donald Sharp
f94825578a
Merge pull request #9443 from opensourcerouting/topo-multiview-fix
tests: Make bgp_multiview_topo1 predictable
2021-09-01 18:27:06 -04:00
Russ White
8811ce0beb
Merge pull request #9469 from ton31337/fix/extcommunity_bandwidth_floating_to_hex
bgpd: Use IEEE-754 Floating Point for storing extcommunity bandwidth
2021-09-01 12:56:45 -04:00
Russ White
ce4f3813f0
Merge pull request #9439 from ton31337/feature/set_ext_community_to_none
bgpd: Route-map `set extcommunity none`
2021-09-01 12:55:45 -04:00
Christian Hopps
e99b4bd6ba tests: add global BGP json config for [re]connect timer
- Fix the syntax.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-09-01 03:49:53 -04:00
Donatas Abraitis
e5fbfe01ae
Merge pull request #9318 from Prerana-GB/ibgp_knob
bgp: BGP knob for faster convergence of bgp sessions
2021-09-01 10:45:27 +03:00
Donatas Abraitis
419db184af
Merge pull request #9397 from tkms1122/master
bgpd: minimum-holdtime knob to prevent session establishment with BGP peer with low holdtime.
2021-09-01 10:33:59 +03:00
Christian Hopps
f5136f6397 tests: log bgp nbr changes, and allow config of connect timer
- Allow tests to also change the connect timer as they can for the
keep-alive and holddown timers.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-31 09:45:11 -04:00
Donatas Abraitis
589e9f8fb7 tests: Test if IEEE floating-point encoding for bw works with older format
Just check if backward-compatibility works fine between uint32 / IEEE encodings.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-31 11:10:06 +03:00
Mark Stapp
032d1a65ff
Merge pull request #8964 from LabNConsulting/chopps/config-faster
tests: configure/reset routers in parallel
2021-08-30 08:56:43 -04:00
Donatas Abraitis
27aa23a43b bgpd: Add neighbor PEER link-bw-encoding-ieee
This is to avoid breaking changes between existing deployments of
extended community for bandwidth encoding. By default FRR uses uint32
to encode bandwidth, which is not as the draft requires (IEEE floating-point).

This switch enables the required encoding per-peer.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-30 14:21:49 +03:00
Quentin Young
180100985d
Merge pull request #9511 from LabNConsulting/chopps/ospf-asbr-test-fix
tests: fix ospf ASBR summary test
2021-08-29 22:54:49 -04:00
Russ White
26bf593efb
Merge pull request #9503 from opensourcerouting/ospf6d-redistribute-metrics
ospf6d: extend the "redistribute" command with more options
2021-08-28 09:20:44 -04:00
Russ White
57740d8134
Merge pull request #9499 from gsol10/bogus_lsp
isisd: Fix sending of LSP with null seqno
2021-08-27 19:04:29 -04:00
Christian Hopps
0779f17742
tests: fix ospf ASBR summary test
Previously the check did nothing as the input_dict parameter was wrong.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-27 14:46:20 -04:00
Christian Hopps
4f99894dd0 tests: configure routers in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-26 20:49:27 -04:00
Christian Hopps
b86955a635 tests: improve bgp test determinism by resetting configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-26 20:49:27 -04:00
David Lamparter
90c8406c20 lib: add ![...] syntax for easy "no" forms
This allows defining a CLI command like this:
  `[no] some setting ![VALUE]`
with VALUE being optional for the "no" form, but required for the
positive form.  It's just a `[...]` where the empty branch can only be
taken for commands starting with `no`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-08-26 21:03:44 +02:00
Renato Westphal
476e957517 ospf6d: extend the "redistribute" command with more options
Add the "metric" and "metric-type" options to the "redistribute"
command.

This is a small commit since the logic of setting the metric
value and type of external routes was already present due to the
implementation of the "default-information originate" command months
ago. This commit merely extends the "redistribute" command to
leverage that functionality.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-26 15:05:53 -03:00
Christian Hopps
d448e2c5f9
Merge pull request #9331 from idryzhov/explicit-exit
*: explicitly print "exit" at the end of every node config
2021-08-26 11:57:33 -04:00
Guillaume Solignac
9482949688 isisd: Fix sending of LSP with null seqno
Check sequence number when building LSP missing in received CSNP

Signed-off-by: Guillaume Solignac <gsoligna@protonmail.com>
2021-08-26 12:06:29 +02:00
Russ White
ddcd8ec538
Merge pull request #9467 from gpnaveen/bgp_v4overv6
tests: adding 11 bgp v4 over v6 test cases.
2021-08-25 17:14:10 -04:00
Igor Ryzhov
bf41d65ebe
Merge pull request #9449 from opensourcerouting/ospf6d-nssa-fixes
ospf6d: NSSA fixes
2021-08-24 22:34:29 +03:00
Renato Westphal
6c4892c083 tests: enable more debugs in the ospf6_topo2 topotest
Enable more debugs to facilitate troubleshooting whenever a problem
happens.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 11:53:36 -03:00
Renato Westphal
5dec72e1a0
Merge pull request #7876 from gpnaveen/ospf_gr_helper_using_scapy
tests: ospf gr helper topotests with scapy.
2021-08-24 11:42:49 -03:00
Russ White
d147c287db
Merge pull request #8729 from gpnaveen/ospf_route_maps
tests: ospf routemap basic test cases 2.
2021-08-24 09:13:57 -04:00
Prerana GB
57ea19204c topotests: Topotest changes for new bgp fast convergence knob
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-08-24 12:23:41 +00:00
nguggarigoud
cc90defcb6 tests: ospf gr helper topotests with scapy.
Testing ospf gr helper using scapy tool.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-08-23 21:42:09 -07:00
Renato Westphal
6df89791ba ospf6d: remove incorrect debug guard
Also, update the ospf6_topo2 topotest since the expected output
was wrong. With this fix, NSSA routes will be created on r2
("redistribute connected"), and NSSA routes appear in the routing
table as regular external routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-08-24 00:39:56 -03:00
Christian Hopps
e83c0fb125 tests: use correct key for deleting entry.
OSPF mixes uses of "delete" and "del_action" depending on which library
function is called. It's a bug-prone mess that needs fixing; however, for
now we fix the one obvious incorrect use in this test.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-23 21:42:20 -04:00
nguggarigoud
d43837e6be tests: ospf routemap basic test cases 2.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-08-23 17:34:33 -07:00
nguggarigoud
9e3bab5f1a tests: adding 11 bgp v4 over v6 test cases.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-08-23 17:20:24 -07:00
Igor Ryzhov
07679ad98a *: explicitly print "exit" at the end of every node config
There is a possibility that the same line can be matched as a command in
some node and its parent node. In this case, when reading the config,
this line is always executed as a command of the child node.

For example, with the following config:
```
router ospf
 network 193.168.0.0/16 area 0
!
mpls ldp
 discovery hello interval 111
!
```
Line `mpls ldp` is processed as command `mpls ldp-sync` inside the
`router ospf` node. This leads to a complete loss of `mpls ldp` node
configuration.

To eliminate this issue and all possible similar issues, let's print an
explicit "exit" at the end of every node config.

This commit also changes indentation for a couple of existing exit
commands so that all existing commands are on the same level as their
corresponding node-entering commands.

Fixes #9206.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-23 22:08:20 +03:00
David Lamparter
4f2ac850af
Merge pull request #9455 from LabNConsulting/chopps/fix-zebtest-fixed-sleep
tests: use std polling for results in zebra_rib test
2021-08-22 20:35:29 +02:00
Christian Hopps
b604f58641 tests: use std polling for results in zebra_rib test
In particular, the fixed 2 second sleep here was not long enough.
Switch to standard run_and_expect polling to make test more robust.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-21 13:44:48 -04:00
Donald Sharp
3c9fb01d26
Merge pull request #9453 from LabNConsulting/chopps/fix-netns-vrfs
tests: uniq vrf names when using netns
2021-08-21 12:24:42 -04:00
Christian Hopps
6a95bfc8b0 tests: uniq vrf names when using netns
- In order to run tests in parallel the netns-based vrfs need to
have unique names primarily bc they are all tracked/looked-up in
`/run/netns` which is not network namespace nesting friendly

- use ip(8) exclusively rather than a mix of `ip` and `ifconfig`
and `vconfig`, reducing required pkg count by a couple.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-21 06:13:52 -04:00
Donald Sharp
fc69721913
Merge pull request #9450 from LabNConsulting/chopps/fix-bgp-gr-test
tests: fix broken bgp GR test (non-deterministic)
2021-08-20 16:18:19 -04:00
Martin Winter
6ca120470d
tests: Change bgp_multiview_topo1 to json output
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-08-20 18:26:40 +02:00
Christian Hopps
8d2e57fe28 tests: fix broken bgp GR test (non-deterministic)
- bugs in the support library function `verify_gr_address_family`
allowed this test to pass depending on ordering of python dictinoary
keys. Fix the bugs, fix the test.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-20 08:24:23 -04:00
Ryoga Saito
2dc1fa1322 tests: update bgp_prefix_sid2
exabgp's config in bgp_prefix_sid2 is also missing header, so added

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
2021-08-20 09:01:27 +00:00
Christian Hopps
e09755b8f8 tests: reduce multicast timer values
- completes change made in #9190
- also lowers other pim and igmp timer values to speed things up.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-19 00:28:35 -04:00
Christian Hopps
0a76e764c8 tests: Add global pim join-prune-interval json config option
- cleanup pim configuration code

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-19 00:28:35 -04:00
Martin Winter
5b78215b28
tests: Make bgp_multiview_topo1 predictable
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-08-19 00:01:04 +02:00
Donatas Abraitis
bd941b7a6f tests: Test if set extcommunity none works for route-maps
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-18 14:14:52 +03:00
Igor Ryzhov
54a95babff
Merge pull request #9391 from mougams/master
tests: add feature to not run ospfd test when opted out
2021-08-16 11:54:55 +03:00
Donatas Abraitis
7fedbefb87 tests: Get rid off - for directories
Related: http://docs.frrouting.org/projects/dev-guide/en/latest/topotests.html

Directory name for a new topotest must not contain hyphen (-) characters.
To separate words, use underscores (_). For example, tests/topotests/bgp_new_example.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-15 11:12:56 +03:00
Takemasa Imada
b042667a3d bgpd: minimum-holdtime knob to prevent session establishment with BGP peer with low holdtime.
Signed-off-by: Takemasa Imada <takemasa.imada@gmail.com>
2021-08-15 06:08:08 +09:00
Basha Mougamadou
34a2283431 tests: add feature to not run ospfd test when opted out
Signed-off-by: Basha Mougamadou <b.mougamadou@criteo.com>
2021-08-13 11:38:38 +02:00
Donald Sharp
bde0fd77d9
Merge pull request #9348 from dlqs/consecutive
lib: lua: consecutive script calls
2021-08-10 10:11:35 -04:00
Donatas Abraitis
947a27f5ae tests: Make sure BGP filters by community lists work with community alias
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-10 09:46:16 +03:00
Donald Lee
80bfe93670 tests: Add test consecutive frrscript_call
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-08-10 07:28:39 +08:00
Christian Hopps
2e062fff45
Merge pull request #9312 from opensourcerouting/topo-small-fixes
topotests: small fixes for two tests
2021-08-06 13:34:52 -04:00
Donald Sharp
883da9f5ec
Merge pull request #9256 from idryzhov/dampening-revert
BGP per-peer dampening revert
2021-08-06 10:46:09 -04:00
Donald Sharp
2f958e5562
Merge pull request #9280 from idryzhov/bgp-nb-revert-master
BGP NB revert
2021-08-06 10:45:59 -04:00
Rafael Zalamena
e17e248b2a topotests: reduce convergence check frequency
Check for convergence less frequently to reduce resources usage.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-08-06 10:38:41 -03:00
Rafael Zalamena
4000805713 topotests: skip daemons without configuration
Lets not start daemons without configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-08-06 10:38:36 -03:00
Rafael Zalamena
20ec1f7038 topotests: remove code that checks for version
We version the tests with FRR so we no longer need to check for version.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-08-06 10:38:25 -03:00
Rafael Zalamena
0a5b9d7158 topotests: use new OSPFv3 interface area syntax
The old one is not VRF aware and is being deprecated.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-08-06 10:38:17 -03:00
Rafael Zalamena
582bf957fd topotests: reduce MSDP topology
Meanwhile we don't get all MSDP features (MSDP route validation via BGP
AS Path as described in RFC 4611 Section 2), kill one of the links of
the topology to avoid intermittent test failures due to different
traffic route.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-08-06 10:35:45 -03:00
Mark Stapp
5f10f7804f
Merge pull request #9050 from LabNConsulting/chopps/reset-parallel
Chopps/reset parallel
2021-08-04 16:17:30 -04:00
Mark Stapp
27649e64f2
Merge pull request #9291 from donaldsharp/fix_long_sleep
tests: Remove sleep(200) from bgp-evpn-overlay-index-gateway
2021-08-04 12:54:25 -04:00
Donald Sharp
22e135b451
Merge pull request #8182 from mjstapp/topotest_start_tgen
tests: make the topogen object available when starting daemons
2021-08-04 08:48:06 -04:00
Donald Sharp
1c7cad9be8 tests: Remove sleep(200) from bgp-evpn-overlay-index-gateway
Remove a 200 second sleep from bgp-evpn-overlay-index-gateway.
There does not seem to be any evidence that this is needed
and I cannot make the test fail without it.

Fixes: #9035
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-04 08:05:12 -04:00
Igor Ryzhov
7548eaefad Revert "tests/bgpd: initialized candidate_config to vtysh"
This reverts commit 64fb3f8666.
2021-08-03 23:36:31 +03:00
Igor Ryzhov
5da71ba93d Revert "tests: add bgp yang module registery to attr test"
This reverts commit 15cbc38206.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-03 23:36:31 +03:00
Igor Ryzhov
c499bf64d0 Revert "tests: topotests for route-flap dampening"
This reverts commit cd32a1a4ee.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-03 21:54:47 +03:00
Russ White
26d7f8b285
Merge pull request #9249 from ton31337/fix/dont_capability
bgpd: Use strict AS4 capability when processing parsing/generating pkts
2021-08-03 09:14:27 -04:00
Christian Hopps
35c4c991f0 tests: reset router configs in parallel
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-03 09:07:49 +00:00
Christian Hopps
269a822be4 tests: dump the actual json values to log
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-08-03 09:07:49 +00:00
Quentin Young
41d3d77496
Merge pull request #8982 from dlqs/lua-func-stack 2021-08-02 13:51:35 +00:00
Donatas Abraitis
ecec984b2f tests: Check if BGP connection established if using no capabilities adv
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-01 09:58:26 +03:00
Christian Hopps
845b234a8d tests: add early interface config for topojson and fix test
- A more general fix for the bgp listener test which requires interfaces be
configured in the kernel when the bgpd daemons are launched.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-31 14:09:24 +00:00
David Lamparter
00908959ed
Merge pull request #9228 from LabNConsulting/chopps/scapy-sendpkt
tests: add scapy_sendpkt.py util, replace arping use with it
2021-07-31 12:09:40 +02:00
Christian Hopps
002e6825c1 tests: add scapy_sendpkt.py util, replace arping use with it
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-30 21:01:22 +00:00
Donatas Abraitis
8c834868dc
Merge pull request #9196 from donaldsharp/test_queued
tests: Increase timeout for loaded systems
2021-07-30 18:05:45 +03:00
Russ White
e448fefbb4
Merge pull request #9028 from mobash-rasool/ospfv3-asbr-summarisation
Ospfv3 ASBR summarisation feature
2021-07-30 06:37:50 -04:00
Russ White
31a8ea0f5f
Merge pull request #9216 from donaldsharp/simple_snmp_fix
tests: Set addresses before we use snmpd
2021-07-29 15:04:49 -04:00
Donatas Abraitis
6e30010641
Merge pull request #9207 from donaldsharp/snmp_pytest_mark
Snmp pytest mark
2021-07-29 11:09:26 +03:00
Donald Sharp
14fdbe00e1 tests: Set addresses before we use snmpd
The test_simple_snmp.py test starts bgp, zebra and snmpd at the
same time.  Then zebra configuration is read in and interface
addresses are applied.  If snmp start slower than zebra
the snmp process can properly get it's ip address to bind to
if it is faster than zebra, it will fail.  Ensure that the
test has addresses before we start daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 16:25:54 -04:00
Donald Sharp
68b47b29d8
Merge pull request #9104 from idryzhov/topotest-multiline
tests: fix invalid multiline format
2021-07-28 11:22:26 -04:00
Donald Sharp
dbc5be82d8 tests: add pytest.mark.isisd to those tests missing it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
02546fc1d9 tests: add pytest.mark.nhrpd for those missing it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
9a47e7b213 tests: Add pytest.mark.sharpd for those missing it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
6a1e89514d tests: add pytest.mark.staticd for those tests missing it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
4be92408e4 tests: Add pytest.mark.pimd for those missing it
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
bf3a0a9a4b tests: Add pytest.mark.bgpd for tests missing this mark
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:45:38 -04:00
Donald Sharp
6ff492b194 tests: Add pytest.mark.ospfd on tests missing this mark
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 09:36:30 -04:00
Donald Sharp
2a16d27a0f tests: Add pytestmark to get all snmp tests marked
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-28 08:31:30 -04:00
Donald Sharp
ba0026272c tests: Increase timeout for loaded systems
When running this test on a locally loaded system I am seeing the
static route as `queued` still after 1 second.  Let's just blanket
increase the timeout to something longer to give a very loaded system
more time to install the route.

Output on my test system when it was loaded:

INFO     topolog.r1:topogen.py:880 vtysh result:
	{
	  "4.5.1.0/24":[
	    {
	      "prefix":"4.5.1.0/24",
	      "prefixLen":24,
	      "protocol":"static",
	      "vrfId":0,
	      "vrfName":"default",
	      "selected":true,
	      "destSelected":true,
	      "distance":1,
	      "metric":0,
	      "queued":true,
	      "table":254,
	      "internalStatus":8,
	      "internalFlags":73,
	      "internalNextHopNum":1,
	      "internalNextHopActiveNum":1,
	      "uptime":"00:00:00",
	      "nexthops":[
	        {
	          "flags":1,
	          "ip":"192.168.216.3",
	          "afi":"ipv4",
	          "interfaceIndex":11,
	          "interfaceName":"r1-eth6",
	          "active":true,
	          "weight":1
	        }
	      ]
	    },

I suspect 10 seconds should be enough( I would hope ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-27 09:38:14 -04:00
Russ White
b6dcdc0291
Merge pull request #8897 from gpnaveen/ospfv3_base_cases
tests:  adding ospfv3 basic cases
2021-07-27 08:49:51 -04:00
Donald Sharp
11190f169a tests: Reduce pim join/prune interval to 5 seconds
Tests should have low enough overhead that sending
the join/prune every 5 seconds should be sufficient
also it should allow us to converge faster in case of
dropped packets.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-26 11:57:25 -04:00
Donald Lee
78f1ac2574 lib: Add new MTYPE for script results
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-26 23:27:56 +08:00
Mobashshera Rasool
8a86be272f tests: Adding ospfv3 asbr summarisation
Total cases 9.

Authored-by: nguggarigoud <nguggarigoud@vmware.com>
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2021-07-26 12:05:31 +00:00
Donatas Abraitis
66aa87d03e
Merge pull request #8637 from opensourcerouting/pim-vrf-acl-fixes
Pim vrf acl fixes
2021-07-26 12:20:54 +03:00
Donald Lee
26693b3afc lib: typo in tests
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-24 03:35:09 +08:00
Donald Sharp
0775caa958
Merge pull request #9082 from ton31337/feature/bgp_alias_route-map_match
bgpd: `match alias` for route-map
2021-07-22 08:30:15 -04:00
Igor Ryzhov
1527899504 tests: fix invalid multiline format
`format` can't be used per-line when we have a multiline string.

This was recently broken in 3881d05.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-21 15:37:15 +03:00
Donatas Abraitis
90737805d9
Merge pull request #8956 from pguibert6WIND/bgp_loop_through_itself
bgpd: prevent routes loop through itself
2021-07-21 09:28:21 +03:00
Donatas Abraitis
903b3fff7d tests: Check if match alias works for route-maps
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-21 09:26:15 +03:00
nguggarigoud
db56171c86 tests: Adding ospfv3 basic functionality test cases
1. Adding  APIs to configure and verify ospfv3.
2. Adding ospfv3 base functionality testcase.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-07-20 02:34:24 -07:00
Mark Stapp
b747851a5d tests: skip tests after errors in bgp-evpn-vxlan
In bgp-evpn-vxlan, skip test cases if there's been a failure;
a couple of cases were missing this.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-07-19 10:36:12 -04:00
Donald Lee
64d457d7ac lib: Rename frrscript_unload to delete
frrscript_load now loads a function instead of a file, so frrscript_unload
should be renamed since it does not unload a function.

Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Lee
8a04c1e74e tests: Add more examples to get_result
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Lee
ad6e9b854d test: Use frrscript_unload
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Lee
5090d7249f tests: Add test for frrscript_get_result
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Lee
7948c5d27a tests: Add errorneous test cases
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Lee
4535b6113c tests: Add test for calling Lua function
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-07-18 06:32:03 +08:00
Donald Sharp
c24e832ae9
Merge pull request #8946 from gpnaveen/bgp_lib_changes
tests: Adding lib changes for bgp peer type verification.
2021-07-16 09:15:36 -04:00
Donald Sharp
eeef611bad
Merge pull request #9068 from ton31337/fix/reduce_converge_time
tests: Reduce bgp_conditional_advertisement converge time 10x
2021-07-16 08:34:46 -04:00
Christian Hopps
be4a9b0570 tools: improve frr-reload.py delta file creation
- Remove incorrect requirement for `service integrated-vtysh-config`
  when producing a delta.
- Add `--test-reset` option which suppresses non-parseable lines from the
  produced delta
- Use new features in common_config.py

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-15 22:12:01 -04:00
Donatas Abraitis
2c3d4b28bd tests: Reduce bgp_conditional_advertisement converge time 10x
~15min vs. ~1min.

Before:
```
1 passed, 1 skipped in 908.61 seconds
```

After:
```
1 passed, 1 skipped in 82.94 seconds
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-15 23:40:42 +03:00
Donald Sharp
0f8de6a8d8
Merge pull request #9055 from ton31337/fix/show_pfxsnt_even_when_default_route_originated
bgpd: Reflect changes to pfxSnt when using default-originate
2021-07-15 15:54:01 -04:00
nguggarigoud
ea234209a1 tests: Fixing timing issue in evpn script.
Modified bgp timer values for faster convergence.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-07-15 05:57:25 -07:00
Donald Sharp
5f179a1a61
Merge pull request #9018 from LabNConsulting/chopps/triage-features
tests: add triage features: strace, asan-abort, and shells/vtys/gdbs for docker runs too
2021-07-15 08:37:15 -04:00
nguggarigoud
ad03ea8ebf tests: Adding lib changes for bgp peer type verification.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-07-15 05:28:08 -07:00
Donatas Abraitis
5fa869fcc7 tests: Check if pfxSnt is adjusted when default-originate is used for BGP
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-15 00:10:38 +03:00
Christian Hopps
0ba1d257be tests: add triage features: strace, asan-abort, docker exec
TMUX and Screen support when running topotests inside docker. This
allows the gdb, shell and vtysh features to correctly work even when
running the tests inside docker.

Add options:
--asan-abort :: aborts the process on ASAN errors
--strace-daemons :: strace some or all daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-07-14 15:55:40 -04:00
Russ White
000df71ccd
Merge pull request #8767 from opensourcerouting/ospfd-gr
ospfd: introduce support for Graceful Restart (restarting mode)
2021-07-13 06:39:53 -04:00
Philippe Guibert
3881d05175 bgp_basic_functionality: fix pylint errors
fix pylint errors found.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-07-12 13:57:36 +02:00
Philippe Guibert
654a5978f6 bgpd: prevent routes loop through itself
Some BGP updates received by BGP invite local router to
install a route through itself. The system will not do it, and
the route should be considered as not valid at the earliest.

This case is detected on the zebra, and this detection prevents
from trying to install this route to the local system. However,
the nexthop tracking mechanism is called, and acts as if the route
was valid, which is not the case.

By detecting in BGP that use case, we avoid installing the invalid
routes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-07-12 13:57:36 +02:00
Donald Sharp
75e8e36b4d
Merge pull request #8945 from ton31337/fix/check_only_ebgp_peer
bgpd: Parse as withdrawal if AS-PATH contains 0 within the path
2021-07-06 16:06:54 -04:00
Martin Winter
511184897b
tests: Add IGMP/PIM VRF test
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-07-06 14:23:55 +02:00
Donald Sharp
432bb280fb
Merge pull request #8939 from LabNConsulting/chopps/sup-bund-fixes
Speedup support bundles, fix bugs, add CLI timestamp
2021-07-06 07:58:19 -04:00
Martin Winter
fe3c85de1a
tests: Add PIM ACL-based RP selection test
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-07-06 01:44:36 +02:00
Martin Winter
80c5c45b0b
tests: fix hang during topology shutdown when CLI connection fails
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-07-06 01:44:36 +02:00
David Lamparter
fa8e714a6f
tests/lib: add a simple prefix list query tool
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-07-06 01:44:35 +02:00
David Lamparter
f8f4aec3b0
tests/lib/cli: allow using YANG modules
Since the common CLI code calls nb_init, allow specifying some modules
to load by overriding test_yang_models.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-07-06 01:44:35 +02:00
Renato Westphal
b2a2107ade tests: add OSPF graceful restart topotest
Add a new topotest that features a topology with seven routers spread
across four OSPF areas:
* 1 backbone area;
* 1 regular non-backbone area (0.0.0.1);
* 1 stub area (0.0.0.2);
* 1 NSSA area (0.0.0.3).

All routers have both GR and GR helper functionality enabled in
the configuration. The test consists of restarting each router,
one at time, and checking that all forwarding planes (and LSDBs)
are kept intact during those restarts.

A successful run takes about three minutes to finish.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-05 11:43:02 -03:00
Renato Westphal
5957a1a11f tests: add "save_config" parameter to kill_router_daemons()
Using "write memory" to save the daemons' configurations before
restarting them can cause log files to stop working correctly. Add
a new "save_config" to the kill_router_daemons() function to prevent
that from happening when saving the configurations isn't necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-05 11:43:02 -03:00
Donatas Abraitis
12536067cc
Merge pull request #8979 from opensourcerouting/msdp-topotest-speedup
topotests: speed up MSDP convergence speed
2021-07-05 09:16:27 +03:00
Quentin Young
71bae95e4a
Merge pull request #8888 from dlqs/lua-call 2021-07-05 04:13:20 +00:00
Rafael Zalamena
616bbd94c8 topotests: speed up MSDP convergence speed
Decrease the connection retry time to reduce test duration on connection
failures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-07-04 11:17:10 -03:00
Donald Sharp
70ec4ea388
Merge pull request #8871 from opensourcerouting/msdp-peer-rework
pimd: rework MSDP peer and add tests
2021-07-01 07:31:21 -04:00
Christian Hopps
0ef5bf1905 tests: generate support bundles in parallel, fix bugs
Speedup (large topo): OLD: ~6 minutes NEW: ~1 second
  (when paired with generate_support_bundle.py changes)
- Collect from each node in parallel

Bug fixes:
- sub-directory test name was the same internal pytest function name
  for any test, and not the actual test name.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-30 15:46:10 +00:00
Christian Hopps
396b072f9c tests: extend timeout period for failing mcast test
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-30 15:46:10 +00:00
Quentin Young
5e02b133bf
Merge pull request #8943 from idryzhov/build-warn
tests: fix build warning
2021-06-30 04:33:30 +00:00
Quentin Young
f27e08373c
Merge pull request #8887 from LabNConsulting/chopps/fix-test-retries 2021-06-29 19:24:59 +00:00
Donatas Abraitis
23b73f1957 tests: Treat as withdraw if AS-PATH contains 0 within the path
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-29 17:17:55 +03:00
Donatas Abraitis
d0046e9acc tests: Add a test case for BGP AS-PATH 0 in the path
We should withdraw prefixes with ASN 0 within the path.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-29 16:29:32 +03:00
Igor Ryzhov
f102386a04 tests: fix build warning
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-29 16:13:12 +03:00
Trey Aspelund
b01830dc5b tests: Include evpn in bgp-default-afi-safi.py
Expands "bgp default" tests to include l2vpn evpn in addition
to ipv4/ipv6 unicast.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-06-28 20:55:51 +00:00
Trey Aspelund
4a804cedc8 tests: rename bgp_default_ipv4_ipv6 to _afi_safi
Replaces the ipv4/ipv6-specific naming with generic afi/safi reference.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-06-28 20:53:59 +00:00
Rafael Zalamena
858252d0c5 topotests: bump MSDP mesh group test wait time
On a loaded machine running FRR with ASAN I've got the following result:

  INFO: waiting MSDP connection from peer 10.254.254.3 on router r1
  INFO: 'router_json_cmp' polling started (interval 1 secs, maximum 30 tries)
  INFO: 'router_json_cmp' succeeded after 22.53 seconds

Which is very close to the limit, so lets bump the value 4x to avoid a
test false positive.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25 15:06:20 -03:00
Rafael Zalamena
3bed07f60f topotests: topology to test MSDP peers
Test the following items:
 - Multicast route installation
 - MSDP peering/SA/RPF

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-06-25 15:06:20 -03:00
Donald Lee
555f7625a8 tests: put lua scripting unit tests behind flag
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-06-25 17:29:15 +08:00
Christian Hopps
ed776e38f6
tests: apply KISS to retry fixture
This python fixture was way too complex for what is needed.

Eliminate gratuitous options/over-engineering:

- Change from non-deterministic `wait` and `attempts` to a single
`retry_timeout` value. This is both more deterministic, as well as
what the user should actually be thinking about.

- Use a fixed 2 second pause between executing the wrapped function
rather than a bunch of arbitrary choices of 2, 3 and 4 seconds
spread all over the test code.

- Get rid of the multiple variables for determining what "Positive" and
"Negative" results are. Instead just implement what all the user code
already wants, i.e., boolean False or a str (errormsg) means
"Negative" result otherwise it's a "Positive" result.

- As part of the above the inversion logic is much more comprehensible
in the fixture code (and more correct to boot).

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-25 05:33:04 +00:00
Christian Hopps
d8c3138cd9 tests: fix pylint cleanup damage
Pylint cleanup in commit 914faab594 removed a crucial function
parameter that inverted the logic of verify function calls.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-25 02:33:03 +00:00
Kuldeep Kashyap
25b43d5654 tests: Fix generate support bundle issue for test_route_map_topo1
1. There was a false condition, which was causing support bundle to be generated.
Issue is fixed.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-06-24 15:26:59 -07:00
Russ White
e88ed0d667
Merge pull request #8912 from gpnaveen/ospf_asbr_summary
tests: Adding ospfv2 summarisation test cases.
2021-06-24 16:19:22 -04:00
nguggarigoud
e6a472a05a tests: Adding ospfv2 summarisation test cases.
Total cases 6.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-06-23 13:57:12 -07:00
Donald Sharp
43d985e414
Merge pull request #8860 from ton31337/fix/aspath_prepend_default-originate
bgpd: Allow aspath prepending for default-originate with route-maps
2021-06-23 10:13:29 -04:00
Donald Sharp
792ae3b3b5
Merge pull request #8901 from ton31337/feature/bgp_default_route_originate_match
tests: Add an additional conditional BGP default route advertisement
2021-06-23 07:53:39 -04:00
Patrick Ruddy
fa855f8fa3
Merge pull request #6695 from adharkar/frr-master-gateway_ip
EVPN route type-5 gateway IP overlay Index
2021-06-23 09:23:54 +01:00
Donald Lee
4b827e08a1 tests: enable lua script tests in ubuntu-20 ci
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-06-23 00:58:39 +08:00
Donald Lee
e06feaf8fe tests: Add unit test for lua encoders/decoders
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-06-23 00:58:39 +08:00
Donald Lee
1e0e4d2355 tests: Add unit test for lua scripting
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-06-23 00:58:04 +08:00
Russ White
b79f1e068e
Merge pull request #8725 from pjdruddy/ospfv3_fair_socket
OSPFv3 socket rework
2021-06-22 10:58:33 -04:00
Donatas Abraitis
8cfca51df5 tests: Add an additional conditional BGP default route advertisement
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-22 17:34:59 +03:00
Donatas Abraitis
cc54c07298 tests: Check if as-path prepends work with route-maps and default-originate
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-06-22 15:51:07 +03:00
Donald Sharp
457d4ee329
Merge pull request #8868 from ranjanyash54/redistribute_fix
ospf6d: redistribute command minor fixes
2021-06-19 12:20:04 -04:00