Commit Graph

3080 Commits

Author SHA1 Message Date
Donatas Abraitis
7591803d88 tests: Refactor bgp_maximum_prefix_invalid_update test case
Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-29 17:02:40 +02:00
Russ White
dd6e0bc0cc
Merge pull request #12329 from opensourcerouting/feature/graceful-shutdown_per_peer
bgpd: Implement graceful-shutdown command per neighbor
2022-11-29 08:47:20 -05:00
Donatas Abraitis
27858b3be9 tests: Refactor bgp_local_as_private_remove test case
Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-29 15:19:56 +02:00
Donatas Abraitis
52ffb4e6c0 tests: Refactor bgp_comm-list_delete test case
Just drop `while true` stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-29 15:08:09 +02:00
Francois Dumontet
bb31900439 topotest: add test for confederation
add a test dedicated to confederation. it also take into
account the support of AS memberwith same id  that the
confederation id.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-11-28 14:24:49 +01:00
Donald Sharp
d58334ea1c
Merge pull request #12342 from opensourcerouting/fix/small_waiting_times
tests: Fail tests immediately if they use too low wait/count values
2022-11-28 08:10:23 -05:00
Donatas Abraitis
a433c49cc6
Merge pull request #12371 from proelbtn/fix-frr-reload-doesnot-work
bgpd: Fix the order of SRv6 locator parameters
2022-11-25 09:20:50 +02:00
Ryoga Saito
4d0ee77eaf tests: Correct srv6 locator testcases
Previous commit changes the order of srv6 locator parameters. So, this
PR reflect the previous changes.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-11-24 17:19:53 +09:00
Stephen Worley
f5a6f8202d
Merge pull request #11908 from sigeryang/tc-state-mgmt
zebra: traffic control state management & ZAPI
2022-11-22 12:02:15 -05:00
Stephen Worley
c8b92cd80a
Merge pull request #12340 from opensourcerouting/fix/rfc5549_vpn_set_ip_nexthop
bgpd: Allow overriding MPLS VPN next-hops via route-maps
2022-11-22 11:41:48 -05:00
Siger Yang
f2ae263bb7
tests: traffic control PoC topotests
This commit adds a basic test for sharpd traffic control PoC, which will check
interface TC info from iproute2 `tc` cli.

Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-11-22 22:35:35 +08:00
Donatas Abraitis
d3a6af081e tests: Set minimum wait time for tests to 5 seconds
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-22 13:38:10 +02:00
Donatas Abraitis
a5722d5a78 tests: Fail tests immediately if they use too low wait/count values
This is for run_and_expect_type and run_and_expect topotests method.

Some contributions unintentionally get merged with very low values, that leads
to CI failures, let's guard this a bit.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-22 11:17:04 +02:00
Donald Sharp
c6653ab2eb tests: Expand minimum run_and_expect to 5 seconds
Ensure that the minimum time spent run and expecting is
5 seconds.  Heavy load is not a reason to fail a test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-21 19:42:18 -05:00
Donald Sharp
9d44fb97a1
Merge pull request #12313 from louis-6wind/fix-lfa-topo
tests: fix bfd in isis_lfa_topo1 step24
2022-11-21 12:03:14 -05:00
Louis Scalbert
f2393c7553 tests: do not use a custom expect function in isis_lfa_topo1
Replace the custom run and expect function by one from the library.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-11-21 13:48:51 +01:00
Louis Scalbert
17e8fa831a tests: fix bfd in isis_lfa_topo1 step24
isis_lfa_topo1 topotests regularly fails at step 24. The test expects
that the BFD session between rt1 and rt2 comes down after shutting the
link between rt1 and rt2.

Since the BFD is multihop, the BFD can get back through rt3.

Set the BFD type to single-hop.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-11-21 13:48:51 +01:00
Donatas Abraitis
9a84cb612e tests: Check if we can override IPv6 next-hop for VPN networks in route-map
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-18 16:17:15 +02:00
Russ White
b7de3fe8a9
Merge pull request #12309 from proelbtn/bgpd-fix-mpls-vpn-advertisement
bgpd: fix invalid ipv4-vpn nexthop for IPv6 peer
2022-11-17 10:05:04 -05:00
Ryoga Saito
3db8aa8750 tests: Add topotest for l3vpn over ipv6 peer
To check the effect of the next patch, I added topotest.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-11-17 19:08:37 +09:00
Donatas Abraitis
4f770cf1d2 bgpd: Implement graceful-shutdown command per neighbor
We already have a global knob for graceful-shutdown, but it's handy having
per neighbor knob as well.

Especially when a single neighbor needs to be restarted/shutdown gracefuly.

We can do this route-maps, but this is a faster/cleaner way doing the same
for an operator.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-16 21:42:21 +02:00
Donatas Abraitis
84f784fafa
Merge pull request #12219 from cscarpitta/feature/srv6-usid-behavior-support
bgpd, zebra: Add support for SRv6 uSID Behaviors
2022-11-14 16:13:39 +02:00
Donatas Abraitis
12853c02c4
Merge pull request #11736 from kuldeepkash/pim_v6
[PIMv6] Add new scenarios to multicast static_rp suite
2022-11-09 17:56:32 +02:00
Carmine Scarpitta
c891f9ce0d tests: Add topotest for SRv6 uSID Locator
This test ensures that the command `behavior usid` works properly.

When the `behavior usid` command is set, a flag is added to the locator
to indicate that the locator is a uSID locator. This test verifies that
the locator works correctly when you set / unset the `behavior usid`
command.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-11-08 22:44:24 +01:00
Pushpasis Sarkar
5b86dc9f0f
Merge pull request #11594 from louis-6wind/lfa-netlink
isisd: apply fast-reroute as soon an interface or an adjacency falls down
2022-11-08 23:19:39 +05:30
Kuldeep Kashyap
3748e8d030 tests: Add pim6d marker to pytest.ini
Added pim6d marker to pytest.ini file,
to run tests pim6d marker based, if added
to scripts.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-11-07 02:19:23 -08:00
Kuldeep Kashyap
787e3da1d7 tests: [PIMv6] Add new scenarios to static_rp suite
Automated new scenarios to multicast pimv6
static rp test suite. Added new folder
multicast_pim6_static_rp_topo1 for pimv6
static_rp automation.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-11-07 02:19:23 -08:00
Kuldeep Kashyap
d7032129b0 tests: [PIMv6] F/W support for multicast pimv6 automation
Enhanced or added new libraries to support
multicast pimv6 automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-11-07 02:19:15 -08:00
Donald Sharp
a5e5c9a301 tests: Test Resilient NHG's are properly created in zebra
When a Resilient NHG is created, ensure that Zebra notes
that it is created and has it as well.

Signed-off-by: Donald Sharp <sharp@nvidia.com>
2022-11-04 13:34:27 -04:00
Donald Sharp
8966cca209 tests: Speedup test_all_protocol_startup.py by 55 seconds
Just make ospf and ospfv3 converge faster with faster
hello timers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-04 13:34:27 -04:00
Donatas Abraitis
87bc89bc87
Merge pull request #12169 from donaldsharp/zebra_meta_q_ordering
zebra: Fix handling of recursive routes when processing closely in time
2022-11-02 20:15:32 +02:00
Russ White
f4bf8f1494
Merge pull request #12159 from opensourcerouting/fix/conditional_advertisement_track_updates
bgpd: Notify BGP conditional advertisement thread when the peer goes down
2022-11-01 12:24:51 -04:00
Russ White
a5dac02901
Merge pull request #12114 from opensourcerouting/feature/bgp_aigp_attribute
bgpd: Implement AIGP
2022-10-31 11:24:43 -04:00
Russ White
854b0ce9ec
Merge pull request #12172 from LabNConsulting/working/lb/api-zero-len-del-flag
OSPF opaques LSA API - fix bug with LL API delete, add option for zero data length withdrawals
2022-10-29 10:38:27 -04:00
Olivier Dugeon
d36cd56638
Merge pull request #12154 from louis-6wind/fix-te-default-bandwidth
lib: fix the default TE bandwidth
2022-10-28 09:29:12 +02:00
Louis Scalbert
4b8daf6b81 tests: adapt cspf_topo1 to the default link-params bandwidth
Adapt cspf_topo1 to the default link-params bandwidth

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-27 18:23:50 +02:00
Louis Scalbert
8e0f875fd6 tests: adapt ospf_te_topo1 to the default link-params bandwidth
Adapt ospf_te_topo1 to the default link-params bandwidth

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-27 18:23:48 +02:00
Louis Scalbert
472a1e5aaa tests: adapt isis_te_topo1 to the default link-params bandwidth
adapt isis_te_topo1 to the default link-params bandwidth

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-27 18:23:29 +02:00
Jafar Al-Gharaibeh
cf2a2762b8
Merge pull request #12179 from LabNConsulting/working/lb/p2mp-improvements
ospf: optimization for FRR's P2MP mode
2022-10-26 22:46:10 -05:00
Donald Sharp
8d4665aabf zebra: Fix handling of recursive routes when processing closely in time
When zebra receives routes from upper level protocols it decodes the
zapi message and places the routes on the metaQ for processing.  Suppose
we have a route A that is already installed by some routing protocol.
And there is a route B that has a nexthop that will be recursively
resolved through A.  Imagine if a route replace operation for A is
going to happen from an upper level protocol at about the same time
the route B is going to be installed into zebra.  If these routes
are received, and decoded, at about the same time there exists a
chance that the metaQ will contain both of them at the same time.
If the order of installation is [ B, A ].  B will be resolved
correctly through A and installed, A will be processed and
re-installed into the FIB.  If the nexthops have changed for
A then the owner of B should be notified about the change( and B
can do the correct action here and decide to withdraw or re-install ).
Now imagine if the order of routes received for processing on the
metaQ is [ A, B ].  A will be received, processed and sent to the
dataplane for reinstall.  B will then be pulled off the metaQ and
fail the install since A is in a `not Installed` state.

Let's loosen the restriction in nexthop resolution for B such
that if the route we are dependent on is a route replace operation
allow the resolution to suceed.  This requires zebra to track a new
route state( ROUTE_ENTRY_ROUTE_REPLACING ) that can be looked at
during nexthop resolution.  I believe this is ok because A is
a route replace operation, which could result in this:
-route install failed, in which case B should be nht'ing and
will receive the nht failure and the upper level protocol should
remove B.
-route install succeeded, no nexthop changes.  In this case
allowing the resolution for B is ok, NHT will not notify the upper
level protocol so no action is needed.
-route install succeeded, nexthops changes.  In this case
allowing the resolution for B is ok, NHT will notify the upper
level protocol and it can decide to reinstall B or not based
upon it's own algorithm.

