Currently, delayed reflooding on P2MP interfaces for LSAs received
from neighbors on the interface is unconditionally (see commit
c706f0e32b). In some cases, this
change wasn't desirable and this feature makes delayed reflooding
configurable for P2MP interfaces via the CLI command:
"ip ospf network point-to-multipoint delay-reflood" in interface
submode.
Signed-off-by: Acee <aceelindem@gmail.com>
When running the pytests in parallel, calling pytest.exit() causes
the entire test run to be aborted. Which.... Is frankly not cool.
Let's notice the failure and move on to the next tests.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
A bunch of tests rely on pre-generated config from
json files. These tests were not putting `exit` stanzas
and a bunch of the tests as a result are silently failing
to configure properly at all, as commands were being sent
to the wrong daemons.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The test is performing these steps:
a) get timestamp of route installed in zebra
b) <make changes>
c) get new timestamp of route installed in zebra
If < 1 second happens between A and C the test
assumes that something went wrong, as that it is
testing to see if the route was reinstalled <yes I know>.
Just sleep 1 second after a) happens so that if a reinstall
happens we can easily see it, and we also know that if a
reinstall doesn't happen then the new timestamp will
always be 1 second or greater.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
From running the test:
bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as
/home/sharpd/.local/lib/python3.10/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but bgp_remove_private_as/test_bgp_remove_private_as.py::test_bgp_remove_private_as returned True, which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`?
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
- Restore default of looking for a daemon config underneath the router directory
if no config file was specified.
- Recent change for adding unified config support had a logic bug, fix
- Update the one test that conflicted with this default
- comment out asyncio option causing warnings if asyncio wasn't installed.
Signed-off-by: Christian Hopps <chopps@labn.net>
Our CI test system is configuring interfaces like this:
int A
<ospfX config>
router ospfX
router-id Z.Y.M.Q
On sufficiently loaded systems, the router-id might not be respected because
the interface A neighbor might have come up by the time the router-id
command is read in. This is a problem for our topotests in that
the tests expect neighbors to be formed with certain router-id,
but the FRR code has stored the new router-id but not accepted
it's use since a neighbor relationship has formed.
Modify the ci test system code to put the 'router ospfX' commands
before the interface commands, thus forcing the router-id to be
read in *before* any possibility that the neighbor can have come
up.
Also, I've filed issue #13452 to address the ordering of commands
with regards to router-id in our ospf protocols. Once that is
done this should be backed out, to return to a more natural ordering
of commands.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Recently clear commands were added to the tests that do nothing
because they are using the wrong way to input the command.
Since these do nothing remove them:
2023-05-16 16:39:07,072.072 DEBUG: topolog.r0: Router(r0): cmd_status("['/bin/bash', '-c', 'clear ip ospf neighbor']", pre_cmd: "['/usr/bin/nsenter', '--mount=/proc/4157893/ns/mnt', '--net=/proc/4157893/ns/net', '--uts=/proc/4157893/ns/uts', '-F', '--wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0']" use_pty: False kwargs: {'stdout': -1, 'stderr': -2, 'encoding': 'utf-8', 'shell': False, 'stdin': None, 'env': {'LANG': 'en_US.UTF-8', 'LS_COLO)
2023-05-16 16:39:07,120.120 WARNING: topolog.r0: Router(r0): proc failed: rc 1 pid 4161077
args: /usr/bin/nsenter --mount=/proc/4157893/ns/mnt --net=/proc/4157893/ns/net --uts=/proc/4157893/ns/uts -F --wd=/tmp/topotests/ospf_basic_functionality.test_ospf_asbr_summary_topo1/r0 /bin/bash -c clear ip ospf neighbor
stdout: Usage: clear [options]
Options:
-T TERM use this instead of $TERM
-V print curses-version
-x do not try to clear scrollback
stderr: *empty*
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tableVersion always incorrectly showed 0 instead of a decent value. Let's get rid
of this from the partial output at all.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
don't grep the tail of a log file after running a previous test, there could be
(and have been) other items added to the log in between.
add before and after count of shutdown messages to very the actual message shows
up as the test intended, and keep the search for the shutdown message.
Signed-off-by: Christian Hopps <chopps@labn.net>
1. Fix OSPF opaque LSA processing to preserve the stale opaque
LSAs in the Link State Database for 60 seconds consistent with
what is done for other LSA types.
2. Add a topotest that tests for cases where ospfd is restarted
and a stale OSPF opaque LSA exists in the OSPF routing domain
both when the LSA is purged and when the LSA is reoriginagted
with a more recent instance.
Signed-off-by: Acee <aceelindem@gmail.com>
This test demonstrates that a label is allocated for each
ipv6 next-hop. IPv6 test introduces link local ipv6 addresses
as next hops, and compared to IPv4, one can have two different
next-hops depending if the next-hop is defined by a global
address (static route redistributed) or a bgp peer.
This test checks that:
- The labels are correctly allocated per connected next-hop.
- The default label is used for non connected prefixes.
- The withdraw operation frees the MPLS entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the
associated label will be found out.
- When a prefix moves from one peer to one another behind the
vrf, then the MPLS switching operation for return
traffic is changing the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- Also, when unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
A new test suite checks for the mpls label allocation
per nexthop mode. This test checks that:
- The labels are correctly allocated per connected
next-hop.
- The default label is used for non connected prefixes
- The withdraw operation frees the mpls entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the associated
label will be found out.
- When a prefix moves from one peer to one another behind the vrf,
then the MPLS switching operation for return traffic is changing
the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- When unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Added topotest cases for the modification of added
prefix lists.
Author: Vijay kumar Gupta <vijayg@vmware.com>
Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
Reuse the exiting GR topotests since planned and unplanned GR should
behave the same.
The only difference is that for unplanned GR there's no preparation
phase. The OSPF daemons are just killed (SIGTERM) and restarted
normally. The tests then proceed to do the same checks they do for
planned GRs.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
test_frrscript is run from the `tests` directory and expects the sample
lua script `script1.lua` to be present in the `lib` directory. When the
package is built out of tree (which always happens when a debian
package is built), and scripting is enabled, test fails because the lua
file is not present in the `tests/lib/` subdir of the _build_ directory.
Fix this by adding `script1.lua` as an extra dependency for
`test_frrscript`, and a recipe that copies the file from the source tree
to the build tree (note: it needs to be marked ".PHONY" because
otherwise `make` thinks that it already exists, in the source tree).
After this commit, the following command starts to work:
dpkg-buildpackage --build-profiles=pkg.frr.lua -b -uc
Signed-off-by: Eugene Crosser <crosser@average.org>
There is no guarantee that the vrfId is going to be the same across
tests, as that the vrfId is chosen based upon the ifindex of the
vrf device. As such we should not be looking for the vrfId, but
the correct vrf name.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The test ospf_metric_propagation is looking for a specific ifindex
this ifindex is not guaranteed to be any particular value by the underlying
OS. So let's remove this test for it. As a side note I am seeing
tests fail in upstream CI because of this.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
- Often millisecond precision is not good enough to differentiate things that
occur directly one after another, and things that have some pause in between,
increase to microsecond precision (reporting)
Signed-off-by: Christian Hopps <chopps@labn.net>
Verify activation and desactivation of per-vrf and per-af
sid export. Modify the configuration of r2 and verify that
changes are reflected in r1 and on connectivity between ce1 and c2.
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
The `bgp_srv6l3vpn_to_bgp_vrf3` topotest tests the SRv6 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.
The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.
The `bgp send-extra-data zebra` option has been accidentally commented
out in commit 2007e2dbd0.
This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by re-adding
the missing `bgp send-extra-data zebra` option.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
If r1 becomes the "server" (= local port 179), then it initiates the connection
after sending BGP Notification (BFD Down) and r2 resets the last error code.
Telling r1 do not connect to r2, fixes the issue.
Tested with `pytest -s -n 48` at least 20 times - no failures.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
the ospf_basic_functionality/test_ospf_lan.py script is setting
up a lan env that will have 4 ospf routers on it and shutting/no
shutting interfaces with various priorities to see that ospf
is properly choosing roles. I am consistently seeing the
ospf_basic_functionality/test_ospf_lan.py script failing
where it is saying a neighbor is not in the correct state.
Upon examination of the logs we are seeing this:
2023/04/24 09:16:42 OSPF: [M7Q4P-46WDR] vty[7]@(config)# interface r0-s1-eth0 <----- This is where we no shut the interface
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:53 OSPF: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task ospf_ism_event (556af08a5b4c) ran for 6038ms (cpu time 0ms)
2023/04/24 09:16:53 OSPF: [HKQ2F-8D0MY][EC 100663315] Thread Starvation: {(thread *)0x556af19da020 arg=0x556af19c0dd0 timer r=-5.086 ospf_ase_calculate_timer() &ospf->t_ase_calc from ospfd/ospf_ase.c:635} was scheduled to pop greater than 4s ago
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@> enable
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@# show ip ospf neighbor all
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
This test is setting the dead interval to 4 seconds, seeing a 6 second delay where the os has gone to town
(probably because of the high load on the system ) and not choosing the correct neighbor as the DR.
OSPF when coming up and after seeing the first neighbor, goes into a waiting period before
the DR is elected. If the neighbor does send it's hello packets but they are not processed
before the wait timer pops because of the starvation event, then the wrong neighbor
will be elected DR. Let's give this test a bit more time to decide who the
DR is in case everything goes a bit south.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Fixes bad fixed path use and rootcmd functionality to run things
in the root namespace (all but pid at least).
Signed-off-by: Christian Hopps <chopps@labn.net>
After the munet switch we weren't passing the logger on to low-level
LinuxNamespace and thus Commander parent classes, so the lowest-level
`cmd_status` logs were missing from more specific log files in the run
directory.
Signed-off-by: Christian Hopps <chopps@labn.net>
- Remove the .pid and .vty files and then wait for them to show back up.
- Fix broken BGP GR test to not fail now that it's bug is exposed. It
only worked b/c when starting a daemon the pid file still existed and
blocked the bogus second BGP launch from happening.
Signed-off-by: Christian Hopps <chopps@labn.net>
Rather than create a new global dict and copy all the config into it, just
expose the pytest config globally and use it directly.
Signed-off-by: Christian Hopps <chopps@labn.net>
The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.
Test case added to tests/lib/test_typelist.
Note this function is not currently used anywhere. Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Add new RIP topology to test the BFD integration and RIP ECMP:
shutdown a link and expect the RIP route change immediately instead of
regular RIP timer.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Add a topotest with 9 flex-algo routers to check each router's MPLS
table.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Add a topotest to check some Flex-Algo configuration changes.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Append an optional parameter to "show isis route [prefix-sid]" that
formats the output as a JSON array.
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Deal with the packing and unpacking of following Flex-Algo
Sub-Sub-TLVs:
- Router Capability (already defined TLV 242)
- List of the Flex-Algo Definitions (Sub-TLV 26)
- Exclude admin group (Sub-Sub-TLV 1)
- Include-any admin group (Sub-Sub-TLV 2)
- Include-all admin group (Sub-Sub-TLV 3)
- Flags (for prefix-metric) (Sub-Sub-TLV 4)
This commit splits data into multiple router capability TLVs if needed
because a TLV cannot contains more than 255 bytes.
Note that the list of SR Algorithm (Sub-TLV 19) within Router Capability
(TLV 242) is already set in a previous commit.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
isis_tlvs_add_extended_ip_reach adds IS-IS Extended
IP reachability to the LSP. In this case, if the
pcfg argument is not NULL, you can add IGP
Prefix-SID as its sub tlv.
Before this commit, only one Prefix-SID can be added.
After this commit, the argument is not a single
pointer but an array of pointers, and multiple
Prefix-SIDs can be added.
This feature is necessary because Flex-Algo
requires multiple Prefix-SIDs for each Algorithm.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
The spftree has a new property called algorithm
which is id used to identify the algorithm that
separates it in the same IGP network. This is
used in Flex-Algo. In other cases than Flex-Algo,
the algorithm id is always zero.
Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Rather than requesting the data for the entire model, just request the route
data for the specific prefix. This also tests the xpath code (which was
previously broken).
Signed-off-by: Christian Hopps <chopps@labn.net>
When launching the daemons under gdb it takes a bit for them to come up, the
currently code only looks for pid files to determine if the daemon is running.
This test is no good as these files are left around by previous runs.
For now do a simple sleep when debugging with gdb to get things working.
Signed-off-by: Christian Hopps <chopps@labn.net>
The tests are killing bgpd and then ending, the next test is checking for all
daemons running and spewing warnings to stderr. Restart the daemons before
ending the test (like other tests in this same module) to avoid this.
Signed-off-by: Christian Hopps <chopps@labn.net>
The label value for the given prefix was ignored,
as the compare function always returns ok.
Do return the json compare output.
Fixes: eee086e6d2 ("topotests: add topotest to check bgp lu explicit-null service")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
1. Added interface name, group address and detail option to existing
"show ip igmp groups" so that user can retrieve all the groups
or a particular group for an interface. Detail option shows the source
information for the group. With that, the show command
looks like:
"show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"
2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present
3. Changed "detail" option to print non pretty JSON
4. Added interface name and group address to existing
"show ip igmp sources" so that user can retrieve all the sources for
all the groups or, all the sorces for a particular group for an
interface. With that, the show command looks like:
"show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
The scale_up.py script used by several tests installs 50k routes into the rib from
sharpd. It is first looking for the results in the bgp database. Let's ensure
that the routes are actually installed into the rib first before looking in
the bgp tables. This should help situations where the system is under extreme
load.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The test ensures that the incoming prefixes are received with
the appropriate label value, and that connectivity is ensured
between prefixes.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Locally, the bgp_evpn_vxlan_svd_topo1 and bgp_evpn_vxlan_topo1
tests are failing for me. Upon inspection the test is looking
for the mac addresses of the interfaces participating in the
evpn bridging on the hosts. For some reason on my machine
these mac addresses are not in the l2 tables at all on
PE1 or PE2. Adding quick pings solves the problems.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Following replacement of Edge Key type (uint64_t by new structure), this patch
updates the various TE topotests to the new Edge Key references.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>