This set of events was found by the bgp_distance_change topotest(s).
Effectively the tests were looking for the bug ( A, B order in the metaQ )
as the `correct` state.  When under very heavy load, the A, B ordering
caused A to just be installed and fully resolved in the dataplane before
B is gotten to( which is entirely possible ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-26 15:06:23 -04:00
Donatas Abraitis
97a52c82a5 bgpd: Implement Accumulated IGP Metric Attribute for BGP
https://www.rfc-editor.org/rfc/rfc7311.html

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-26 11:26:57 +03:00
Lou Berger
675ba67d89 topotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info
Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-25 15:31:40 +00:00
Wayne Morrison
eaeba5e868 bgpd: fixed misaligned columns in BGP routes table
Column headers in BGP routes table are not aligned with data when
RPKI status is available.  This was fixed to insert a space at the
beginning of the header and at the beginning of lines that do not
have RPKI status.

This fix requires that several testing templates be adjusted to
match the new output.

Signed-off-by: Wayne Morrison <wmorrison@netgate.com>
2022-10-25 10:45:35 -04:00
Donatas Abraitis
695f387ed8
Merge pull request #11673 from cscarpitta/srv6-per-vrf-sid
bgpd: add support for SRv6 L3VPN for IPv4 and IPv6 address families using a single SID
2022-10-24 17:30:10 +03:00
Louis Scalbert
1d5185eccb topotests: isis-lfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt1 and rt2
- The no link-detect setting on rt1 eth-rt2 is still present so that
  zebra does not take account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for BFD to comes down

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
3a03bf9f50 topotests: isis-lfa add a switchover test after neighbor clear
Add a switchover test that consists in clearing the rt2 neighbor on rt1.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
e87245d038 topotests: isis-lfa add a switchover test after hello timeout
Add a switchover test that consists in:
- Setting no link-detect on rt1 eth-rt2 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for the hello timer expiration

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
f4d0de1072 topotests: isis-lfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
a90d4c45db isisd: fix metric calculation of classic lfa backup prefixes
The isis-lfa-topo1 topotest shows backup routes with lower metrics than
the primary ones.

> rt1# show isis route
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::1/128  0       -          -                          -
>  2001:db8:1000::2/128  20      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>  2001:db8:1000::3/128  20      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>  2001:db8:1000::4/128  20      eth-rt4    fe80::5ced:29ff:feed:59c4  -
> (...)
>
> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  15      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>                                eth-rt6    fe80::ac8c:dff:feac:8a8d   -
>  2001:db8:1000::3/128  15      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>  2001:db8:1000::4/128  45      eth-rt5    fe80::847d:feff:fe74:bdde  -
> (...)

Backup routes metrics are incorrect because they only take into account
the path metric but not the prefix metric.

Add the prefix metric to the path metric on backup routes.

After the patch with a prefix metric of 10:

> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  25      eth-rt3    fe80::8c6f:8aff:fe10:ad0d  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>                                eth-rt6    fe80::4810:47ff:fe81:2b9a  -
>  2001:db8:1000::3/128  25      eth-rt2    fe80::e855:12ff:fe31:5765  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>  2001:db8:1000::4/128  55      eth-rt5    fe80::b08e:5cff:fe90:62dd  -

Fixes: e886416f81 ("isisd: add support for classic LFA (RFC 5286)")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
2a9f5928fe topotests: isis-tilfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt5 and rt6
- Setting no link-detect on rt6 eth-rt5 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt6 eth-rt5 from the switch side

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 14:56:42 +02:00
Louis Scalbert
f3529a5522 topotests: isis-tilfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-10-24 11:50:13 +02:00
Lou Berger
c4fff21b8b topotest: ospfapi - test opaque all type add/withdrawals, with and wo zero length
Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-21 15:28:02 +00:00
Kuldeep Kashyap
0074297916 tests: Add lib changes to support bgp local asn feature
Added lib changes to support bgp local
asn feature config changes

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-21 09:23:03 +05:30
Kuldeep Kashyap
a65b1a7573 tests: Add bgp local asn test suite
Adding test to verify functionality
of local asn bgp feature.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-21 09:22:49 +05:30
Donatas Abraitis
0775362306 bgpd: Notify BGP conditional advertisement thread when the peer goes down
Also, make sure we check if the advertisement table changed using FROM peer,
not TO peer.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-20 15:21:47 +03:00
Lou Berger
0b242b118f topotests: ospfapi - enahnce test to cover explicit delete and 0 len opaque LSAs
Signed-off-by: Lou Berger <lberger@labn.net>
2022-10-19 18:34:34 +00:00
Carmine Scarpitta
b3c5e11c8d tests: Add tests for no sid vpn per-vrf export
This commit extends the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by adding
two tests:
* prevent bgpd from exporting routes from a VRF to the VPN RIB
  (`no sid vpn per-vrf export`);
* enable bgpd to export routes from a VRF to the VPN RIB
  (`sid vpn per-vrf export auto`).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:24 +02:00
Carmine Scarpitta
589c6e949e tests: add new topotest to verify SRv6 locators
This commit adds a new topotest to verify the functionality of SRv6
locators with custom bits length parameters.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:23 +02:00
Carmine Scarpitta
3a94d672fc tests: add new topotest for SRv6-L3VPN (IPv4/IPv6)
This commit adds a new topotest which tests SRv6 L3VPN for IPv4 and
IPv6 address families using a single SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:23 +02:00
Carmine Scarpitta
0fa6b4c0ba tests: add test for SRv6 End.DT46 behavior
This commit adds a new test case to the
test_zebra_seg6local_route topotest. The new test case performs two
operations:
* try to install a seg6local route with an End.DT46 action
* verify that the route is created correctly

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-18 16:08:23 +02:00
Donatas Abraitis
d37fb926de
Merge pull request #12113 from donaldsharp/network_statement
bgpd: Allow `network XXX` to work with bgp suppress-fib-pending
2022-10-14 10:12:18 +03:00
Russ White
07735ca345
Merge pull request #11980 from isabelladeleon12/set_overload_startup
isisd: Add support for set-overload on-startup
2022-10-13 10:59:24 -04:00
Isabella de Leon
450841fe05 isisd: Add JSON object functions to save overload status between restarts.
Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2022-10-12 16:57:32 -07:00
Donald Sharp
4801fc4670 bgpd: Allow network XXX to work with bgp suppress-fib-pending
When bgp is using `bgp suppress-fib-pending` and the end
operator is using network statements, bgp was not sending
the network'ed prefix'es to it's peers.  Fix this.

Also update the test cases for bgp_suppress_fib to test
this new corner case( I am sure that there are going to
be others that will need to be added ).

Fixes: #12112
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-12 14:56:27 -04:00
Isabella de Leon
4afc783610 isisd: Add expected behavior with set-overload-bit
Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2022-10-12 10:52:27 -07:00
Donatas Abraitis
46dbf9d0c0 bgpd: Implement ACCEPT_OWN extended community
TL;DR: rfc7611.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-12 17:48:43 +03:00
Donatas Abraitis
87d54383c5
Merge pull request #12059 from achernavin22/fix-max-med-on-startup
bgpd: fix "bgp max-med on-startup"
2022-10-12 16:19:06 +03:00
Russ White
b6aa61ba3c
Merge pull request #11981 from proelbtn/add-support-to-change-function-length
bgpd: Add support to change Segment Routing function length
2022-10-12 08:44:29 -04:00
Alexander Chernavin
05ab8ceda4 bgpd: fix "bgp max-med on-startup"
Currently, if `bgp max-med on-startup` is configured, after BGP session
is established for the first time, a timer for the specified time is
started. When the timer is expired, an UPDATE message should be sent to
reflect changes in the routes' MED value. The problem is that the routes
are being suppressed because based on the attributes they look like they
have not changed. However, in the case of max-med, the value is copied
to the packet directly from `bgp->maxmed_value`, not from the
attributes. Thus, changes in this case cannot be detected by comparing
attributes.

With this fix, avoid route suppressing when the `max-med on-startup`
timer expires and initiates an UPDATE.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2022-10-11 10:45:06 +00:00
Kuldeep Kashyap
84ab38367d tests: Applied black formatting
Applied black formatting to suites,
which were missing.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-11 12:17:54 +05:30
Kuldeep Kashyap
d63c7094e4 tests: Updated assert message for better debugging
Updating topojson script's assert messages,
which will help in better debugging, when
test will fail.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-10-11 06:07:48 +05:30
Donald Sharp
a61f4f48c7 tests: nhid is interfering with pattern match
The bgp_gr_restart_retain_routes test is looking for specific output
that does not include the routes nexthop id:

    def _bgp_check_kernel_retained_routes():
        output = (
            r2.cmd("ip route show 172.16.255.1/32 proto bgp dev r2-eth0")
            .replace("\n", "")
            .rstrip()
        )
        expected = "172.16.255.1 via 192.168.255.1 metric 20"
        diff = topotest.get_textdiff(
            output, expected, "Actual IP Routing Table", "Expected IP RoutingTable"
        )
        if diff:
            return False
        return True

While the output includes nexthop group id's now:

root@r2:# ip route show 172.16.255.1 proto bgp dev r2-eth0
172.16.255.1 nhid 8 via 192.168.255.1 metric 20

Let's just mark r2 as not to use nexthop groups for installation
and this test issue will go away.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-08 10:35:35 -04:00
Mark Stapp
9daf964bc8
Merge pull request #12062 from fdumontet6WIND/hash_list
lib: hash list add function fix
2022-10-07 07:30:46 -04:00
Ryoga Saito
be6985adcb tests: Add func-bits for compatibility
In order to minimize the changes of test files, this PR adds `func-bits`
parameters on the SRv6 locator definition.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-10-07 18:26:53 +09:00
Isabella de Leon
910dab7c30 tests: Add test to cover set-overload-bit on-startup functionality
Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2022-10-06 14:27:00 -07:00
Russ White
a00621d8b9
Merge pull request #12034 from opensourcerouting/fix/gr_hard_notification
bgpd: Do not send Deconfig/Shutdown message when restarting
2022-10-06 10:05:11 -04:00
Russ White
a8ef436639
Merge pull request #12040 from opensourcerouting/fix/bgp_local_as_remote_as
bgpd: Allow using remote-as the same as local-as
2022-10-06 10:03:26 -04:00
David Lamparter
27a6fc4221 tests: make hash collision test collide harder
The issue fixed in the previous commit now correctly triggers a failure:
("assertion (list_add(&head, &itm[j]) == &itm[j]) failed")

Turns out the "shitty" hash function was not shitty enough.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:28:26 +02:00
Donatas Abraitis
b022cf7352
Merge pull request #11838 from Pdoijode/v6-gua-nh-bgp-update
bgpd: BGP does not update next-hop when global V6 address is configured
2022-10-06 10:04:37 +03:00
Donatas Abraitis
18e427bc59 tests: Check if the routes in the kernel are retained for GR as well
Not only in BGP table.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-30 09:51:07 +03:00
Donatas Abraitis
95098d9611 bgpd: Do not send Deconfig/Shutdown message when restarting
We might disable sending unconfig/shutdown notifications when
Graceful-Restart is enabled and negotiated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-30 09:50:21 +03:00
Pdoijode
bc6d1b151f bgpd: BGP does not update next-hop when global V6 address is configured
When primary global v6 unicast address is configured on an
unnumbered interface, BGP does not re-advertise updates out
with the new global v6 address as the nexthop

Signed-off-by: Pdoijode <pdoijode@nvidia.com>
2022-09-29 15:28:38 -07:00
Donatas Abraitis
f3bc47b735 tests: Check if BGP works correctly when using local-as == remote-as
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-29 21:17:44 +03:00
Madhuri Kuruganti
b9fdddb83b bgpd: conditional advertise-map unset on peer fixing warning messages
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-09-25 11:48:47 +05:30
Madhuri Kuruganti
1285c4ace9 bgpd: conditional advertise-map unset on peer not re-advertising withdrawn routes
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-09-25 11:48:47 +05:30
Donald Sharp
71d987dbb9
Merge pull request #11868 from LabNConsulting/ziemba/bgp-labelpool-performance
bgpd: improve labelpool performance at scale
2022-09-12 10:45:43 -04:00
Donald Sharp
ed11f561bc
Merge pull request #11923 from opensourcerouting/fix/aggregate-address-matching-MED
bgpd: Fix aggregate-address summary-only matching-MED-only
2022-09-12 10:31:01 -04:00
Donatas Abraitis
7462dbb0c2 tests: Validate the routes using polling for bgp_remove_private_as
Do not fail at the first shot.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-10 06:51:25 +03:00
Donald Sharp
97a0bfc5ca
Merge pull request #11915 from opensourcerouting/topotests-collect
topotests: ignore env for pytest --collect-only
2022-09-07 12:59:26 -04:00
Donatas Abraitis
f66624f5c0 bgpd: Fix aggregate-address summary-only matching-MED-only
Before it worked only when configured initially via CLI. Later, when we
receive a new route, that should match a decent MED, we just skip it, because
MED mismatch is not recalculated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-07 14:39:19 +03:00
David Lamparter
3d80bd11aa topotests: ignore env for pytest --collect-only
`--collect-only` does not run any tests, so bypass env checks for it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-09-06 17:43:26 +02:00
Philippe Guibert
6fc4929e09 bgpd: associate appropriate family for redistributed connected addresses
When redistributing connected addresses, the address family has
to be figured out. The calculation was not done, the next-hop
address length was not set, and as consequence, the nexthop
is displayed like if it was an ipv6 address, which is wrong for
ipv4 addresses.

Calculate the family for connected addresses.
Change the topotests accordingly.

Fixes: ("7226bc40d606") bgpd: ignore NEXT_HOP for MP_REACH_NLRI

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
b244203fcc topotests: add bgp_vpnv4_ebgp test with 'mpls bgp forwarding'
add bgp_vpnv4_ebgp using the 'mpls bgp forwarding' interface
command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
Philippe Guibert
6e616738ca topotests: add bgp vpnv4 over gre test
This test ensures that MPLS VPN routes can be installed into a
gre interface with route-map l3vpn next-hop encapsulation command
set. On the other hand, if this command is not set, incoming bgp
routes are not considered as valid.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-09-05 22:26:33 +02:00
G. Paul Ziemba
80853c2ec7 bgpd: improve labelpool performance at scale
- double the size of each new chunk request from zebra
    - use bitfields to track label allocations in a chunk
    - When allocating:
        - skip chunks with no free labels
        - search biggest chunks first
        - start search in chunk where last search ended
    - Improve API documentation in comments (bgp_lp_get() and callback)
    - Tweak formatting of "show bgp labelpool chunks"
    - Add test features (compiled conditionally on BGP_LABELPOOL_ENABLE_TESTS)

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2022-08-31 08:21:27 -07:00
Russ White
d72c279d08
Merge pull request #11833 from opensourcerouting/feature/bgp_neighbor_soo
bgpd: Add `neighbor soo` command
2022-08-30 11:17:53 -04:00
Russ White
72cb87b8e4
Merge pull request #11852 from gpnaveen/bgp_admin_dist
tests: adding bgp admin distance topotests.
2022-08-30 11:13:30 -04:00
nguggarigoud
3cf90b1be9 tests: adding bgp admin distance topotests.
This has bgp admin topotest automation suit.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-08-28 23:34:52 -07:00
Donatas Abraitis
e317aea23f Revert "tests: Check if BGP community-list filtering works correctly"
This reverts commit b087842814.
2022-08-24 08:46:47 +03:00
Russ White
abeb15e9cf
Merge pull request #11820 from opensourcerouting/fix/clist_match
bgpd: Fix community-list handling
2022-08-23 11:06:15 -04:00
Russ White
7a15a3d2fc
Merge pull request #11842 from opensourcerouting/fix/topotests_platform_check
tests: Log as error if some of the daemons are missing
2022-08-23 10:58:01 -04:00
ARShreenidhi
2620f3f1bb tests : bgp-default-originate ecmp scenerio is added
Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-08-22 05:03:26 +00:00
Donatas Abraitis
e40b713015 tests: Log as error if some of the daemons are missing
Also print runtime directory for topotests if the error occurs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-20 21:45:06 +03:00
Donatas Abraitis
2c61dd7313 tests: Check if BGP SoO extended community filtering works
Whn using as-override, we should be able to deny outgoing updates from
being propogated when `neighbor soo` is configured.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-19 12:48:15 +03:00
Donatas Abraitis
b087842814 tests: Check if BGP community-list filtering works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-16 23:39:29 +03:00
Donatas Abraitis
97b4474de1 ospf6d: Remove ospf6Enabled from JSON output
Time to deprecate it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-11 17:32:24 +03:00
Russ White
8eb2b1e8ea
Merge pull request #11752 from opensourcerouting/fix/update_policy_on_filters
bgpd: Handle ORF remove-all events correctly and update ORF prefix-list on changes
2022-08-09 08:32:33 -04:00
Donald Sharp
cbc08d1fb9 tests: Convert one test to use interface based mpls config
To prove that this works.  Modify a test that uses mpls to
turn on mpls for the interfaces that need mpls via the
new mpls command.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 09:15:22 -04:00
Donatas Abraitis
bdf51d2ae9 tests: Check if ORF filtering works correctly when modifying prefix-lists
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-05 15:27:59 +03:00
Donatas Abraitis
08c2bd9953
Merge pull request #11710 from donaldsharp/split_up_test_multicast_pim_static_rp
some test fixes and a coverity fix
2022-08-03 11:11:37 +03:00
Donald Sharp
102aeba008
Merge pull request #11692 from opensourcerouting/fix/bgpd_as_override
bgpd: Override ASN without checking if an entire as-path is from a single ASN
2022-08-01 07:19:11 -04:00
Donald Sharp
068dfd62a2 tests: Fix test_ospf_topo1 as that it sometimes fails
This test is sometimes failing when it looks at the
v6 routes in the fib.  Since the step before is
ensuring that v3 ospf has just converged let's
give it a bit of time to find and see if things
have had a chance to install the routes too.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-29 14:19:12 -04:00
Donald Sharp
676fa219f9 tests: Split up test_multicast_pim_static_rp.py into 3 test suites
This test directory takes almost 7 minutes to complete splitting
this up into 3 test files drops it down to just over 3 minutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-29 14:19:12 -04:00
Kuldeep Kashyap
855995e505 tests: [PIMv6] Update topology for static rp suite
Updated topology for static rp suite as per testcase.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-27 19:51:43 -07:00
Donatas Abraitis
ada423318a tests: Check if BGP as-override works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-27 13:33:11 +03:00
Martin Winter
8d4abfc9b9
Merge pull request #11164 from kuldeepkash/pim_v6 2022-07-27 10:05:25 +02:00
Donald Sharp
cbdecd685c tests: Fixup more missing pytestmark annotations
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-26 12:41:53 -04:00
Russ White
3bf3144517
Merge pull request #11523 from pguibert6WIND/bgp_no_retain
Bgp no retain
2022-07-26 08:50:59 -04:00
Kuldeep Kashyap
dab5ff0030 tests: [PIMv6] Add test_multicast_pimv6_static_rp suite
Adding supporting multicast PIMv6 static rp test
suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-23 21:28:40 -07:00
Kuldeep Kashyap
e13f9c4f31 tests: [PIMv6] APIs for multicast PIMv6 config
Enhanced few exsiting PIM APIs to support both
IPv4 and IPv6 configuration. Added few new APIs
for PIMv6. Tested all existing tests with new
API changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-23 21:28:35 -07:00
Chromico
668289897b topotests: Drop static route
Signed-off-by: Nathan Mangar <nathan@thundergear.io>
2022-07-23 01:47:26 +04:00
Rafael Zalamena
b8443f7ad3
Merge pull request #11565 from pguibert6WIND/bfd_vrf_lite_support
bfdd: allow l3vrf bfd sessions without udp leaking
2022-07-22 14:12:17 +00:00
Philippe Guibert
97413ed778 topotests: add bfd_vrflite_topo1 test
This tests checks that there are no errors when receiving BFD
packets over the various linux vrf interfaces. For example, if
an incoming packet is received by the wrong socket, a VRF
mismatch error would occur, and BFD flapping would be observed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-07-22 08:49:52 +02:00
Donatas Abraitis
b6754b74ef
Merge pull request #11643 from ARShreenidhi/df_or_ntw_auto
tests: bgp default orignate behaviour on network commands
2022-07-20 11:43:10 +03:00
Donald Sharp
6ceca15dd1 tests: Make bgp_snmp_mplsl3vpn be more forgiving
I rarely get this failure:
@classname: bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn
@name: test_pe1_converge_evpn
@time: 44.875
@message: AssertionError: BGP SNMP does not seem to be running
assert False
 +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
 +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid
        "Wait for protocol convergence"
        tgen = get_topogen()

        r1 = tgen.gears["r1"]
        r1_snmp = SnmpTester(r1, "10.1.1.1", "public", "2c")

        assertmsg = "BGP SNMP does not seem to be running"
>       assert r1_snmp.test_oid("bgpVersion", "10"), assertmsg
E       AssertionError: BGP SNMP does not seem to be running
E       assert False
E        +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
E        +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid

Under heavy system load a quick test before BGP can fully come up can result in a failed
test.  Add some extra time for snmp to come up properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:54:10 -04:00
ARShreenidhi
27d78d31e7 tests: bgp default orignate behaviour on network commands
test script covers
1. Default originate behaviour using  'network <x.x.x.x>' command
2. Default originate behaviour using aggregate summary command

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-07-19 13:25:13 +00:00
Philippe Guibert
943bfc4e82 topotests: add bgp retain test
This test checks that when retain functionality is disabled,
some prefixes are removed from the BGP ipv4 vpn RIB.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-07-18 08:57:26 +02:00
Donald Sharp
26b2fbf479
Merge pull request #11605 from LabNConsulting/improve-valgrind
Improve valgrind
2022-07-16 21:13:54 -04:00
Jafar Al-Gharaibeh
f8ac2afb53
Merge pull request #11564 from kuldeepkash/multicast_pim_bsm
tests: Fix multicast_pim_bsm_topo2 static route issue
2022-07-15 16:01:13 -05:00
Christian Hopps
160910ec08 tests: analyze: handle list of strings being returned
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-07-14 13:16:01 -04:00
Christian Hopps
1623dc4c9c tests: check memleaks end of module and ignore daemonizing parent
- ignore parent from daemonize valgrind files these allocations will be
checked in the child.
- check for memleaks at end of module/file not just after tests.

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-07-14 13:16:01 -04:00
Chromico Rek
3aaf96aafb topotests: Remove typo on IP
Signed-off-by: Nathan Mangar <nathan@thundergear.io>

topotests: Remove static route

Signed-off-by: Nathan Mangar <nathan@thundergear.io>
2022-07-14 19:07:48 +04:00
David Lamparter
8cb56fb273
Merge pull request #11285 from iqras23/conditional_def_orig 2022-07-12 17:41:09 +02:00
Kuldeep Kashyap
a7bccdc582 tests: Fix multicast_pim_bsm_topo2 static route issue
API to verify static route was checking whether
router is installed with expected nexthop. In
this particular scenario we has same route as
Connected and Static both. In heavy loaded
system static routes was taking time to get
installed and API was doing the verification
on Connected route instead Static route.
Enhanced scripts to check only static routes.

Issue: https://github.com/FRRouting/frr/issues/11563

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-10 22:18:50 -07:00
Donatas Abraitis
790b48b635 Revert "topotests: isis-tilfa add a switchover test after linkdown"
This reverts commit bac0d1e606.
2022-07-10 21:40:55 +03:00
Donatas Abraitis
bbd3d821dd Revert "topotests: isis-tilfa add a switchover test after BFD down"
This reverts commit e83a52698b.
2022-07-10 21:40:49 +03:00
Donatas Abraitis
fbf0fc22f0 Revert "isisd: fix metric calculation of classic lfa backup prefixes"
This reverts commit e45958e9cf.
2022-07-10 21:40:43 +03:00
Donatas Abraitis
82f4ef9c90 Revert "topotests: isis-lfa add a switchover test after linkdown"
This reverts commit 5558ac984f.
2022-07-10 21:40:16 +03:00
Donatas Abraitis
378b4a5b06 Revert "topotests: isis-lfa add a switchover test after hello timeout"
This reverts commit c99ef48962.
2022-07-10 21:40:11 +03:00
Donatas Abraitis
567534e93c Revert "topotests: isis-lfa add a switchover test after neighbor clear"
This reverts commit 9cdc099bb5.
2022-07-10 21:40:05 +03:00
Donatas Abraitis
e0d6dad2fb Revert "topotests: isis-lfa add a switchover test after BFD down"
This reverts commit c8d2816ee5.
2022-07-10 21:39:59 +03:00
Russ White
36153aa328
Merge pull request #10962 from louis-6wind/lfa-netlink
isisd: apply fast-reroute as soon an interface or an adjacency falls down
2022-07-08 11:14:07 -04:00
Donatas Abraitis
967e4a1787
Merge pull request #11530 from ARShreenidhi/default_originate_testcase
tests : bgp default originate test cases
2022-07-07 10:11:45 +03:00
ARShreenidhi
fbad2f3af9 tests : Topotest support to bgp_default_originate
When there is change in route-map policy associated with default-originate, changes does not reflect.
When route-map associated with default-originate is deleted, default route doesn't get withdrawn
Update message is not being sent when only route-map is removed from the default-originate config.
SNT counter gets incremented on change of every policy associated with default-originate
Route-map with multiple match clauses causes inconsistencies with default-originate.
Default-originate behaviour on BGP-attributes

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-07-06 11:06:54 -07:00
Donald Sharp
e894ef7e77
Merge pull request #11524 from kuldeepkash/multicast_pim_bsm
tests: Fix for multicast_pim_bsm_topo1 key error
2022-07-05 19:53:30 -04:00
Pushpasis Sarkar
96929d759f
Merge pull request #11519 from opensourcerouting/feature/turn_on_reserved_ip_ranges
Allow using IPv4 (Class E) IP ranges for daemons
2022-07-05 20:57:37 +05:30
Russ White
211f1157ee
Merge pull request #11494 from ak503/ospf_bfd
ospfd: set/unset bfd profile
2022-07-05 09:51:28 -04:00
Russ White
ede13e3b9c
Merge pull request #11517 from louis-6wind/advert-map
topostest: bgp_conditional_advertisement cleanup
2022-07-05 09:37:41 -04:00
ARShreenidhi
6f5aea0eb6 tests : bgp default originate testcases
this commit containes 2 testcases that covers
1. Default originate behaviour on restarting the BGP daemon and FRR router
2. Default Originate behaviour on shut no-shutting the interface

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-07-05 13:28:26 +00:00
Rafael Zalamena
da82615d4b
Merge pull request #11371 from rampxxxx/feat_bfd_ipv4_echo_fwd_path
bfdd: add IPv4 BFD Echo support that loops pkts in forwarding plane
2022-07-05 07:10:11 -03:00
Kuldeep Kashyap
296b75ed2a tests: Fix for multicast_pim_bsm_topo1 key error
Issue was reported by Donald, we were hitting
with key not found error and execution was
stopped, which is fixed by this PR.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-07-04 23:00:31 -07:00
Donatas Abraitis
bc7e6a17d4 tests: Check if we allow using IPv4 Class E for peering/next-hops
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-01 23:38:14 +03:00
Louis Scalbert
90557c3fce topostest: bgp_conditional_advertisement cleanup
The bgp_conditional_advertisement topotest runs all the test cases in
the same function. It is not easy to debug it because the pytest
"--pause" argument does not make breaks between test cases.

Dispatch the test-cases into functions to benefit from the "--pause"
feature.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-07-01 16:49:52 +02:00
Dmitrii Turlupov
f3fd7196eb ospfd: set/unset bfd profile
Before this patch we can enable 'ip ospf bfd' via '[no] ip ospf bfd profile ...' commads.
After patch '[no] ip ospf bfd profile ...' actual only if 'ip ospf bfd' is set.

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2022-06-30 10:56:34 +03:00
Donald Sharp
a747bf5f45
Merge pull request #11484 from opensourcerouting/fix/allow_using_bgp_roles_for_peer_groups
bgpd: Make sure peer-groups/unnumbered work too with BGP role
2022-06-28 14:31:48 -04:00
Donatas Abraitis
83f9be4291
Merge pull request #11456 from ARShreenidhi/default_originate_vrf_automation
tests : bgp-default-originate in vrf scenerio
2022-06-28 18:51:05 +03:00
Donatas Abraitis
7dddd1f733 bgpd: Make sure peer-groups/unnumbered work too with BGP role
Just adding a support for peer-groups, because now it's not possible to
configure BGP role for peer-groups.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-28 18:32:11 +03:00
ARShreenidhi
034c15b946 tests : bgp-default-originate in vrf scenerio
testcase in this script covers the default originate behavious in VRFs

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-28 12:48:19 +00:00
lynnemorrison
0fb24aa031 tests: update timers in BFD VRF test
Increase BFD Echo timers to make test stable.

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2022-06-28 07:53:30 -04:00
Russ White
03f064dacb
Merge pull request #11236 from LabNConsulting/ziemba/topotest-srte-route-routemap-policy-order
topotests/isis_sr_te_topo1: test out-of-order route/route-map changes
2022-06-28 06:57:38 -04:00
Igor Ryzhov
f50249661a
Merge pull request #11434 from donaldsharp/more_test_fixups
Crash fix and test fix and some cleanup
2022-06-28 13:06:35 +03:00
Donatas Abraitis
f646c17a43
Merge pull request #11426 from error2407/open_policy
bgpd: Add RFC9234 implementation
2022-06-27 09:57:29 +03:00
G. Paul Ziemba
b5635d7575 toptests/isis_sr_te_topo1: test out-of-order route/route-map changes
A SR policy matches a BGP nexthop based on the IP address of
    the nexthop and the color of the route (color may be assigned
    to routes using a route-map).

    The order of events (BGP route arrival, route-map definition,
    policy and candidate-path definition) should not affect the
    matching/mapping.

    These changes add tests for:

	- removing/adding BGP route after policy and routemap are
	  defined and held constant

	- changing route map color to be different from policy color,
	  and then changing back to match

    after each change, the policy should be observed to be in effect
    unchanged from before, i.e., the route's nexthops should reflect
    the matching SR policy.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2022-06-26 14:38:22 -07:00
Eugene Bogomazov
ed80211ad8 bgpd: update topotests for role mismatch
In topotests, we also want to check for role mismatch cases. However, if
we are testing the sender of a role mismatch notification, sometimes it
can have non-deterministic behavior (probably due to a configuration
change). Thus, there is an assumption that the recipient of
notifications will more consistently display the reason why the session
was terminated in the first place.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-24 12:55:24 +03:00
Donald Sharp
de448ea2e8 tests: Increase time for zebra_seg6local to look for sharp routes
I have a test failure:
            r1.vtysh_cmd(
                "sharp install seg6local-routes {} nexthop-seg6local dum0 {} 1".format(
                    dest, context
                )
            )
            test_func = partial(
                check,
                r1,
                dest,
                manifest["out"],
            )
            success, result = topotest.run_and_expect(test_func, None, count=5, wait=1)
>           assert result is None, "Failed"
E           AssertionError: Failed
E           assert Generated JSON diff error report:
E
E             > $: d2 has the following element at index 0 which is not present in d1:
E
E             	{
E             	    "prefix": "1::1/128",
E             	    "protocol": "sharp",
E             	    "selected": true,...
E

The test output for 1::1/128:
	{
	  "1::1/128":[
	    {
	      "prefix":"1::1/128",
	      "prefixLen":128,
	      "protocol":"sharp",
	      "vrfId":0,
	      "vrfName":"default",
	      "selected":true,
	      "destSelected":true,
	      "distance":150,
	      "metric":0,
	      "queued":true,
	      "table":254,
	      "internalStatus":8,

Notice that it is still queued after 5 seconds.  Under extremely heavy system load
this is not long enough for convergence.  Also the zebra.log shows thread starvation
as well as long running tasks
2022/06/17 15:30:02 ZEBRA: [PHJDC-499N2][EC 100663314] STARVATION: task dplane_incoming_request (55b3ce0fea8b) ran for 6369ms (cpu time 0ms)
2022/06/17 15:30:02 ZEBRA: [T83RR-8SM5G] zebra 8.4-dev starting: vty@2601
2022/06/17 15:30:02 ZEBRA: [YZRX4-ZXG0C][EC 100663315] Thread Starvation: {(thread *)0x55b3ce6c15b0 arg=0x0 timer  r=-6.375     rib_sweep_route() &zrouter.sweeper from zebra/main.c:447} was scheduled to pop greater than 4s ago

Increasing the time to 25 seconds to give it a chance.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:58:03 -04:00
Donald Sharp
37076cae05 tests: Fix regex complaints by python3
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:58:03 -04:00
Christian Hopps
9495c4056f tests: add ospf api router ID topotest
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-23 05:01:40 -04:00
Jafar Al-Gharaibeh
3971e02928
Merge pull request #11448 from gpnaveen/ospf_scripts_stbl
tests: Removing invalid step from OSPF tests.
2022-06-21 13:44:33 -05:00
Donatas Abraitis
70292e9bbf
Merge pull request #11351 from kuldeepkash/uplink_mcast_tests
tests: Add multicast-pim-multi-uplink test suite
2022-06-21 18:37:40 +03:00
Russ White
e63a5c42dd
Merge pull request #11352 from ARShreenidhi/default_originate_automation
tests  : bgp default-originate test suite automation
2022-06-21 11:33:47 -04:00
Eugene Bogomazov
aee05e20fd bgpd: Update topotests for RFC 9234
In the previous version, the time.sleep function was included to wait
for the moment when the routes were sent to all routers. Changed this
function to topotest.run_and_expect for more deterministic behavior.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-21 17:41:53 +03:00
Eugene Bogomazov
8f2d6021f8 bgpd: Add patches for RFC9234 implementation
This commit fixes some issues that were noted by the reviewer

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-21 17:41:53 +03:00
nguggarigoud
d5bd355430 tests: Removing invalid step from ospf tests.
1. Removed the step from hello test case with hello
timer of 65535. This test works in some platforms
and does not work in others, affecting stability.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-06-21 02:21:35 -07:00
ARShreenidhi
f10d6c5b0b tests : bgp_default_originate testcase w.r.t topology1 added
this PR contains the basic bgp default originate.
Details of the testcase is available in respective script files

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-21 06:25:20 +00:00
Eugene Bogomazov
d864dd9eb1 bgpd: Add RFC9234 implementation
RFC9234 is a way to establish correct connection roles (Customer/
Provider, Peer or with RS) between bgp speakers. This patch:
- Add a new configuration/terminal option to set the appropriate local
role;
- Add a mechanism for checking used roles, implemented by exchanging
the corresponding capabilities in OPEN messages;
- Add strict mode to force other party to use this feature;
- Add basic support for a new transitive optional bgp attribute - OTC
(Only to Customer);
- Add logic for default setting OTC attribute and filtering routes with
this attribute by the edge speakers, if the appropriate conditions are
met;
- Add two test stands to check role negotiation and route filtering
during role usage.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-17 13:14:46 +03:00
Martin Winter
22ad701ec0
Merge pull request #11408 from donaldsharp/common_config 2022-06-16 18:45:15 +02:00
Donald Sharp
88158815a7
Merge pull request #11405 from kuldeepkash/multicast_pim_bsm
tests: Verify PIM neighbors and static routes for BSM tests
2022-06-15 20:17:56 -04:00
Renato Westphal
45f64029dc tests: fix ldp_vpls_topo1 to work as expected
In the last step of this test, r1's link to r2 is shut down but
both routers stay connected through a multi-hop LDP session. That
happens because r1 and r2 have a targeted adjacency created by
the pseudowire.  The test then checks whether the pseudowire is
still up, using an alternate path for nexthop resolution.

Everything's fine except for the fact that LDP GTSM (aka
ttl-security) is enabled by default. This means that messages sent
over a multi-hop session are not delivered. In the case of this
test, it can prevent PW-Status notifications from being delivered,
which in turn can prevent the pseudowire from coming back up.

Fix the test by disabling GTSM so that LDP multi-hop sessions can
work normally. This is in accordance with RFC6720 which mentions
that GTSM should be disabled (statically or dynamically) for
multi-hop sessions.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-06-15 12:59:45 -03:00
Donald Sharp
89f76cd132
Merge pull request #11407 from opensourcerouting/ldp_topo1_fix
tests: fix sporadic failures in the ldp_topo1 topotest
2022-06-14 20:27:01 -04:00
Kuldeep Kashyap
697ce62f7a tests: Verify PIM neighbor and static routes for BSM tests
Verifying and making sure PIM neighbors are
up before sending BSM packet using Scapy.

Verifying static routes are installed before
proceeding fruther.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-06-14 14:23:09 -07:00
Donald Sharp
853585a7cd tests: Fix verify_rib such that it will look at the selected route
When you have a static route with multiple different admin
distances there exists a chance that route will have been
installed multiple times due to system load when inserted
at about the same time.  If this is the case then the
verify_rib function can and will select the wrong route
that happens to have a nexthop group that is still installed.

Modify verify_rib to ensure that the route that is going to
be looked at for nexthop correctness is the actual installed
route, not a previous version of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-14 12:21:19 -04:00
ARShreenidhi
2cdca5164e tests : bgp_default_originate testcase topology1 added
Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-14 15:40:19 +00:00
ARShreenidhi
0d06640b85 tests : bgp default-originate api are added
Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-14 15:40:19 +00:00
Renato Westphal
1c333cbed9 tests: fix sporadic failures in the ldp_topo1 topotest
The sporadic failures were happening because, under heavy load,
the r4 router could form an OSPF adjacency with r3 a few seconds
before doing the same with r2. In that interim, LDP could establish
a neighborship with r2 going through r3 (instead of connecting
directly). That would cause all label mappings received from r3
to be ignored since they can't be mapped to the routes' nexthops
received from zebra, causing all sorts of test failures. None of
this is erroneous behavior as LDP simply follows the IGP.

The fix consists of updating the test to ensure all expected OSPF
adjacencies fully converged before proceeding to the LDP checks.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-06-14 12:21:30 -03:00
Russ White
ab6fa0d2d2
Merge pull request #11343 from opensourcerouting/fix/local_preference_plus_minus_route_maps
bgpd: Initialize attr->local_pref to the configured default value
2022-06-14 06:53:08 -04:00
Kuldeep Kashyap
c76f268609 tests: Add multicast-pim-uplink-topo1 test suite
Adding 9 test cases to verify multicast PIM
uplink(8 uplink) functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-06-14 02:26:22 -07:00
Kuldeep Kashyap
e46ce55e22 tests: Add framework support for multicast-pim-multi-uplink automation
Added framework support to create and verify multicast
PIM multi-uplink topology and confiuration

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-06-14 02:26:08 -07:00
Donald Sharp
c013948ef9
Merge pull request #11358 from opensourcerouting/fix/implicit_withdraw_for_vrf_leaking_with_route_maps
bgpd: Fix VRF leaking when import/export RT list changed with route-maps
2022-06-13 07:46:18 -04:00
Donatas Abraitis
c170a6084f tests: Check if old paths are flushed when import/export RT list was changed
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-10 15:15:04 +03:00
Russ White
aaca054dac
Merge pull request #11259 from kuldeepkash/multicast_pim_dr_nondr
tests: [Topojson] Enhance CLI logging
2022-06-09 13:42:29 -04:00
Donald Sharp
b2e37a56f6 tests: Clarify what test_pim_dr_nondr_with_static_routes_topo1.py is doing
There are a couple steps listing what is being done that are both inprecise
and missleading.  Fix to actually say what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-09 09:36:11 -04:00
Pushpasis Sarkar
aa800819cd
Merge pull request #11312 from opensourcerouting/feature/draft-ietf-idr-bfd-subcode
bgpd: Add Notification CEASE BFD Down message
2022-06-07 21:27:12 +05:30
Olivier Dugeon
96b706b72a
Merge pull request #11334 from ton31337/fix/deprecation_warning
ospfd: Remove local-block deprecated command
2022-06-07 17:38:52 +02:00
Donald Sharp
a775175bfd
Merge pull request #11289 from LabNConsulting/chopps/ospfapi-update
ospfapi improvements and fixes
2022-06-07 11:00:56 -04:00
Donatas Abraitis
d2e02cbf64 ospfd: Remove local-block deprecated command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-07 16:11:46 +03:00
Donatas Abraitis
0f05ea43b0 bgpd: Initialize attr->local_pref to the configured default value
When we use network/redistribute local_preference is configured inproperly
when using route-maps something like:

```
network 100.100.100.100/32 route-map rm1
network 100.100.100.200/32 route-map rm2

route-map rm1 permit 10
 set local-preference +10
route-map rm2 permit 10
 set local-preference -10
```

Before:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
10
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
0
```

After:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
110
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
90
```

Set local-preference as the default value configured per BGP instance, but
do not set LOCAL_PREF flag by default.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-06 10:28:50 +03:00
Christian Hopps
ad9c18f375 tests: add opaque api test
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Christian Hopps
b538baf352 ospfd: add all_rtrs route table when opaque enabled
The reachable router table is used by OSPF opaque clients in order to
determine if the router advertising the opaque LSA data is
reachable (i.e., 2-way conectivity check).

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-02 16:37:16 -04:00
Jafar Al-Gharaibeh
23a1220847
Merge pull request #11175 from louis-6wind/ip-vrf-exec
topotests: fix "ip vrf exec"
2022-06-02 13:33:49 -05:00
Donatas Abraitis
aebe2e379f bgpd: Add Notification CEASE BFD Down message
Related: https://datatracker.ietf.org/doc/html/draft-ietf-idr-bfd-subcode

When BFD Down notification comes and BGP is configured to track on BFD events,
send BGP Cease/BFD Down notification to the peer.

If RFC 8538 is enabled (Notification support for Graceful-Restart), notification
should be encapsulated into Hard Reset message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-02 16:06:57 +03:00
Donald Sharp
0a0533a9a6 tests: Remove duplicated work
If at first you succeed try try again.
No I mean if it works the first time no need to do
the same command again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-31 09:45:38 -04:00
Russ White
24738fbee8
Merge pull request #10997 from Orange-OpenSource/isis-sr
isisd: Stop fulfill MPLS table when SR is disabled
2022-05-31 08:27:56 -04:00
Donald Sharp
019a4d6cd5 tests: Convert test_ospf_gr_helper into running more parallel
With this change run time in parallel for these tests go from
10:37 -> 4:11 on my machine.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-27 08:57:11 -04:00
Louis Scalbert
49d72f2d49 topotests: fix "ip vrf exec"
"ip vrf exec" command is not possible in the topotest shell.

> root@r1:~# ip vrf exec r1-cust5 bash
> mkdir failed for /sys/fs/cgroup/unified: No such file or directory
> Failed to setup vrf cgroup2 directory

Remount cgroup after remounting sysfs.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-27 10:32:29 +02:00
Donald Sharp
da72986a9b test: Abstract common functions from script break ups in test_bgp_auth.py
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-26 12:17:21 -04:00
Donald Sharp
f30959147f tests: Break up test_bgp_auth.py into 4 test scripts
This breakup converts run times for test_bgp_auth.py from
~9 minutes to just over 2 and a half minutes of run
time when running in parallel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-26 12:17:17 -04:00
Olivier Dugeon
7700a88aa5 isisd: Stop fulfill MPLS table when SR is disabled
When Segment Routing is disabled, if isisd received LSP with Segment Routing
information, in particular prefix SIDs, it installs corresponding MPLS entries
while it should not as SR is disabled.

This patch adds extra control to verify if SR is enabled or not before
configuring MPLS LFIB & IP FIB with prefix SIDs and adjust SR & TI-LFA
tests accordingly.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2022-05-25 17:29:21 +02:00
Donald Sharp
ed074aa182
Merge pull request #11239 from opensourcerouting/feature/topotests_for_notification_gr
tests: Add Notification support for Graceful-Restart tests
2022-05-25 10:07:49 -04:00
Olivier Dugeon
e207eaa32c
Merge pull request #11267 from donaldsharp/cspf_topo1_scale_fix
tests: Allow cspf_topo1 to function correctly at scale
2022-05-25 13:19:34 +02:00
Donald Sharp
882a8c7a71 tests: Allow cspf_topo1 to function correctly at scale
The cspf_topo1 test is comparing the adj-sid value that is
assigned dynamically based upon bring up order.  Under very
large scale this order changes causing the test to fail.
Since the adj-sid is dynamically allocated and appears to
be tested elsewhere, let's remove it from the grab all check.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-24 09:15:40 -04:00
Louis Scalbert
c8d2816ee5 topotests: isis-lfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt1 and rt2
- The no link-detect setting on rt1 eth-rt2 is still present so that
  zebra does not take account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for BFD to comes down

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
9cdc099bb5 topotests: isis-lfa add a switchover test after neighbor clear
Add a switchover test that consists in clearing the rt2 neighbor on rt1.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
c99ef48962 topotests: isis-lfa add a switchover test after hello timeout
Add a switchover test that consists in:
- Setting no link-detect on rt1 eth-rt2 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt1 eth-rt2 from the switch side
- Wait for the hello timer expiration

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
5558ac984f topotests: isis-lfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
e45958e9cf isisd: fix metric calculation of classic lfa backup prefixes
The isis-lfa-topo1 topotest shows backup routes with lower metrics than
the primary ones.

> rt1# show isis route
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::1/128  0       -          -                          -
>  2001:db8:1000::2/128  20      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>  2001:db8:1000::3/128  20      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>  2001:db8:1000::4/128  20      eth-rt4    fe80::5ced:29ff:feed:59c4  -
> (...)
>
> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  15      eth-rt3    fe80::946b:d4ff:fe5b:414b  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>                                eth-rt6    fe80::ac8c:dff:feac:8a8d   -
>  2001:db8:1000::3/128  15      eth-rt2    fe80::d091:eeff:fe09:31cd  -
>                                eth-rt5    fe80::847d:feff:fe74:bdde  -
>  2001:db8:1000::4/128  45      eth-rt5    fe80::847d:feff:fe74:bdde  -
> (...)

Backup routes metrics are incorrect because they only take into account
the path metric but not the prefix metric.

Add the prefix metric to the path metric on backup routes.

After the patch with a prefix metric of 10:

> rt1# show isis route backup
> Area 1:
> IS-IS L1 IPv6 routing table:
>
> Area 1:
> IS-IS L1 IPv6 routing table:
>
>  Prefix                Metric  Interface  Nexthop                    Label(s)
>  ------------------------------------------------------------------------------
>  2001:db8:1000::2/128  25      eth-rt3    fe80::8c6f:8aff:fe10:ad0d  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>                                eth-rt6    fe80::4810:47ff:fe81:2b9a  -
>  2001:db8:1000::3/128  25      eth-rt2    fe80::e855:12ff:fe31:5765  -
>                                eth-rt5    fe80::b08e:5cff:fe90:62dd  -
>  2001:db8:1000::4/128  55      eth-rt5    fe80::b08e:5cff:fe90:62dd  -

Fixes: e886416f81 ("isisd: add support for classic LFA (RFC 5286)")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
e83a52698b topotests: isis-tilfa add a switchover test after BFD down
Add a switchover test that consists in:
- Setting up ISIS BFD between rt5 and rt6
- Setting no link-detect on rt6 eth-rt5 so that zebra does not take
  account linkdown events on this interface.
- Shutting down rt6 eth-rt5 from the switch side

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Louis Scalbert
bac0d1e606 topotests: isis-tilfa add a switchover test after linkdown
Add a switchover test that consists in shutting down an interface.

Check that the switchover between primary and backup happens before the
SPF re-computation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-05-24 10:06:05 +02:00
Kuldeep Kashyap
fb943df10b tests: [Topojson] Enhance CLI logging
As of now we are logging only JSON output of CLIs
in topotests(topojson) executions and same o/p is
getting printed twice, which is of no use.

Enhanced code to show both plain and JSON output
of CLIs and remove duplicate logging.

It will help in reducing execution logs and in
verification, if sometimes there is mis-match
in CLI plain and JSON outputs.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-05-23 23:34:19 -07:00
Donald Sharp
2ca908755c tests: pbr_topo1 sometimes fails under really heavy load
This test is sometimes failing under severe load.  Give some time
for the linux rule installation to actually be registered by the
system before declaring failure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-23 15:28:46 -04:00
Donatas Abraitis
972426602a tests: Add Notification support for Graceful-Restart tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-22 22:40:22 +03:00
Donald Sharp
006ef829d8 tests: Allow a bit longer for bfd topo tests to synchronize
Allowing only 4 seconds for a bfd test to synchronize is going
to run into problems on extremely loaded systems.  The test
system should value it actually converged over it actually
converged in a reasonable time, especially on test systems
that are loaded because of many multiples of tests running
at the same time.  If it is important to actually test
that something got done by the RFC, the CI system as it
is currently written is not the correct place for this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 10:31:48 -04:00
Donald Sharp
cb8018f4c3 tests: Make verify_rib wait up to 40 seconds.
Under heavy load I am seeing verify_rib failing after 12 seconds
but succeeding after 17:

2022-05-19 18:52:54,374 DEBUG: topolog: Exiting lib API: verify_rib
2022-05-19 18:52:54,374 DEBUG: topolog: Function returned True
2022-05-19 18:52:54,374 WARNING: topolog: RETRY DIAGNOSTIC: SUCCEED after FAILED with requested timeout of 12.0s; however, succeeded in 14.7s, investigate timeout timing

There is no reason to not have the test wait a bit longer for very very
heavily loaded systems.  Change the time to 40 seconds.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 10:31:48 -04:00
Donald Sharp
6ec742d95f tests: Ensure routes are not queued when calling verify_rib
Lots of tests call verify_rib that takes a list of routes that
need to be verified in some fashion.  This verify_rib functionality
will try up to 12 seconds before failing the check that zebra
has the route and has installed it.

Unfortunately the verify_rib code was not looking to see if
the route was queued for installation and was then allowing
tests to immediately do subsuquent steps that depended on
that route actually being installed sometimes causing tests
to fail.

Write a bit of additional code that looks at the queued
status and allows the test to wait a bit longer for zebra
to finish processing before allowing the test to move on
to the next bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-20 10:31:48 -04:00
Kuldeep Kashyap
58cfbb272d tests: Fix for test_pim_dr_nondr_with_ospf_topo2 test failure
This test is failing intermittently because sometimes igmp
local join is not getting deleted. I did split the joins means
trying to delete igmp local joins one by one. I tried running
tests multiple times and it seems to be working fine with
current changes.

There was an issue found during debugging this test failure,
which was raised already:
Issue# https://github.com/FRRouting/frr/issues/11105

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-05-16 03:28:02 -07:00
sarita patra
c28e6ef53c tests: Inroduced pim passive test cases
Co-authored-by: Vijay Kumar Gupta <vijayg@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2022-05-12 23:51:22 -07:00
Igor Ryzhov
2a3807c3ce
Merge pull request #11163 from opensourcerouting/fix/same_type_casting
*: Avoid casting to the same type as on the left
2022-05-10 00:16:30 +03:00
Donatas Abraitis
8998807f69 *: Avoid casting to the same type as on the left
Just not necessary.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-08 16:07:42 +03:00
Donald Sharp
4c98b89e5c *: Fix doesnt spelling mistakes
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-06 20:38:40 -04:00
Donatas Abraitis
50f1f2e724
Merge pull request #11059 from anlancs/fix/bgpd-evnp-wrong-check-hashget
bgpd: fix memory leak for evpn
2022-05-04 21:19:51 +03:00
Donald Sharp
b7597a8532 tests: Use XCALLOC instead of XMALLOC for threads
Someone decided to do malloc testing over make check.

Fixes: #11120
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-02 13:00:47 -04:00
anlan_cs
8e3aae66ce *: remove the checking returned value for hash_get()
Firstly, *keep no change* for `hash_get()` with NULL
`alloc_func`.

Only focus on cases with non-NULL `alloc_func` of
`hash_get()`.

Since `hash_get()` with non-NULL `alloc_func` parameter
shall not fail, just ignore the returned value of it.
The returned value must not be NULL.
So in this case, remove the unnecessary checking NULL
or not for the returned value and add `void` in front
of it.

Importantly, also *keep no change* for the two cases with
non-NULL `alloc_func` -
1) Use `assert(<returned_data> == <searching_data>)` to
   ensure it is a created node, not a found node.
   Refer to `isis_vertex_queue_insert()` of isisd, there
   are many examples of this case in isid.
2) Use `<returned_data> != <searching_data>` to judge it
   is a found node, then free <searching_data>.
   Refer to `aspath_intern()` of bgpd, there are many
   examples of this case in bgpd.

Here, <returned_data> is the returned value from `hash_get()`,
and <searching_data> is the data, which is to be put into
hash table.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-05-03 00:41:48 +08:00
Kuldeep Kashyap
4fafd29f0f tests: [PIMv6] Using generic names for pim verification APIs
1. Modified pim APIs name to generic one, same APIs would be used for PIMv4 and PIMv6
verifications
2. Modified all affacted scripts and ran multiple times locally to avoid CI failures

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-04-30 10:57:31 +05:30
Donald Sharp
fcf6dce79a tests: Correctly align variable type in tests
New compilers are noticing that the tests are compiling with
a pointer for the bgpd_privs variable while the bgp library
that is being linked against is not a pointer.  Since
these tests had the declaration just to make the compiler
happy, let's actually align the variable type to make the
compiler even happier.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-27 08:16:50 -04:00
Donatas Abraitis
77e3d82167 bgpd: Add set as-path replace <any|ASN> cmd for route-maps
```
route-map tstas permit 10
 set as-path replace 1
exit
```

Before:

```
donatas-laptop(config-router-af)# do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
      Last update: Mon Apr 25 10:39:50 2022
```

After:

```
donatas-laptop(config-router-af)# do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 65010 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
      Last update: Mon Apr 25 10:40:16 2022
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-25 14:05:22 +03:00
Jafar Al-Gharaibeh
181b6f4377
Merge pull request #7811 from kuldeepkash/multicast_pim_dr_nondr
tests: Add multicast_pim_dr_nondr_test suite
2022-04-20 12:52:46 -05:00
Donald Sharp
4563e2047a tests: Fix spelling of conjuction
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:28:09 -04:00
Donald Sharp
2b669d3a21 *: Fix spelling of overriden
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:27:02 -04:00
Donald Sharp
53c7a86eec *: Fix spelling of Verfiy
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:26:00 -04:00
Donald Sharp
3f1f5852b1 tests: Fix spelling of Initilized
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:22:47 -04:00
Donald Sharp
3819e4ced7 *: Fix spelling of inteface
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:21:31 -04:00
Donald Sharp
ce5002c659 *: Fix spelling of comparision
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:18:43 -04:00
Donald Sharp
e3fde76840 *: Fix spelling of modfiy
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:17:58 -04:00
Donald Sharp
b515c81a22 tests: Fix spelling of 'registred'
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:09:36 -04:00
Russ White
1258cfcd8c
Merge pull request #11001 from donaldsharp/system_route_recursion
zebra: Allow system routes to recurse through themselves
2022-04-18 09:47:47 -04:00
kuldeepkash
40c28c860a tests: Add multicast_pim_dr_nondr_test suite
1. Added test cases to test/verify multicast_pim_dr_nondr scenarios

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2022-04-12 02:39:39 +05:30
Donald Sharp
747aa92e74 tests: Do not turn off multicast stream
The test is testing whether interface flaps are causing
the appropriate pim reactions.  Unfortunately the test
is turning off the multicast stream and the test also
has a keep alive timer of 15 seconds set on all routers.
Which of course means the test has 15 seconds(at most) to finish
testing.  This is not always possible given system loads.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-10 07:47:38 -04:00
Donald Sharp
184ab61ee3 tests: Fix test_multicast_pim_sm_topo3.py from generating a support bundle
The test_multicast_pim_sm_topo3.py test is both spending extra time
looking for state that will never occurr but also generating a support
bundle when it doesn't find it.  Fix the test to come to the correct
solution faster.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-10 07:47:18 -04:00
Donald Sharp
efcd39d87b tests: Add a test case for a kernel route depending on a kernel route
Add a test case where a kernel route depends on a kernel route
and when you perturb an interface, ensure that FRR does not
loose the route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-09 15:52:58 -04:00
Donald Sharp
91a5a6e75c tests: Add a test to ensure that FRR does not loose kernel routes
Add a test case to ensure that Kernel routes are not lost
when there are multiple overlapping connected routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08 08:15:20 -04:00
Jafar Al-Gharaibeh
eeeed628a3
Merge pull request #10946 from donaldsharp/pim_fhr_lhr_same_pimreg
pimd: Send immediate join( with possible SG RPT prune bit set
2022-04-04 14:00:49 -05:00
Jafar Al-Gharaibeh
a46dd803b6
Merge pull request #10954 from donaldsharp/speell
Speell
2022-04-02 19:08:30 -05:00
Donald Sharp
d94ee2727b tests: Fix spelling of disbale
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02 07:46:19 -04:00
Donald Sharp
17be83bf99 *: Fix spelling of Gracefull
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02 07:46:19 -04:00
Donald Sharp
3b52866c0f tests: Fix spelling of neigbors
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02 07:24:03 -04:00
Christian Hopps
9a33889d89
Merge pull request #10925 from qlyoung/fix-grpc-wants-installed-frr
tests: skip grpc test if frr not installed
2022-04-02 05:22:53 -04:00
Donald Sharp
d60a3f0e71 tests: Fix spelling of daemons
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:26:38 -04:00
Donald Sharp
953ef1498f tests: Fix spelling of kernel
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:25:19 -04:00
Donald Sharp
dea6dce388 tests: Fix perticular spelling
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 16:24:33 -04:00
Donatas Abraitis
2d5bac3f7e
Merge pull request #10950 from donaldsharp/uninit_test
tests: Fix uninitialized usage of variables in tests
2022-04-01 22:26:53 +03:00
Donald Sharp
515f5f4d7e tests: Fix uninitialized usage of variables in tests
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 09:14:11 -04:00
Donald Sharp
de3d6b4db4 tests: Reduce some pim test timings to more manageable levels
a) Remove the retry mechanism to continue looking for 75%
of the time for pim code.

   This alone saves a bunch of time in tests that use lib/pim.py
   Effectively all the times given for retry are already long
   enough.  Additionally some tests are gathering data with
   the expectation that they will not find data so the entire
   time is being taken up in retry's.  Extending the retry
   mechanism makes this even worse.  This is especially bad
   for pim in that keep alive timers are counting down and
   state can be removed due to excessive time waiting.

b) Reduce verify verify_multicast_traffic from 40 seconds
to 20 seconds to gather traffic data.

   A bunch of tests are doing this:
   a) gather pre test start traffic data( taking about 70
   seconds to run, because a bunch of time it was looking
   for data that does not exist yet)
   b) run a change to introduce a different traffic flow
   c) gather post test traffic data ( taking about 70
   seconds to run )

   Why does this matter?  Tests were iterating through
   all the different routers looking for traffic flow
   as well as different mroute state.  This is against
   the keepalive timer of 210 seconds.  It does not take
   long before the stream can be removed and the test is
   still looking for data that is no longer there due
   to state timeout.

   The multicast_pim_sm_topo3/test_multicast_pim_sm_topo3.py
   test reduced run time from 398 seconds to 297 seconds.
   Greatly reducing keepalive timeout problems.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-01 09:01:38 -04:00
Donatas Abraitis
f70c91dcef bgpd: Add %pBP printfrr() extension to print IP(hostname) for BGP peer
Replace existing bgp_peer_hostname() function.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-31 21:20:11 +03:00
Quentin Young
9d3a021262 tests: skip grpc test if frr not installed
it wants yang models installed which will only be there if frr has been
installed before, causing `make check` to fail when run on a system on
which frr has not been installed when GRPC is enabled (--enable-grpc)

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-03-29 16:16:35 -04:00
Russ White
c845d58d6f
Merge pull request #10158 from ckishimo/ospf6d_norefresh
ospf6d: stop refreshing type-5 from NSSA
2022-03-29 08:36:05 -04:00
ckishimo
9a974f2292 ospf6d: fix topotest
The routes in the test_nssa_range() are E2

  "routes":{
    "2001:db8:1000::2/128":{
      "destinationType":"Network",
      "installedTimeSince":"00:06:29",
      "changedTimeSince":"00:06:29",
      "numberOfLock":2,
      "flags":"BA--",
      "associatedArea":"0.0.0.2",
      "pathType":"External-2",
      "lsOriginRoutePathType":"NSSA",
      "lsId":"0.0.0.3",
      "lsAdvertisingRouter":"10.254.254.4",
      "options":"--|-|-|--|-|--",
      "routerBits":"--------",
      "prefixOptions":"--|P|--|--|--",
      "metricType":2,
      "metricCost":10,
      "metricCostE2":20,
      "pathsCount":1,
      "nextHopCount":1,
      "nextHops":[
        {
          "nextHop":"::",
          "interfaceName":"r2-eth2"
        }
      ]
    }

This PR fixes the key from `metricCost` to `metricCostE2`

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-03-28 22:19:53 +02:00
Mobashshera Rasool
3649d8f86c tests: Add the show database for ospfv3 before checking for ospf route
Moved the database dump for ospfv3 before ospf route check.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-23 04:08:14 -07:00
Kuldeep Kashyap
98ae5f4f35 tests: Adding bgp_vrf_dynamic_route_leak_topo4 suite
1. Added 3 test cases to veirfy bgp vrf dynamic route leak functionality
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:35 +05:30
Kuldeep Kashyap
133fd9edbe tests: Adding bgp_vrf_dynamic_route_leak_topo3 test suite
1. Added 4 test cases to verify bgp vrf dynamic route leak functionlality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:35 +05:30
Kuldeep Kashyap
39c661a063 tests: Framework changes to support bgp vrf dynamic route leak automation
1. Enhance framework to support bgp vrf dynamic route leak automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:20 +05:30
Christian Hopps
3e771d60be
Merge pull request #10817 from kuldeepkash/micronet_fixes
tests: Fix topotests crash when KeyError found
2022-03-18 12:21:02 -04:00
Martin Winter
f76ce0e0e0
Merge pull request #10705 from kuldeepkash/cut_execution_time
tests: Adding EVPN-GR scenario to evpn_type5 suite
2022-03-17 16:33:59 -07:00
Kuldeep Kashyap
77e578c90e tests: Fix topotests crash when KeyError found
1. Handle KeyError
2. logger object is defined in main function and its not not accessible
   in other functions so defined it in local functions.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-17 17:29:43 +05:30
Mobashshera Rasool
a73e89ddbc tests: Adding database information in ospfv3 testcase
Improving the test case to show database info as well
to help narrow down whether its a LSA origination problem or
route calculation problem in case of failures.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-16 23:59:05 -07:00
Jafar Al-Gharaibeh
51012eb636
Merge pull request #9262 from gpnaveen/ospfv3_basic_tests
tests: adding ospfv3 base cases.
2022-03-16 11:06:19 -05:00
Jafar Al-Gharaibeh
93a7f236ac topotest: enable pim when detecting pim using unified config
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-15 22:29:52 -05:00
nguggarigoud
d1b5fa5b9e tests: adding ospfv3 base cases.
Covers basic test case like route map, rte calc.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-03-15 19:58:51 -07:00
Russ White
5d97021ba3
Merge pull request #10427 from sworleys/Protodown-Reason-Upstream
Add Support for Setting Protodown Reason Code
2022-03-15 19:58:16 -04:00
Donald Sharp
b975463458
Merge pull request #10643 from Jafaral/ospf-multi-vrf
tests: add a topotest for ospf, mutli vrf, and route leaking
2022-03-15 18:58:03 -04:00
Jafar Al-Gharaibeh
83e839d6b6 topotests: pytest mark bgpd
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-15 15:55:26 -05:00
Kuldeep Kashyap
cbeda33d01 tests: Adding EVPN-GR scenario to evpn_type5 suite
1. Adding EVPN-GR scenario to evpn_type5 suite

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-15 07:10:18 +05:30
Donald Sharp
341e1d6e0a
Merge pull request #10738 from LabNConsulting/chopps/fixgrpc
fixes for grpc module
2022-03-14 14:57:59 -04:00
Christian Hopps
e00241ad9f tests: new grpc topotest
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-14 11:14:12 -04:00
Christian Hopps
3f264d54f9 tests: analyze should also check /tmp/topotests/topotests.xml
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-14 11:14:12 -04:00
Christian Hopps
c451c0296c tests: lib: fix grpc unit-test
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-03-14 11:14:12 -04:00
Donald Sharp
3e553c80ba
Merge pull request #10779 from opensourcerouting/typesafe-backflip
lib: typesafe container reverse iterators
2022-03-13 09:26:26 -04:00
David Lamparter
643ea83be2 lib: add _last and _prev on typesafe RB/DLIST
RB-tree and double-linked-list easily support backwards iteration, and
an use case seems to have popped up.  Let's make it accessible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 13:23:36 +01:00
Donatas Abraitis
4778843161
Merge pull request #10778 from donaldsharp/command_logging
tests: Make all commands logged
2022-03-12 10:43:57 +02:00
Donald Sharp
a7c0a04f09 tests: Make all commands logged
Do not allow the test system to turn off the logging of commands
Some tests use the reload command that is accidently turning off
the logging.  Just force the tests to ignore it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 11:19:29 -05:00
David Lamparter
543a26848d lib: add %pFXh to print prefix w/o prefixlen
Mostly for pimd, for the time being.  May be removed again if unused.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
Stephen Worley
0605d4b846 tests: add protodown topotest using sharpd
Add a protodown topotest using sharpd.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00
Russ White
82934a6a32
Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmds
Feat isis json show cmds
2022-03-08 11:15:25 -05:00
Jafar Al-Gharaibeh
f73b0cc825 tests: add a topotest for ospf, mutli vrf, and route leaking
Test ospf running with 3 vrfs: default, neno, ray
Route leaking is setup via bgp between default and neno vrfs
Leaked routes include connected and ospf

Included test:
 1- OSPF convergnce
 2- zebra/kernel routes

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-03 23:09:15 -06:00
Javier Garcia
432f143212 topotest: Add test for isis json cmds.
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-03-02 16:21:29 +01:00
Donald Sharp
4e7a5f06be
Merge pull request #10668 from Jafaral/frr-conf-topotest
topotests: add support for frr.conf as a unified config
2022-02-28 10:28:10 -05:00
Jafar Al-Gharaibeh
a4b4bb5077 topotests: add support for frr.conf as a unified config
This PR adds support for configuring topotest routers using a single file.
  instead of:
```
        router.load_config(
	    TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
	    )
	router.load_config(
	    TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
	    )
	router.load_config(
	    TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
	    )
```
  you can now do:
```
        router.load_frr_config(
	    os.path.join(CWD, "{}/frr.conf".format(rname)),
	    [TopoRouter.RD_ZEBRA, TopoRouter.RD_OSPF, TopoRouter.RD_BGP]
	    )
```
or just:

```
        router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
```
In this latter case, the daemons list will be inferred from frr.conf file.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-02-27 20:53:18 -06:00
David Lamparter
9b6ef21e51 tests: use PRNG in checksum test
(And don't try to go beyond fletcher checksum offset special value.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-26 16:49:12 +01:00
David Lamparter
89087f23b5 lib: use iovec for checksum code
... to allow checksumming noncontiguous blurbs of data.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-02-26 16:49:12 +01:00
Christian Hopps
7bf63db79b
Merge pull request #10632 from donaldsharp/thread_return_null
*: Change thread->func to return void instead of int
2022-02-24 01:43:48 -05:00
Donald Sharp
cc9f21da22 *: Change thread->func to return void instead of int
The int return value is never used.  Modify the code
base to just return a void instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23 19:56:04 -05:00
Russ White
1e982fdbdf
Merge pull request #10385 from iqras23/nh
zebra: Nexthop tracking, route resolution recursive lookup
2022-02-23 16:45:36 -05:00
Igor Ryzhov
474f8e031d
Merge pull request #10585 from ton31337/feature/advmap_set
bgpd: Allow setting attributes over route-maps for conditional advert…
2022-02-23 19:23:03 +03:00
Iqra Siddiqui
9c46c484fe tests: Fix style issues in common_config.py
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-02-22 09:29:48 -08:00
Iqra Siddiqui
055f21c49d tests: Add supporting test to validate NH resolution logic
Co-authored-by: Vijay Kumar Gupta <vijayg@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-02-22 09:28:00 -08:00
Russ White
85a12b7c59
Merge pull request #10625 from Jafaral/ospf-ns-vrf
topotests: give  a couple of ospf topotests better descriptive names
2022-02-22 11:28:19 -05:00
Louis Scalbert
0bc7685206 topotests: set router name as title in screen and xterm
When running a topotest with the --shell or --vtysh argument, the
window titles of the routers are generic.

Set the router name as title to identify correctly the window.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-02-21 10:06:48 +01:00
Louis Scalbert
ce530b418f topotests: fix usage of screen
Opening new tab in screen is not possible when using option --vtysh or
--shell. Error 'No such file or directory'.

Fix the issue.

Fixes: 6a5433ef0b ("tests: NEW micronet replacement for mininet")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-02-21 10:06:44 +01:00
Jafar Al-Gharaibeh
f2f5c98601 tests: rename topotest ospf_topo1_vrf to ospf_netns_vrf
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-02-20 14:12:43 -06:00
Jafar Al-Gharaibeh
59bc746288 tests: rename topotest ospf_topo2 to ospf_unnumbered
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-02-20 13:57:56 -06:00
Donatas Abraitis
51c3a7deed bgpd: Allow setting attributes over route-maps for conditional advertisements
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-18 11:46:05 +02:00
Donald Sharp
8031b96e2e tests: Cleanup test_route_map_topo1.py from pylint
noticed that pylint was complaining about some easily
fixable stuff in test_route_map_topo1.py so let's clean
it up some.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-16 15:17:11 -05:00
Russ White
8f689a6e8d
Merge pull request #10546 from ton31337/fix/check_for_null_inside_unintern
bgpd: Check for NULL inside aspath_unintern()
2022-02-15 12:59:45 -05:00
Donald Sharp
e1f79be5ed tests: Fix spelling and grammar mistakes
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-14 12:55:20 -05:00
Donatas Abraitis
b7b3e63cc0 bgpd: Check for NULL inside aspath_unintern()
It's not always guarded, just check inside.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-09 16:41:14 +02:00
Abhinay Ramesh
0afa645317 tests: Added ospf6 authentication trailer topotest
Have added topotest to verify below combination.
Auth support for md5
Auth support for hmac-sha-256
Auth support with keychain for md5
Auth support with keychain for hmac-sha-256

Have sussessfully run all 4 test cases in my local setup.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2022-02-09 01:57:08 +00:00
Donald Sharp
b564209367
Merge pull request #8458 from opensourcerouting/xref-5424
lib: RFC5424 syslog support
2022-02-08 15:56:20 -05:00
Igor Ryzhov
21b5cd1d16 tests: fix strings with topologies
Add `r` prefix to treat backslashes as literals.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-02-08 17:00:44 +03:00
Russ White
107f77b56f
Merge pull request #10517 from idryzhov/isis_router_cap_tlv_fixes
isisd: fix router capability TLV parsing issues
2022-02-08 08:35:45 -05:00
Russ White
3f544261af
Merge pull request #10293 from rgirada/ospf_lsid
ospfd: Modifying LSID generation algorithm
2022-02-08 08:33:33 -05:00
Russ White
e735c8073c
Merge pull request #9649 from proelbtn/add-support-for-end-dt4
add support for SRv6 IPv4 L3VPN
2022-02-08 08:30:02 -05:00
Juraj Vijtiuk
9ba865f54d isisd: fix router capability TLV parsing issues
isis_tlvs.c would fail at multiple places if incorrect TLVs were
received causing stream assertion violations.
This patch fixes the issues by adding missing length checks, missing
consumed length updates and handling malformed Segment Routing subTLVs.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>

Small adjustments by Igor Ryzhov:
- fix incorrect replacement of srgb by srlb on lines 3052 and 3054
- add length check for ISIS_SUBTLV_ALGORITHM
- fix conflict in fuzzing data during rebase

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-02-08 11:31:45 +03:00
Olivier Dugeon
62f79ac129 tests: Add CSPF topotest
Add new topotest for the Constraints ShortestPath First (CSPF) algorithm.
This topotest uses IS-IS-TE as base network to populate a Traffic Engineering
Database (TED) and sharpd to call cspf algorithms on this IS-IS-TE topology.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2022-02-02 17:04:12 +01:00
Olivier Dugeon
538f34cb20 lib: Correct bug for TE metric wrong assignement
When link-param is enabled for a given interface, TE metric is automatically
assigned to the metric of the interface. However, the metric of the interface
could be unassigned and keep the default value equal to 0. Thus, if the TE
metric is not explicitely modified within the `link-param metric` statement,
TE metric remains set to 0 which is not a valid value especially when
computing constrainted path.

This patch changes the assignement of the default value of the TE metric.
It is set to the metric of the interface only if the latter is not equal to 0.
TE topotests for OSPF and IS-IS have been adjusted accordingly.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2022-02-02 17:04:12 +01:00
Mark Stapp
cf8638ed34
Merge pull request #10464 from pguibert6WIND/negogiate
topotests: fix typo about bgp_dont_capability folder name
2022-02-01 13:00:54 -05:00
Russ White
e9a2378119
Merge pull request #10391 from gromit1811/bug_9720_ecmp_inter_area_topotest_3paths
tests: Topotest for checking ECMP inter-area nexthop handling
2022-02-01 10:55:13 -05:00
Philippe Guibert
0a1663ce3a topotests: fix typo about bgp_dont_capability folder name
The folder bgp_dont_capability.. was wrong. Use negotiate
instead of negogiate.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-02-01 16:52:20 +01:00
Martin Buck
5a104c8634 tests: Topotest for checking ECMP inter-area nexthop handling
Used to reproduce #9720 and may also serve as a regression test in the
future.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2022-01-31 08:31:00 +01:00
Donatas Abraitis
7a90d91586
Merge pull request #10408 from idryzhov/no-opaque-by-default
*: do not send opaque data to zebra by default
2022-01-28 12:54:16 +02:00
Donatas Abraitis
9d56cc8750
Merge pull request #10159 from taspelund/retain-peer-asn
bgpd: retain peer asn even with remove-private-AS
2022-01-28 09:22:06 +02:00
Donatas Abraitis
6766acddbf
Merge pull request #9880 from louis-oui/maximum-prefix-out
bgpd: fixes maximum prefix out
2022-01-27 08:49:31 +02:00
Louis Scalbert
49656aeb43 topotests: set bgp peer-group with maximum-prefix-out
Set different combinations of bgp peer-group with a maximum-prefix-out
value.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:50:11 +01:00
Louis Scalbert
c7ec458862 topotests: bgp no neighbor X.X.X.X maximum-prefix-out Y
Test the ability to use the following configure command with a Y value:

no neighbor X.X.X.X maximum-prefix-out Y

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:38:14 +01:00
Russ White
e48b2fea63
Merge pull request #10411 from idryzhov/if-config-vrf-name
*: do not print vrf name for interface config when using vrf-lite
2022-01-25 11:34:59 -05:00
Trey Aspelund
d20e1bba27 tests: add topotest for remove-private-AS
Introduces a topotest to validate proper AS-Path manipulation when using
"neighbor ... remove-private-AS".

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-01-24 20:06:50 +00:00
Igor Ryzhov
870791a3b5 *: do not send opaque data to zebra by default
Opaque data takes up a lot of memory when there are a lot of routes on
the box. Given that this is just a cosmetic info, I propose to disable
it by default to not shock people who start using FRR for the first time
or upgrades from an old version.

Fixes #10101.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 22:18:46 +03:00
Igor Ryzhov
788a036fdb *: do not print vrf name for interface config when using vrf-lite
VRF name should not be printed in the config since 574445ec. The update
was done for NB config output but I missed it for regular vty output.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 14:44:05 +03:00
Russ White
2d9e10d095
Merge pull request #10318 from donaldsharp/redistribution
OSPF Redistribution
2022-01-23 22:30:24 -05:00
Russ White
6bc879bb33
Merge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2
bgpd: Graceful-restart / LLGR with dynamic peers
2022-01-23 22:28:34 -05:00
rgirada
1478f0ad11 ospfd: topotest cases for LSID change algo
Description:
	Topotest cases for LSID change (RFC 2328 appendex-E)
	algorithm.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-01-22 04:10:20 -08:00
Louis Scalbert
f5b25d2c34 topotests: apply bgp maximum-prefix-out without clearing the neighbor
The current maximum-prefix-out topo-test starts a configuration with a
maximum-prefix-out.

Test the application of new maximum-prefix-out value without clearing
the neighbor.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-20 18:19:37 +01:00
Philippe Guibert
6f48266e1d topotests: isis vrf config changed
Use vrf keyword for interface, and directly configure isis under
that interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-01-20 16:19:14 +01:00
Donatas Abraitis
77411f45c8 tests: Lower keepalive/hold/connect timers for BGP LLGR test
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-19 15:02:08 +02:00
Donatas Abraitis
c617ad1d05 tests: Check if LLGR works with dynamic peers as well
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-19 15:02:08 +02:00
Stephen Worley
91cefe58fb
Merge pull request #10351 from mobash-rasool/topotest-ci-fix
tests: Fix random failure in test_PIM_hello_tx_rx_p1
2022-01-18 16:47:39 -05:00
Russ White
18ed776ca2
Merge pull request #9938 from Orange-OpenSource/isis_ls
isisd: Add Link State Traffic Engineering support
2022-01-18 10:12:08 -05:00
Russ White
05786ac774
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs
OSPF opaque route attributes
2022-01-18 09:08:38 -05:00
Donald Sharp
40e9c14429 tests: Add ospf_instance_redistribute testing
Redistribution for ospf with instance id's using instance id's
was incorrect.  Add some small tests to make sure it catches the
issues and we don't regress.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-18 08:39:40 -05:00
Rafael Zalamena
4e4c027803
Merge pull request #10183 from idryzhov/rework-vrf-rename
*: rework renaming the default VRF
2022-01-17 08:45:12 -03:00
David Lamparter
28297b1e84 tests: fuzzing target for zlog_5424 code
This just tries logging messages in random ways to allow the fuzzer to
do its thing and try to find weird edge cases.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
Mobashshera Rasool
3996d25e3c tests: Fix random failure in test_PIM_hello_tx_rx_p1
The test case test_PIM_hello_tx_rx_p1 is failing randomly because
sometimes the hello packet is received and sometimes not received while getting
the stats data.
When the hello packet is received HelloRx gets incremented to 1 and then
shutdown of the interface is executed which resets the stats to 0
and again when "no shutdown" of the interface is done, the stats get incremented to 1.
The test case checks after "no shutdown" of the interface whether the stats is incremented
but in this case although the stats got incremented the before and after value is same.
Hence the test case failed.

Adding correct expectations in the test case.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-16 04:00:11 -08:00
Renato Westphal
485e8b5662 tests: check if OSPF opaque attributes are installed in the RIB
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-15 17:22:27 +01:00
David Lamparter
2c76ba433f lib: add time formatting printfrr exts
Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 13:33:57 +01:00
David Lamparter
2c5b4d80ef lib: add s option to pI4/pI6/pIA printfrr
Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in
the output with a star (`*`).  This is primarily intended for use with
multicast, e.g. to print `(*,G)`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 11:57:46 +01:00
David Lamparter
d51f8b0f1e pimd: move %pSG4 to %pPSG4
Since this is only used in very few places, moving it out of the way is
reasonable.  (`%pSG` will be pim_sgaddr)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12 18:24:07 +01:00
ARShreenidhi
771ac547f1 tests: BGP : Dynamic route leak VRF lite (BGP-GR)
Authored-by: Shreenidhi A R <rshreenidhi@vmware.com>
Signed-off-by: Shreenidhi A R <rshreenidhi@vmware.com>
2022-01-08 10:21:10 -08:00
Donatas Abraitis
c5aef655d8 tests: Adopt bgp_shutdown_message test to a proper encoding
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-07 22:35:38 +02:00
Jafar Al-Gharaibeh
541b51a5a3
Merge pull request #10301 from donaldsharp/pim_multicast_fix
tools: Give longer for interface traffic in pim to work
2022-01-07 14:18:08 -06:00
Jafar Al-Gharaibeh
23b43aac0f
Merge pull request #10290 from donaldsharp/nhrp_topo_queries
Nhrp topo queries
2022-01-07 14:00:50 -06:00
Donald Sharp
758999b3e0 tests: Ensure packets have a chance to arrive in test_multicast_pim_sm_topo4.py
The test is doing this:

a) gather interface data about packets sent
b) shut interface
c) no shut interface
d) gather interface data about packets sent
e) compare a to d and fail if packets sent/received has not incremented

The problem is, of course, that under heavy system load insufficient time
might not have passed for packets to be sent between c and d.  Add up to
35 seconds of looking for packet data being incremented else heavily
loaded systems may never show that data is being sent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Donald Sharp
715d3774aa test: Cleanup via black the test_multicast_pim_sm_topo4.py
The test needed some cleanup via black formatting.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Donald Sharp
0b01a0bbc4 tests: Rename poorly named function
verify_pim_interface_traffic *fetches* the pim
traffic data.  Rename the function to what it
actually does

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Donald Sharp
3d162a6950
Merge pull request #10284 from ton31337/fix/adjust_rfc4486
bgpd: Adjust symbolic names for cease notifications according to rfc4486
2022-01-06 07:49:00 -05:00
Donald Sharp
60b5ff877a tests: Fixup output that was incorrect in nhrp_topo
The nhrp_topo test sets up some infrastructure and
was displaying the commands it was outputting
incorrectly.  Fix this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-06 07:33:11 -05:00
Donatas Abraitis
dcbebfd3ff bgpd: Graceful Restart restart-time can be 0
Using with LLGR, this should be allowed setting GR restart-time timer to 0,
to immediately start LLGR timers.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-06 11:24:48 +02:00
Donatas Abraitis
0ac7452334 bgpd: Adjust symbolic names for cease notifications according to rfc4486
The following subcodes are defined for the Cease NOTIFICATION
   message:

      Subcode     Symbolic Name

         1        Maximum Number of Prefixes Reached
         2        Administrative Shutdown
         3        Peer De-configured
         4        Administrative Reset
         5        Connection Rejected
         6        Other Configuration Change
         7        Connection Collision Resolution
         8        Out of Resources

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-06 10:07:41 +02:00
David Lamparter
fbfdb4f23a topotests: require Linux 5.0 for NHRP
It fails on 4.19, so let's go minimum 5.0 for the time being.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-05 21:00:40 +01:00
Russ White
d962e875fe
Merge pull request #10260 from ton31337/feature/bgp_llgr_helper_mode
bgpd: Implement LLGR helper mode
2022-01-05 10:08:31 -05:00
Russ White
074ad7cb59
Merge pull request #10219 from donaldsharp/l3vpn_to_bgp_vrf_fixes
tests: Further fix bgp_l3vpn_to_bgp_vrf
2021-12-30 18:42:21 -05:00
Donatas Abraitis
dabca69ee7 tests: Add basic BGP Long-lived Graceful restart tests
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-28 16:35:57 +02:00
Donatas Abraitis
1182f26489
Merge pull request #8494 from donaldsharp/wfi_failures
bgpd, tests: Add code to handle failed installations
2021-12-22 09:53:44 +02:00
Igor Ryzhov
ac2cb9bf94 *: rework renaming the default VRF
Currently, it is possible to rename the default VRF either by passing
`-o` option to zebra or by creating a file in `/var/run/netns` and
binding it to `/proc/self/ns/net`.

In both cases, only zebra knows about the rename and other daemons learn
about it only after they connect to zebra. This is a problem, because
daemons may read their config before they connect to zebra. To handle
this rename after the config is read, we have some special code in every
single daemon, which is not very bad but not desirable in my opinion.
But things are getting worse when we need to handle this in northbound
layer as we have to manually rewrite the config nodes. This approach is
already hacky, but still works as every daemon handles its own NB
structures. But it is completely incompatible with the central
management daemon architecture we are aiming for, as mgmtd doesn't even
have a connection with zebra to learn from it. And it shouldn't have it,
because operational state changes should never affect configuration.

To solve the problem and simplify the code, I propose to expand the `-o`
option to all daemons. By using the startup option, we let daemons know
about the rename before they read their configs so we don't need any
special code to deal with it. There's an easy way to pass the option to
all daemons by using `frr_global_options` variable.

Unfortunately, the second way of renaming by creating a file in
`/var/run/netns` is incompatible with the new mgmtd architecture.
Theoretically, we could force daemons to read their configs only after
they connect to zebra, but it means adding even more code to handle a
very specific use-case. And anyway this won't work for mgmtd as it
doesn't have a connection with zebra. So I had to remove this option.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-21 22:09:29 +03:00
Donald Sharp
9d472a3581
Merge pull request #10098 from opensourcerouting/ospf-gr-topotest-fix
ospfd: fix incorrect detection of topology changes in helper mode
2021-12-21 08:43:32 -05:00
Donald Sharp
be785e356a bgpd, tests: Add code to handle failed installations
Currently the Wait for Install code ( bgp_suppress_fib ) does
not properly handle two states from zebra:  ROUTE_INSTALL_FAILED
and BETTER_ADMIN_DISTANCE_WON.  Pre this change the WFI code
would just never notify our peers about a route install failure
but more is needed.  In the ROUTE_INSTALL_FAILED and the
BETTER_ADMIN_DISTANCE_WON we need to notify our peers with
a withdrawal about the route, else we will continue to
draw traffic to us when we cannot legally do so.

Why is this needed?  In either case imagine that we've already
received a bgp route, installed it and sent to our peers.
In the Better admin distance won case, say a static route is installed
at this point in time we must stop advertising the route through
us since we are not installed.  As such a withdrawal must be sent.

In the ROUTE_INSTALL_FAILED case, the code was not properly handling
the situation where we have Route A, it was successfully installed
and then we received a update to Route A that was attempted to be
installed but failed.  In this case we also need to send a withdrawal

Finally update the bgp_suppress_fib topotest to test both of these
situations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-17 13:28:56 -05:00
Donald Sharp
a3a0d43585 tests: Further fix bgp_l3vpn_to_bgp_vrf
There still existed chances that best path consideration
has not taken place for both bgp_l3vpn_to_bgp_vrf and
bgp_instance_del_test ( since they both used the same
check_routes.py scripting ).  Add some more checks
to ensure that we have all the data.  Prior to this
change I could see one of these two tests failing
every 2-3 runs on my test system.  I am not seeing
this anymore after ~5 complete test runs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-14 07:29:41 -05:00
Donald Sharp
235f1ccd9b tests: test_ospf_lan.py is looking for a certain order enforce it
OSPF when converging will choose a DR / Backup DR based upon
who has already come up.  Irrelevant of priority.  As such if
under system load OSPF comes up first and elects a DR that under
normal circumstances not be the elected one due to priority
OSPF does not go back through and re-elect to keep the system
stable in this case.  Tests are experiencing this:

unet> r0 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.1        99 Full/Backup     4m14s              3.780s 10.0.1.2        r0-s1-eth0:10.0.1.1                  0     0     0
100.1.1.2         0 Full/DROther    4m14s              3.848s 10.0.1.3        r0-s1-eth0:10.0.1.1                  0     0     0
100.1.1.3         0 Full/DROther    4m14s              3.912s 10.0.1.4        r0-s1-eth0:10.0.1.1                  0     0     0

unet> r1 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m15s              3.011s 10.0.1.1        r1-s1-eth1:10.0.1.2                  0     0     0
100.1.1.2         0 Full/DROther    4m19s              3.124s 10.0.1.3        r1-s1-eth1:10.0.1.2                  0     0     0
100.1.1.3         0 Full/DROther    4m19s              3.188s 10.0.1.4        r1-s1-eth1:10.0.1.2                  0     0     0

unet> r2 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m27s              3.483s 10.0.1.1        r2-s1-eth0:10.0.1.3                  0     0     0
100.1.1.1        99 Full/Backup     4m32s              3.527s 10.0.1.2        r2-s1-eth0:10.0.1.3                  0     0     0
100.1.1.3         0 2-Way/DROther   4m32s              3.660s 10.0.1.4        r2-s1-eth0:10.0.1.3                  0     0     0

unet> r3 show ip ospf neigh

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
100.1.1.0        98 Full/DR         4m55s              3.786s 10.0.1.1        r3-s1-eth1:10.0.1.4                  0     0     0
100.1.1.1        99 Full/Backup     4m55s              3.829s 10.0.1.2        r3-s1-eth1:10.0.1.4                  0     0     0
100.1.1.2         0 2-Way/DROther   4m54s              3.897s 10.0.1.3        r3-s1-eth1:10.0.1.4                  0     0     0

Modify the test to do a clear to enforce the order we are specifically looking for.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-11 12:05:36 -05:00
Russ White
476a3613aa
Merge pull request #10135 from donaldsharp/ripng_faster_timers
tests: Allow ripng_topo1 to converge a bit faster
2021-12-07 06:41:45 -05:00
Donatas Abraitis
a4051cb283 tests: Test if BGP session is up additionally for route_server_client setup
Lower connect timer to 5 seconds as well.

```
FAILED test_bgp_route_server_client.py::test_bgp_route_server_client - AssertionError: Cannot see BGP GUA next hop from r3 in r1
```

```
2021-12-02 14:41:21,115 INFO: topolog.r1: vtysh command => "show bgp 2001:db8:f::3/128 json"
2021-12-02 14:41:21,115 DEBUG: topolog.r1: LinuxNamespace(r1): cmd_status("['/bin/bash', '-c', 'vtysh  -c "show bgp 2001:db8:f::3/128 json" 2>/dev/null']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2021-12-02 14:41:21,159 INFO: topolog.r1: vtysh result:
	{
	}
```

At least can't reproduce a failure locally (before managed to catch it).

Ran >2000 times, no failure.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-12-03 10:03:07 +02:00
Rafael Zalamena
82f7d8cd2c
Merge pull request #9940 from pguibert6WIND/misc_topotests
simplify some topotests config with naming default vrf
2021-12-02 09:19:45 -03:00
Donald Sharp
d047ba78d2
Merge pull request #9708 from mobash-rasool/new_b
pimd: hello sent stats counter change and new flag addition to decide hello send
2021-12-02 04:05:03 -05:00
Donatas Abraitis
4548e72307
Merge pull request #10150 from donaldsharp/kill_daemon
tests: Fix Daemon Killing to actually notice when a deamon dies
2021-12-01 20:42:19 +02:00
Donatas Abraitis
e2144103f8
Merge pull request #9878 from pguibert6WIND/resolver_vrf
lib: resolver per vrf support
2021-12-01 08:12:33 +02:00
Russ White
f1f6716d4a
Merge pull request #9610 from iqras23/best_path
bgpd: VRF-Lite fix best path selection
2021-11-30 16:14:34 -05:00
Russ White
be8a6654b9
Merge pull request #10143 from donaldsharp/lib_kernel_routes
test: Fix addKernelRoute looking for positive results
2021-11-30 09:52:11 -05:00
Olivier Dugeon
be95145ebc topotests: Add new IS-IS Traffic Engineering tests
Test the new Link State Traffic Engineering feature in IS-IS.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-11-30 15:22:28 +01:00
Olivier Dugeon
173f8887cc isisd: Add support for RFC6119 (IPv6 TE in IS-IS)
- Add advertisement of Global IPv6 address in IIH pdu
 - Add new CLI to set IPv6 Router ID
 - Add advertisement of IPv6 Router ID
 - Correctly advertise IPv6 local and neighbor addresses in Extended IS and MT
   Reachability TLVs
 - Correct output of Neighbor IPv6 address in 'show isis database detail'
 - Manage IPv6 addresses advertisement and corresponiding Adjacency SID when
   IS-IS is not using Multi-Topology by introducing a new ISIS_MT_DISABLE
   value for mtid (== 4096 i.e. first reserved flag set to 1)

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-11-30 15:22:28 +01:00
Donald Sharp
c9f92703bc tests: Fix Daemon Killing to actually notice when a deamon dies
Lot's of the GR topotests kill daemons in order to test code
that deals with crashing daemons.  Under heavy system load
it was noticed that a kill command was sent and if told to
wait we would sleep 2 seconds send another kill command and
call it good.  This was causiing issues when subsuquent
json commands would get errors like `lost connection to daemon`
as the daemon finally shut down after some time due to load.

Modify the kill the daemon function to notice that the daemon
was not actually killed and if we need to wait wait some
more time for it too happen

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-29 20:55:30 -05:00
Donald Sharp
3d7d6e9ada tests: Allow interface statistics to be gathered with some delay
Currently under system load tests that use verify_pim_interface_traffic
immediately after a interface down/up event are not giving any time
for pim to receive and process the data from that event.  Give
the test some time to gather this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-29 12:11:43 -05:00
Russ White
31ccdb903f
Merge pull request #9703 from donaldsharp/splitup_bgp_gr
tests: Split up the bgp GR topotests
2021-11-29 11:05:51 -05:00
Russ White
85d1d680ab
Merge pull request #10018 from ckishimo/ospf6d_bitN
ospf6d: check N-bit in Hello packet
2021-11-29 11:05:11 -05:00
Russ White
5c24a442d9
Merge pull request #10105 from ton31337/feature/rfc9072
bgpd: Implement rfc9072
2021-11-29 10:46:58 -05:00
Donald Sharp
93d664c26a test: Fix addKernelRoute looking for positive results
Under heavy system load, we are sometimes seeing this
output for addKernelRoute:

2021-11-28 16:17:27,604 INFO: topolog: [DUT: b1]: Running command: [ip route add 224.0.0.13 dev b1-f1-eth0]
2021-11-28 16:17:27,604 DEBUG: topolog.b1: LinuxNamespace(b1): cmd_status("['/bin/bash', '-c', 'ip route add 224.0.0.13 dev b1-f1-eth0']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2021-11-28 16:17:27,967 DEBUG: topolog.b1: LinuxNamespace(b1): cmd_status("['/bin/bash', '-c', 'ip route']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2021-11-28 16:17:28,243 DEBUG: topolog: ip route
70.0.0.0/24 dev b1-f1-eth0 proto kernel scope link src 70.0.0.1
Signed-off-by: Donald Sharp <sharpd@nvidia.com>

This tells us that the ip route add succeeded but when looking for it
the system failed to immediately find it.  Why is this happening?
Probably we are under heavy system load and the two different
commands, 'ip route add..' and 'ip route show' are being executed
on different cpu's and the data has not been copied to the different
cpu yet in the kernel.  This is not necessarily something normally
seen but entirely possible.  Giving the system a few extra seconds
for the kernel to execute/work the memory barrier system seems
prudent for long term success of our programming.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-29 08:42:03 -05:00
Donald Sharp
b38b873c61 tests: Allow ripng_topo1 to converge a bit faster
Modify the timers uses to send updates/hello's every
1 seconds instead of 5.  Allowing this test to converge
faster under heavy system load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-28 08:46:48 -05:00
Donald Sharp
2451958e54 tests: Fix isis_topo1_vrf to wait a tiny bit for zebra route install
During repeated runs I am seeing this test fail to run successfully.
Upon inspecting the output:
            {
              "prefix":"10.0.10.0/24",
              "prefixLen":24,
              "protocol":"isis",
              "vrfId":6,
              "vrfName":"r1-cust1",
              "selected":true,
              "destSelected":true,
              "distance":115,
              "metric":10,
              "queued":true,

We can see that the route is still queued.  Under heavy system
load and not ensuring that isis has time to send the route to
zebra and for zebra to install the route, this test can fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-27 13:12:50 -05:00
ckishimo
3af858bbcf tests: add ospf6 topotest to check N-bit and E-bit
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-11-25 13:14:26 +01:00
ckishimo
96c715f302 tests: verify no ospf6 neighbors
Update verify_ospf6_neighbor() so we can verify there are no
neighbors in a given router

    input_dict = {
        "r0": {
            "ospf6": {
                "neighbors": []
            }
        }
    }
    result = verify_ospf6_neighbor(tgen, topo, dut, input_dict)

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-11-25 12:59:09 +01:00
Donatas Abraitis
4f037a39f2
Merge pull request #10115 from donaldsharp/bgp_route_server_convergence
tests: Add aggressive timers to the new route server client test
2021-11-25 13:24:35 +02:00
Igor Ryzhov
af36ea8434
Merge pull request #10121 from ton31337/feature/match_ipv6_nexthop_prefixlist
bgpd: Add an ability to match ipv6 next-hop by prefix-list
2021-11-24 19:38:07 +03:00
Donatas Abraitis
c75d6ccbfe tests: Check if match ipv6 next-hop prefix-list command works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-24 16:28:48 +02:00
Donald Sharp
cd8bdf6fed tests: Remove create_router_ospf6
This function is never used, remove.  Developer can use
create_router_ospf instead

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
ef463828d3 tests: Do not put area under router ospf6
The interface area command is deprecated under
router ospf6 and should be on the individual interface.
Let's modify the tests to not actually put the
interface foo area 0.0.0.0 command under the
router node.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
bceb50e4aa tests: Add clear event to creation of router for v4 and v6 ospf
When using build_config_from_json there exists a timing
window where neighbors can come up before the router-id
is applied.  As a precaution, quickly clear the neighbors
to ensure that we get neighbors with the expected router-id.
This can especially happen under high system load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
a335c38bc0 tests: Move area configuration to interface for ospv3
The test_ospf_dual_stack test had area configuration
under the `router ospf6` nodes.  This is getting
lots of warning messages from the cli.  Let's remove
this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
04d01cc343 tests: Don't double create ospfv3 config
When testers use the build_config_from_json function
the create_router_ospf function is double creating
the ospfv3 cli to be passed in.  This is because
the create_router_ospf loops over both v2 and v3
and then create_router_ospf6 re-adds v3.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
4b2e09df96 tests: Do not pick an ip address that overlaps with ourselves
The ospf_basic_functionality/test_ospf_lan.py creates
a ethernet segment and attaches 4 routers to it and
assigns ip addresses in a /24.  As one of the tests
it picks a new address for r0 which coincides with
a ip address on r3.  Then the test immediatly
checks for other data.  The problem is of course
that if a test is `slow` enough hello's will
start to be ignored from r3 to r0 and the
neighbor relationships will come down.  Choose
an ip address that doesn't cause this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-24 07:05:19 -05:00
Donald Sharp
bdd3a3ccc8 tests: Add aggressive timers to the new route server client test
The new bgp_route_server_client test is not setting the
timers for peers to be fast enough to have the ability
to converge in under 60 seconds if a packet is dropped/missed
at startup.  Make the test have the ability to converge
under load

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-23 20:24:08 -05:00
Renato Westphal
003d3dbead Revert "ospfd: remove commands for broken GR helper mode"
This reverts commit accef597df.
2021-11-23 15:31:39 -03:00
Donatas Abraitis
390cde0afc tests: Test if match ipv6 next-hop works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-23 13:47:27 +02:00
Philippe Guibert
c742573b67 lib: resolver per vrf support
add a parameter to resolver api that is the vrf identifier. this permits
to make resolution self to each vrf. in case vrf netns backend is used,
this is very practical, since resolution can happen on one netns, while
it is not the case in an other one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-11-23 09:02:23 +01:00
Donald Sharp
d32c92a4c0
Merge pull request #10057 from ton31337/fix/we_shouldn_send_LLA_for_RS
bgpd: Do not send LLA for route-server-client peers
2021-11-22 12:06:36 -05:00
Ryoga Saito
1c5fede26a tests: add linebreak to follow Python code style
Co-authored-by: Hiroki SHIROKURA <slank.dev@gmail.com>
Signed-off-by: Ryoga Saito <contact@proelbtn.com>
2021-11-22 23:32:37 +09:00
Ryoga Saito
076c5a1ef6 tests: add topotests for SRv6 VPNv4
There is an test for SRv6 VPNv6, This is a clone for SRv6 VPNv4.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2021-11-22 23:32:37 +09:00
Donatas Abraitis
bfe6156ab0 tests: Check if Extended Optional Parameters Length works for BGP
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-22 15:34:47 +02:00
Donald Sharp
f1f0bd0911 tests: Fix tests using exabgp to explicitly call out which python to use
There exist systems that do not explicity have a python soft-link
on their system.  Let's explicity call out which python we want
to be using with exabgp.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-20 19:36:40 -05:00
Donald Sharp
b044947820 tests: Split up the bgp GR topotests
The bgp gr topotests had run times that were greater than 10 minutes each.
Just brute force break up the tests to 4 different sub parts.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-19 07:53:12 -05:00
Iqra Siddiqui
4812a35649 tests: Fix test_bgp_l3vpn_to_bgp_vrf
Description:
- Changing the expected output for selected route in the script.
- With our changes for VRF-Lite fix best path selection,
  during best path selection, while comparing the paths for imported routes,
  we should correctly refer to the original route i.e. the ultimate path.
  In this case, when we have ibgp route and imported ibgp route
  for the same prefix, we do compare IGP metric which is same for both,
  So we proceed to comparing router-ids and selecting the best path.
- Before our changes, ibgp route was preferred because of IGP metric.
  With our fix, expected output for selected route is changed to
  imported ibgp route because of the lower router-id.
- Corresponding changes for expected advertised route and
  the large community are made.

Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2021-11-19 07:33:22 +05:30
Iqra Siddiqui
687c62fc2a topotests: Add supported topotests for bgpd vrf-lite best path selection
Co-authored-by: Kuldeep Kashyap <kashyapk@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2021-11-19 07:33:22 +05:30
David Lamparter
0c3b8d5461
Merge pull request #10087 from donaldsharp/core_file_restore 2021-11-17 17:00:19 +01:00
Donald Sharp
41e69bb32f
Merge pull request #9852 from opensourcerouting/pim-nht-rework
pimd: make PIM NHT less weird
2021-11-17 09:34:51 -05:00
Donald Sharp
e2e677f64b tests: Re-add the ability to generate core files with topotests
Somewhere along the line core-files stopped being generated
with the running of the topotests.  With this change we now
see this:

sharpd@eva /t/topotests> find . -name '*.dmp' -print
./ospfv3_basic_functionality.test_ospfv3_asbr_summary_topo1/r0/ospf6d_core-sig_6-pid_430478.dmp
sharpd@eva /t/topotests> sudo gdb /usr/lib/frr/ospf6d ./ospfv3_basic_functionality.test_ospfv3_asbr_summary_topo1/r0/ospf6d_core-sig_6-pid_430478.dmp
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/frr/ospf6d...
[New LWP 430478]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/ospf6d --log file:ospf6d.log --log-level debug -d'.
Program terminated with signal SIGABRT, Aborted.
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
(gdb)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-17 08:51:14 -05:00
David Lamparter
56be7c7ed1 tests: add one more BSR check to pim_bsmp_01
This is implicitly checked by the "verify mroute" below, but it's much
more helpful to explicitly check in advance.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17 11:17:44 +01:00
Russ White
a23a574994
Merge pull request #9944 from ARShreenidhi/tcp_mss_testcase
tests: testcase to configure and verity tcp mss with vrf
2021-11-16 09:56:48 -05:00
Donatas Abraitis
0d92307ee8 tests: Check if we are sending IPV6 GUA for route-server-client peers
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-15 17:24:20 +02:00
David Lamparter
de48804c01
Merge pull request #10046 from donaldsharp/bgp_instance_del 2021-11-15 10:49:31 +01:00
Donald Sharp
045e023549
Merge pull request #10032 from opensourcerouting/build-fix-20211111
build: assorted build system improvements, 2021-11 edition
2021-11-13 10:10:59 -05:00
Donald Sharp
a22803a39b tests: Ensure BGP has had time to import routes through the vpn
Currently I get bgp_instance_del-test as well as bgp_l3vpn_to_bgp_vrf
failures every ~3-4 runs when under a 40 parallel run with micronet.
Examination of the failure and passing cases always leads to the
failures showing convergence of bgp bestpath immediately after
the show commands to ensure that the routes are there.

Modify the code to look for the fact that the vrf has
converged from routes being passed around across vrf's
and ensure that bestpath has run on them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-12 13:24:04 -05:00
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