Commit Graph

3080 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
bfea578df1
Merge pull request #13209 from LabNConsulting/chopps/log-redux
tests: lower logging level on some infra logs
2023-04-04 13:34:51 -05:00
Jafar Al-Gharaibeh
3b28a5ef6b
Merge pull request #13131 from LabNConsulting/chopps/no-startup-file
mgmtd: remove startup config feature for now
2023-04-04 08:42:04 -05:00
Russ White
4af5e39b2c
Merge pull request #12969 from opensourcerouting/ospfd-nssa
ospfd: implement NSSA default routes & ranges
2023-04-04 09:38:55 -04:00
Christian Hopps
e8f7a22f76 tests: lower logging level on some infra logs
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-04 11:41:51 +00:00
Kuldeep Kashyap
0d58ebc4f9 tests: [topojson] multicast pimv6 socat cleanup
For multicast pimv6 join and traffic, socat is
used, which was not cleaned up post tests executions,
enhanced kill_socat() API to kill socat join and
traffic specific PIDs during teardown module.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-04-04 08:12:31 +05:30
Trey Aspelund
f615e6dc40 tests: add test to validate 4-byte ecomm parsing
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2023-04-03 21:25:57 +00:00
Abhishek N R
9bcf8c9476 tests: [PIMv6] F/W support for multicast mld local join automation
Enhanced or added new libraries to support
multicast mld local join  automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Co-Auther: Vijay Kumar Gupta <vijayg@vmware.com>
2023-04-03 04:05:26 -07:00
Abhishek N R
2fc123efaf tests: [PIMv6] Add multicast mld local join suite
Added new test suite to verify functionality
of multicast MLD local join. Added 4 different
test cases in test suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Co-Authored-by: Vijay Kumar Gupta <vijayg@vmware.com>
2023-04-03 04:05:26 -07:00
Renato Westphal
d613e18eab tests: add OSPF NSSA topotest
At this point OSPF NSSA deserves a dedicated topotest given the
latest nerd knobs that were added :)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Renato Westphal
e85194f572 ospfd: refactor the "area nssa" command using DEFPY
Combine all variation of the "area nssa" command into a single
DEFPY to improve code maintainability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31 19:28:15 -03:00
Christian Hopps
8fb2082229 tests: when verifying a route is missing use expected=False
Prior to this the full retry cycle was run with a "passing" negative
result each time through

Previous runtime ~5 minutes
New runtime ~20 seconds.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-31 15:15:52 -04:00
Donald Sharp
4fe50326b9
Merge pull request #13155 from opensourcerouting/fix/bgp_addpath_labeled_unicast_topotest
tests: Check received routes count for labeled-unicast with addpath
2023-03-31 07:55:23 -04:00
Jafar Al-Gharaibeh
fa64f98ef1
Merge pull request #13142 from donaldsharp/cleanup_debugs
tests: Turn off debug logging
2023-03-31 00:09:55 -05:00
Donatas Abraitis
9db7ed2fc9 tests: Check received routes count for labeled-unicast with addpath
Test failed time to time, let's try this way:

```
$ for x in $(seq 1 20); do cp test_bgp_labeled_unicast_addpath.py test_$x.py; done
$ sudo pytest -s -n 20
```

Ran 10 times using this pattern, no failure 🤷

Before this change, we checked advertised routes, and at some point `=` was
missing from the output, but advertised correctly. Receiving router gets as
much routes as expected to receive.

I reversed checking received routes, not advertised.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-30 17:33:21 +03:00
mobash-rasool
6baf6b184c
Merge pull request #12916 from donaldsharp/clang_15_warnings
freebsd 14, clang 15
2023-03-30 08:41:40 +05:30
Donald Sharp
2007e2dbd0 tests: Turn off debug logging
Tests are taking up too much space, turn off debug logging
for normal runs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-29 20:12:58 -04:00
Russ White
5218d9f82f
Merge pull request #12645 from gpnaveen/ospf_error_msg_enhancements
tests: [topojson] Update assert/error messages for ospf scripts
2023-03-29 11:05:30 -04:00
Donatas Abraitis
4d8e44c753 bgpd: Do not announce routes immediatelly on filter updates
If we set `bgp route-map delay-timer X`, we should ignore starting to announce
routes immediately, and wait for delay timer to expire (or ignore at all if set
to zero).

f1aa49293a broke this because we always sent
route refresh and on receiving BoRR before sending back EoRR.

Let's get fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-28 18:51:48 +03:00
Donald Sharp
2c38c794a0 lib: Remove getopt.c and getopt1.c
Why do we need getopt code that is standard in everything
that we compile against?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-28 10:07:38 -04:00
Donatas Abraitis
c4e3d5569f
Merge pull request #13086 from donaldsharp/suppress_fib_pending
bgpd: Ensure suppress-fib-pending works with network statements
2023-03-27 21:55:58 +03:00
nguggarigoud
74dd0c84db tests: [topojson] Update assert/error messages
Few assert/error messages are updated for test
scripts for better debugging.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-03-26 14:37:49 +00:00
Donald Sharp
fd8044a4fc
Merge pull request #13084 from opensourcerouting/fix/bgp_vrf_md5_password
bgpd: Set md5 TCP socket option for outgoing connections on listener
2023-03-26 08:21:31 -04:00
Donald Sharp
24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
ce50d11c4d *: Convert thread_master_XXX functions to event_master_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
70c35c11f2 *: Convert thread_should_yield and thread_set_yield_time
Convert thread_should_yield and thread_set_yield_time
to event_should_yield and event_set_yield_time

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
8c1186d38e *: Convert thread_execute to event_execute
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
de2754be3a *: Convert thread_fetch and thread_call to event_fetch and event_call
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
332beb64b8 *: Convert thread_cancelXXX to event_cancelXXX
Modify the code base so that thread_cancel becomes event_cancel

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cb37cb336a *: Rename thread.[ch] to event.[ch]
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system.  There is a continual
problem where people are confusing `struct thread` with a true
pthread.  In reality, our entire thread.c is an event system.

In this commit rename the thread.[ch] files to event.[ch].

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:16 -04:00
Donatas Abraitis
6927446645
Merge pull request #13074 from donaldsharp/hash_clean_and_free
*: Add a hash_clean_and_free() function
2023-03-23 14:08:29 +02:00
Donald Sharp
3fdb2079f6 bgpd: Ensure suppress-fib-pending works with network statements
The flag for telling BGP that a route is expected to be installed
first before notifying a peer was always being set upon receipt
of a path that could be accepted as bestpath.  This is not correct:
imagine that you have a peer sending you a route and you have a
network statement that covers the same route.  Irrelevant if the
network statement would win the flag on the dest was being set
in bgp_update.  Thus you could get into a situation where
the network statement path wins but since the flag is set on
the node, it will never be announced to a peer.

Let's just move the setting of the flag into bgp_zebra_announce
and _withdraw.  In _announce set the flag to TRUE when suppress-fib
is enabled.  In _withdraw just always unset the flag as that a withdrawal
does not need to wait for rib removal before announcing.  This will
cover the case when a network statement is added after the route has
been learned from a peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-22 11:35:28 -04:00
Philippe Guibert
14c8653c7c topotests: add bgp_vpnv6 test allocation
This test demonstrates that a label is allocated for each
ipv6 next-hop. IPv6 test introduces link local ipv6 addresses
as next hops, and compared to IPv4, one can have two different
next-hops depending if the next-hop is defined by a global
address (static route redistributed) or a bgp peer.

This test checks that:
- The labels are correctly allocated per connected next-hop.
- The default label is used for non connected prefixes.
- The withdraw operation frees the MPLS entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the
associated label will be found out.
- When a prefix moves from one peer to one another behind the
vrf, then the MPLS switching operation for return
traffic is changing the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- Also, when unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22 16:28:13 +01:00
Philippe Guibert
3596a77697 topotests: add bgp mpls allocation per next-hop test
A new test suite checks for the mpls label allocation
per nexthop mode. This test checks that:
- The labels are correctly allocated per connected
next-hop.
- The default label is used for non connected prefixes
- The withdraw operation frees the mpls entry.
- If a recursive route is redistributed by BGP, then the nexthop
tracking will find the appropriate nexthop entry, and the associated
label will be found out.
- When a prefix moves from one peer to one another behind the vrf,
then the MPLS switching operation for return traffic is changing
the outgoing interface to use.
- When the 'label vpn export <value>' MPLS label value is changed,
then the modification is propagated to prefixes which use that value.
- When unconfiguring the per-nexthop allocation mode, check
that the MPLS entries and the VPNv4 entries of r1 are changed
accordingly.
- Reversely, when re-configuring the per-nexthop allocation mode,
check that the allocation mode reuses the other label values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-22 16:28:01 +01:00
Donatas Abraitis
e1957bcd04 tests: Check if BGP peering with MD5 per-VRF works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-22 15:55:37 +02:00
Christian Hopps
d6c755f245 tests: apply frrbot style requirements
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-22 05:22:56 +00:00
nguggarigoud
f637ac0170 tests: Add topotests for MGMT daemon
1. MGMT daemon support in topotests.
2. Sanity tests for MGMTd.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-03-22 05:22:56 +00:00
Donald Sharp
d8bc11a592 *: Add a hash_clean_and_free() function
Add a hash_clean_and_free() function as well as convert
the code to use it.  This function also takes a double
pointer to the hash to set it NULL.  Also it cleanly
does nothing if the pointer is NULL( as a bunch of
code tested for ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21 08:54:21 -04:00
Donatas Abraitis
2e1ea89222
Merge pull request #12816 from gpnaveen/stc_rte_err_msg
tests: Enhance error msgs for static route automation.
2023-03-21 13:30:08 +02:00
Russ White
55cf5ea672
Merge pull request #12688 from dorDiogo/isis_hello_padding_sometimes
isisd: Add support for IS-IS hello padding during-adjacency-formation
2023-03-20 17:00:57 -04:00
Donatas Abraitis
d8986f0134 tests: Check if prefix-lists with IPv6 any works fine
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-19 22:51:36 +02:00
Donatas Abraitis
a1e538178c tests: Check if route-map works correctly if modifying prefix-lists
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-17 14:54:38 +02:00
Donatas Abraitis
52523db51c
Merge pull request #12310 from kuldeepkash/pim_v6
tests: [PIMv6] Adding multicast pim6 SM testsuite
2023-03-15 08:55:24 +02:00
Donatas Abraitis
0f4a09ac25 tests: Check if IPv6 BGP Link-Local peering works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-07 22:45:03 +02:00
Kuldeep Kashyap
7ce53cf7c7 tests: [PIMv6] Adding multicast pim6 SM testsuite
Automated new scenarios to multicast pim6
SM test suite. Added 10 test cases to verify
multicast PIM6-SM functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Co-Auther: Vijay Kumar Gupta <vijayg@vmware.com>
2023-03-06 05:08:08 -08:00
Kuldeep Kashyap
54bf02c6dd 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>
Co-Auther: Vijay Kumar Gupta <vijayg@vmware.com>
2023-03-06 05:08:08 -08:00
Christian Hopps
cad554442b tests: fix --pause functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-03 07:19:22 -05:00
Russ White
15424f55f3
Merge pull request #12650 from isabelladeleon12/advertise_high_metrics
isisd: Add support for advertise-high-metrics
2023-03-02 16:42:50 -05:00
Russ White
516444e6b1
Merge pull request #12618 from pguibert6WIND/vpnv4_ecmp
Vpnv4 ecmp
2023-02-28 15:49:05 -05:00
Isabella de Leon
96d2e071e5 tests: Add test to cover advertise-high-metrics functionality
Add tests that configure and disable advertise-high-metrics with wide, narrow, and transition metric styles. Also test ip route behavior.

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-02-28 11:39:12 -08:00
Diogo Oliveira
06fbbf2935 isisd,tests,doc: Rename hello padding sometimes to hello padding during-adjacency-formation
Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-28 09:54:02 -08:00
Diogo Oliveira
8b71e8790c tests: Add test to check hello padding sometimes behavior
Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-28 09:52:30 -08:00
Russ White
617d2b71c0
Merge pull request #12840 from dorDiogo/isis_advertise_passive_only
isisd: Add support for IS-IS advertise-passive-only
2023-02-28 09:22:32 -05:00
Naveen
1155a66246 tests: Enhance error msgs for static route auto.
tests: Enhance error messages for static route automation.

    Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-02-28 06:30:13 +00:00
Donatas Abraitis
0ce6a441e2 tests: Use inequality operator for strings
tests/topotests/lib/ospf.py:2819: SyntaxWarning: "is not" with a literal. Did you mean "!="?
    _age is not "get"

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-27 22:08:47 +02:00
Philippe Guibert
6cd0aae924 topotests: add vpnv4 ecmp test
This test ensures that BGP VRF instance is able to import ECMP
paths, and is able to install 2 labelled routes accordingly.

The test also ensures that the imported 172.31.0.10/32 prefix
is selected and that the reason why the 172.31.0.10/32 prefix is
selected is not 'Locally configured route'. Actually, imported
routes do not figure out correctly the peer, and the reason is
falsely mentioned as local.

This test also uses IP ranges used for documentation and for
testing.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-26 09:44:16 +01:00
Donald Sharp
68b48017ed
Merge pull request #12888 from opensourcerouting/fix/peer_af_flag_check_integer
bgpd: Flags fixes
2023-02-24 09:28:41 -05:00
Donald Sharp
19d5895827
Merge pull request #12841 from opensourcerouting/topofix_bgp_gr_retain_routes
tests: Change bgp_gr_retained_routes to use json output of "ip route"
2023-02-24 09:24:28 -05:00
Donatas Abraitis
5acfd822be tests: Check if peer->af_flags can be higher than uint32_t
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-24 00:24:20 +02:00
Diogo Oliveira
e77a0e27bb tests: Add test for IS-IS advertise-passive-only configuration
Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-22 13:46:53 -08:00
Donatas Abraitis
caf65e4a27 tests: Check if BGP confederation works with AS_EXTERNAL (!AS_SPECIFIED)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-22 10:08:40 +02:00
Russ White
d86be4994f
Merge pull request #12832 from opensourcerouting/fix/deprecate_bgp_internet_community
bgpd: Deprecate BGP `internet` community
2023-02-21 11:35:26 -05:00
Russ White
62bd2580e3
Merge pull request #12366 from manojvn/ospfv2-flood-reduction
ospfd: Support OSPF Refresh and Flooding Reduction RFC4136.
2023-02-21 08:03:06 -05:00
Russ White
ba755d35e5
Merge pull request #12248 from pguibert6WIND/bgpasdot
lib, bgp: add initial support for asdot format
2023-02-21 08:01:03 -05:00
Donald Sharp
39c664c4ea
Merge pull request #12849 from opensourcerouting/fix/tests_enum
tests: Cover all enum values for unit tests
2023-02-20 19:28:25 -05:00
Christian Hopps
663a0c96d9 tests: improve the ospfapi test (move to square topology)
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-02-20 11:58:30 -05:00
Donatas Abraitis
551cc5859e tests: Cover all enum values for unit tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-20 17:59:09 +02:00
Martin Winter
6a62adabb3
tests: Change bgp_gr_retained_routes to use json output of "ip route"
Depending on ip_route and kernel, the output might include a nhid
which causes the test to fail with a strict text output check.
Change to json output to avoid the issue

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-02-18 02:16:26 +01:00
Donatas Abraitis
5ef2911d23
Merge pull request #12791 from taspelund/loc_rib_json_fix
bgpd: fix 'json detail' output structure
2023-02-17 20:24:33 +02:00
Donatas Abraitis
81a57d8181 bgpd: Deprecate BGP internet community
Quite a few well-known communities from IANA's list do
   not receive special treatment in Cisco IOS XR, and at least one
   community on Cisco IOS XR's special treatment list, internet == 0:0,
   is not formally a well-known community as it is not in [IANA-WKC] (it
   is taken from the Reserved range [0x00000000-0x0000FFFF]).

https://datatracker.ietf.org/doc/html/rfc8642

This is Cisco-specific command which is causing lots of questions when it
comes to debugging and/or configuring it properly, but overall, this behavior
is very odd and it's not clear how it should be treated between different
vendor implementations.

Let's deprecate it and let the operators use 0:0/0 communities as they want.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-17 18:53:01 +02:00
Donald Sharp
8383d53e43
Merge pull request #12780 from opensourcerouting/spdx-license-id
*: convert to SPDX License identifiers
2023-02-17 09:43:05 -05:00
Trey Aspelund
04705e4829 tests: update tests using 'show bgp json detail'
There were a few tests using "show bgp ... json detail" that did json
comparisons against a predefined json structure. This updates those
predefined json structures to match the new format of the output.
(new output moves path array under "paths" key and adds header keys)

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2023-02-16 18:11:13 +00:00
Donatas Abraitis
234f6fd4f4 bgpd: Add BGP Software Version Capability
Implement: https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability

Tested with GoBGP:

```
% ./gobgp neighbor 192.168.10.124
BGP neighbor is 192.168.10.124, remote AS 65001
  BGP version 4, remote router ID 200.200.200.202
  BGP state = ESTABLISHED, up for 00:01:49
  BGP OutQ = 0, Flops = 0
  Hold time is 3, keepalive interval is 1 seconds
  Configured hold time is 90, keepalive interval is 30 seconds

  Neighbor capabilities:
    multiprotocol:
        ipv4-unicast:	advertised and received
        ipv6-unicast:	advertised
    route-refresh:	advertised and received
    extended-nexthop:	advertised
        Local:  nlri: ipv4-unicast, nexthop: ipv6
    UnknownCapability(6):	received
    UnknownCapability(9):	received
    graceful-restart:	advertised and received
        Local: restart time 10 sec
	    ipv6-unicast
	    ipv4-unicast
        Remote: restart time 120 sec, notification flag set
	    ipv4-unicast, forward flag set
    4-octet-as:	advertised and received
    add-path:	received
      Remote:
         ipv4-unicast:	receive
    enhanced-route-refresh:	received
    long-lived-graceful-restart:	advertised and received
        Local:
	    ipv6-unicast, restart time 10 sec
	    ipv4-unicast, restart time 20 sec
        Remote:
	    ipv4-unicast, restart time 0 sec, forward flag set
    fqdn:	advertised and received
      Local:
         name: donatas-pc, domain:
      Remote:
         name: spine1-debian-11, domain:
    software-version:	advertised and received
      Local:
         GoBGP/3.10.0
      Remote:
         FRRouting/8.5-dev-MyOwnFRRVersion-gdc92f44a45-dirt
    cisco-route-refresh:	received
  Message statistics:
```

FRR side:

```
root@spine1-debian-11:~# vtysh -c 'show bgp neighbor 192.168.10.17 json' | \
> jq '."192.168.10.17".neighborCapabilities.softwareVersion.receivedSoftwareVersion'
"GoBGP/3.10.0"
root@spine1-debian-11:~#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-15 23:14:48 +02:00
Donatas Abraitis
e0159b09c9 tests: Increase flags from uint32_t to uint64_t
Missed this part when increasing in the past.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-15 23:12:32 +02:00
Olivier Dugeon
e2b958ecbc
Merge pull request #12494 from louis-6wind/ext_admin_group
lib,zebra,isisd: add support for extended admin group RFC7308
2023-02-15 09:42:03 +01:00
Russ White
423c803580
Merge pull request #12728 from opensourcerouting/feature/bgp_neighbor_path-attribute_treat_as_withdraw
bgpd: Add neighbor path-attribute treat-as-withdraw command
2023-02-14 11:22:16 -05:00
Stephen Worley
51c33a5724 tests: add iproute2 API guard to svd test
Add a iproute2 API guard to the SVD test using `bridge fdb get`.

While it SHOULD be present on most systems based on their kernel
version it may not be present due to kernel/iproute2 version mismatch
weirdness.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Stephen Worley
cc07a819e4 tests: fix SVD topotest, new evpn vni json output
The output of `show evpn vni [VNI] json` changed,
so updated the test with the new keys/output.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Stephen Worley
6246b57e7c tests: add topotest to cover SVD flood entry
Add a topotest to cover making sure SVD flood entries
are installed with SVD.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Stephen Worley
6712f624da tests: fix mpls_label2str() in make check
Fix ospfd unit tests in make check that had not been
updated to the new lib function.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Stephen Worley
568d4324f2 tests: skip SVD/DVNI tests for < 5.7 kernel
Skip the SVD/DVNI topotests if the kernel version is
not at least 5.7.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Stephen Worley
ef94412971 tests: add first dvni topotests
Add first of dvni topotests. Covers just basic usage of importing
wildcard VNI and installing it via lwt encap.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:05 -05:00
Sharath Ramamurthy
1ca713b375 tests: add new topotest for single vxlan device config
Add new topo tests for validating mac learning, bridging and routing
with single vxlan device configuration

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-13 18:12:04 -05:00
Manoj Naragund
044561b1bb tests: Added ospfv2 flood reduction topotest changes.
Have added topotest to verify below scenarios.

1. Verify OSPF Flood reduction functionality with ospf enabled on process level.
2. Verify OSPF Flood reduction functionality with ospf enabled on area level.
3. Verify OSPF Flood reduction functionality between different area's

Have sussessfully tested these in my local setup

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2023-02-13 04:36:29 -08:00
Louis Scalbert
7d46f8dded tests: add extended admin-group test in isis_te_topo1
Add extended admin-group test in isis_te_topo1

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-10 14:13:46 +01:00
Philippe Guibert
8650fef03e topotests: add bgp_asdot_regex test
This test ensures that the regex used to filter as paths has to
be expressed in the asnotation of the BGP instance where prefixes
are received. 2 aspaths have been forged, both for AS 65540, but
only the former is expressed in asdot. If the local BGP instance
is expressed in asdot format, then only the former ASPATH will
match properly the incoming update. Reversely, when the local BGP
instance is expressed in plain format, then only the latter ASPATH
will match properly the incoming update.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
cd304769ac tests: add unit tests to bgp aspath to check as dot format
4 aspath tests are added, and expect the output string format
tobe in dot+ format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
3fbcdc6af6 topotests: add bgp_local_asn_dot test
This test performs AS handling operations on BGP instances,
and does some checks by using the asdot notation. AS4B values
are used for configuration.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
8ede0c8015 topotests: add test with aspath list encoded as asdot+ format
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
17571c4ae7 bgpd: aspath list format binds on as-notation format
Each BGP prefix may have an as-path list attached. A forged
string is stored in the BGP attribute and shows the as-path
list output.

Before this commit, the as-path list output was expressed as
a list of AS values in plain format. Now, if a given BGP instance
uses a specific asnotation, then the output is changed:

new output:
router bgp 1.1 asnotation dot
!
 address-family ipv4 unicast
  network 10.200.0.0/24 route-map rmap
  network 10.201.0.0/24 route-map rmap
  redistribute connected route-map rmap
 exit-address-family
exit
!
route-map rmap permit 1
 set as-path prepend 1.1 5433.55 264564564
exit

ubuntu2004# do show bgp ipv4
BGP table version is 2, local router ID is 10.0.2.15, vrf id 0
Default local pref 100, local AS 1.1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
 *> 4.4.4.4/32       0.0.0.0                  0         32768 1.1 5433.55 4036.61268 ?
 *> 10.0.2.0/24      0.0.0.0                  0         32768 1.1 5433.55 4036.61268 ?
    10.200.0.0/24    0.0.0.0                  0         32768 1.1 5433.55 4036.61268 i
    10.201.0.0/24    0.0.0.0                  0         32768 1.1 5433.55 4036.61268 i

The changes include:
- the aspath structure has a new field: asnotation type
The ashash list will differentiate 2 aspaths using a different
asnotation.
- 3 new printf extensions display the as number in the wished
format: pASP, pASD, pASE for plain, dot, or dot+ format (extended).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
e55b088399 bgpd: add as-notation keyword to 'router bgp' vty command
A new keyword permits changing the BGP as-notation output:
- [no] router bgp <> [vrf BLABLA] [as-notation [<dot|plain|dot+>]]

At the BGP instance creation, the output will inherit the way the
BGP instance is declared. For instance, the 'router bgp 1.1'
command will configure the output in the dot format. However, if
the client wants to choose an alternate output, he will have to
add the extra command: 'router bgp 1.1 as-notation dot+'.

Also, if the user wants to have plain format, even if the BGP
instance is declared in dot format, the keyword can also be used
for that.

The as-notation output is only taken into account at the BGP
instance creation. In the case where VPN instances are used,
a separate instance may be dynamically created. In that case,
the real as-notation format will be taken into acccount at the
first configuration.

Linking the as-notation format with the BGP instance makes sense,
as the operators want to keep consistency of what they configure.

One technical reason why to link the as-notation output with the
BGP instance creation is that the as-path segment lists stored
in the BGP updates use a string representation to handle aspath
operations (by using regexp for instance). Changing on the fly
the output needs to regenerate this string representation to the
correct format. Linking the configuration to the BGP instance
creation avoids refreshing the BGP updates. A similar mechanism
is put in place in junos too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:23 +01:00
Philippe Guibert
8079a4138d lib, bgp: add initial support for asdot format
AS number can be defined as an unsigned long number, or
two uint16 values separated by a period (.). The possible
valus are:
- usual 32 bit values : [1;2^32 -1]
- <1.65535>.<0.65535> for dot notation
- <0.65535>.<0.65535> for dot+ notation.

The 0.0 value is forbidden when configuring BGP instances
or peer configurations.

A new ASN type is added for parsing in the vty.
The following commands use that new identifier:
- router bgp ..
- bgp confederation ..
- neighbor <> remote-as <>
- neighbor <> local-as <>
- clear ip bgp <>
- route-map / set as-path <>

An asn library is available in lib/ and provides some
services:
- convert an as string into an as number.
- parse an as path list string and extract a number.
- convert an as number into a string.

Also, the bgp tests forge an as_zero_path, and to do that,
an API to relax the possibility to have a 0 as value is
specifically called from the tests.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:27:17 +01:00
Philippe Guibert
9eb1199710 bgpd: store the bgp as identifier in the configured as-notation
This is a preliminary work to handle various ways to configure
a BGP Autonomous System. When creating a BGP instance, the
user may want to define the AS number as a dotted value,
instead of using an integer value.

To handle both cases, an as_pretty char attribute will store
the as number as it has been given to the vtysh command:

router bgp <as number>

Whenever the as integer of the BGP instance was dumped,
the as_pretty original format is used.

The json output reuses the integer value to keep backward
compatibility with old displays.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-02-10 10:19:06 +01:00
Donald Sharp
787b4fe469
Merge pull request #12782 from opensourcerouting/fix/bgpd_aspath_str_crash
bgpd: Intern default-originate attributes to avoid use-after-free
2023-02-09 19:25:19 -05:00
Donatas Abraitis
35b7ce08a8 tests: Check if BGP default-originate withdraw works correctly
And also do not crash when we do `clear ip bgp ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-09 22:57:42 +02:00
David Lamparter
cca918fe04 *: remove some leftover license blurbs
The regex'ing left some paragraphs that didn't exactly match.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter
47a3a82770 *: manual SPDX License ID conversions
The files converted in this commit either had some random misspelling or
formatting weirdness that made them escape automated replacement, or
have a particularly "weird" licensing setup (e.g. dual-licensed.)

This also marks a bunch of "public domain" files as SPDX License "NONE".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:07 +01:00
Louis Scalbert
a8d6faa986 tests: do not use exclude grep
Filter out keys in JSON output with "grep -v" does not work when JSON
does not use the pretty format.

Use native python code to filter out keys.

Fixes: 6c13bd5744 ("topotests: fix bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-08 12:05:15 +01:00
Donatas Abraitis
197c3a768c
Merge pull request #12654 from Pdoijode/evpn-evi-detail-json-changes
zebra: fix JSON fields for show evpn vni detail
2023-02-07 23:31:53 +02:00
Donatas Abraitis
1c2ba4a23f tests: Check if route-map vpn import basic funtionality works fine
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-06 18:44:10 +02:00
Donatas Abraitis
599d1200b3 tests: Check if routes are withdrawn with unwanted attributes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-01 22:57:34 +02:00
Donald Sharp
33303f08bf
Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecation
*: Drop deprecated incorrect JSON fields with wrong naming
2023-02-01 15:39:18 -05:00
David Lamparter
ba727609c6 tests: add missing printf attribute
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01 03:00:22 +01:00
David Lamparter
da63485331 tests: yank asprintfrr duplicate
I think this one predates the existence of asprintfrr.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-01 03:00:22 +01:00
Donatas Abraitis
aa16204dfb
Merge pull request #12667 from donaldsharp/zebra_rib_fixup
tests: zebra_rib remove a sleep
2023-01-31 21:41:30 +02:00
Donatas Abraitis
f932966b02 tests: Use JSON camelCase naming for tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31 20:49:44 +02:00
Donald Sharp
be9692741b
Merge pull request #12717 from opensourcerouting/topotest_stop_topo_fix
tests: Fix wrong tgen.stop_topology() calls which got skipped
2023-01-31 12:30:35 -05:00
Mark Stapp
3b337b7d27
Merge pull request #12687 from opensourcerouting/build-mkdir-p
build: consistently mkdir -p output for redirect
2023-01-31 11:28:32 -05:00
Martin Winter
82db2cd11f
tests: Fix wrong tgen.stop_topology() calls which got skipped
Calls were missing the () and caused the stop_topology() to be skipped

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-31 16:10:04 +01:00
Donald Sharp
99b93e715c tests: zebra_rib remove a sleep
The test was sometimes failing around the sleep(4) for
waiting for the routes to be installed.  Instead of blindly
sleeping let's check to see that the routes are actually
there in zebra and then continue on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-31 09:10:27 -05:00
Donald Sharp
d829de9178
Merge pull request #12710 from opensourcerouting/fix/reset_fqdn_capability_on_before_handling_open
bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN
2023-01-31 08:46:03 -05:00
Martin Winter
6c5045ce4f
tests: Topotests fix for deleting wrong pidfile
Fixes killRouterDaemons() function which occasionally deleted the wrong
pidfile.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2023-01-30 23:29:03 +01:00
Donatas Abraitis
5ca2a7e9e6 tests: Check if we vanish hostname/domainname if disabled from another side
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-30 23:22:23 +02:00
Donald Sharp
d844d516da tests: Super simple babel test
Just get babel started and ensure that the v4 routes
are actually installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-28 11:17:08 -05:00
Pooja Jagadeesh Doijode
1a4a394d45 zebra: fix JSON fields for show evpn vni detail
Few of the JSON field in show evpn vni detail command is
confusing and a few fields were missing. Following is the
updated output.

primary# show evpn vni detail json
[
  {
    "vni":200,
    "type":"L2",
    "vrf":"default",
    "tenantVrf":"default",
    "vxlanInterface":"vni200",
    "ifindex":19,
    "vxlanIfindex":19,
    "sviInterface":"br200",
    "sviIfindex":18,
    "vtepIp":"2.2.2.1",
    "mcastGroup":"0.0.0.0",
    "advertiseGatewayMacip":"No",
    "advertiseSviMacip":"No",
    "numMacs":0,
    "numArpNd":0,
    "numRemoteVteps":1,
    "remoteVteps":[
      {
        "ip":"2.2.2.2",
        "flood":"HER"
      }
    ]
  },
  {
    "vni":100,
    "type":"L3",
    "vrf":"default",
    "tenantVrf":"default",
    "localVtepIp":"2.2.2.1",
    "vxlanIntf":"vni100",
    "sviIntf":"br100",
    "state":"Up",
    "sysMac":"aa:bb:cc:dd:ee:f1",
    "routerMac":"aa:bb:cc:dd:ee:f1",
    "vniFilter":"none",
    "l2Vnis":[
      20,
      30,
      200
    ]
  }
]

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-01-27 14:37:00 +00:00
Donatas Abraitis
c30461fc74
Merge pull request #12685 from louis-6wind/fix-vpnv4-noretain
topotests: fix bgp_vpnv4_noretain
2023-01-25 11:23:08 +02:00
Donatas Abraitis
e6158ebe5d
Merge pull request #12660 from Pdoijode/ip-nht-json-changes
zebra: fix JSON fields for "show ip/ipv6 nht"
2023-01-25 10:32:18 +02:00
Pooja Jagadeesh Doijode
553c804846 zebra: fix JSON fields for "show ip/ipv6 nht"
1. Renamed "gates" to "nexthops"
2. Displaying afi of the nexthops being dispalyed in place of
   "nexthops" JSON object in the old JSON output
3. Calling show_route_nexthop_helper() and show_nexthop_json_helper()
   instead of print_nh() inorder to keeps the fields in "nexthops"
   JSON object in sync with "nexthops" JSON object of
   "show nexthop-group rib json".

Updated vtysh:
    r1# show ip nht
    192.168.0.2
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)
    192.168.0.4
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)

Updated JSON:
    r1# show ip nht json
    {
      "default":{
        "ipv4":{
          "192.168.0.2":{
            "nhtConnected":false,
            "clientList":[
              {
                "protocol":"static",
                "socket":28,
                "protocolFiltered":"none"
              }
            ],
            "nexthops":[
              {
                "flags":3,
                "fib":true,
                "directlyConnected":true,
                "interfaceIndex":2,
                "interfaceName":"r1-eth0",
                "vrf":"default",
                "active":true
              }
            ],
            "resolvedProtocol":"connected"
          }
        }
      }
    }

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-01-24 18:15:36 -08:00
David Lamparter
d173381edc build: consistently mkdir -p output for redirect
When running the build in a separate build directory, redirecting output
into a file can error out if the directory does not exist yet.  Some
places already had `mkdir -p` calls, but not all.

Make all occurences of this consistently use `@$(MKDIR_P)`.

(Extension of PR #12575 to catch more places.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-24 17:46:57 +01:00
Louis Scalbert
6c13bd5744 topotests: fix bgp_vpnv4_noretain
Fix the following issues:
- two tests are done in one function. Dispatch the tests in two
functions to help the test debug.
- the first test passes even if a third prefix is not filtered. Match
the exact to avoid false positive.
- the expected values contains variable like version. Do no check
variable values.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-01-24 10:20:19 +01:00
Donatas Abraitis
f5c8073ddd
Merge pull request #12669 from proelbtn/fix-accept-own-rd-check
bgpd: Skip RD match if ACCEPT_OWN excended community is not attached
2023-01-20 11:12:47 +02:00
Ryoga Saito
03cc2022d2 tests: Add test to check importing routes to VRF
After implementing ACCEPT_OWN extended community, bgpd can't import VPN
routes to the VRFs whose RD is matched with that of VPN routes. This
commit adds new test to check the effect of the next commit.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2023-01-20 15:28:35 +09:00
Donald Sharp
d7b0c7a577
Merge pull request #12350 from kuldeepkash/pim6_fixes
tests: Fix for multicast_pim6_static_rp tests failure
2023-01-19 13:27:32 -05:00
Christian Hopps
c2c17459ea
Merge pull request #12655 from donaldsharp/pim_basic_cleanups
tests: pim_basic fails in micronet
2023-01-19 11:41:44 -05:00
Donatas Abraitis
cd16c74b77
Merge pull request #12492 from kuldeepkash/update_assert_msg
tests: [topojson] Update assert/error messages
2023-01-19 15:33:19 +02:00
Kuldeep Kashyap
2583746108 tests: fix for test_pim6_multiple_groups_different_RP_address_p2 failure
Testcase: test_pim6_multiple_groups_different_RP_address_p2
was failing because of a bug in framework, Fixed the
bug in this commit.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-01-19 05:26:37 -08:00
Kuldeep Kashyap
2a8ad2ea97 tests: Fix for multicast_pim6_static_rp tests failure
Multicast pim6 static RP tests are failing
when run in parallel using micronet. There
are APIs to clean mcast traffic before
starting new test but these cleanups
are not needed when socat is used.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-01-19 05:26:37 -08:00
Donald Sharp
a6782fbaf8 tests: zebra_netlink only gives 10 seconds to install all routes
Under really heavily loaded systems this is insufficient.  Looking
at the run output we have this:

	  "2.1.3.22\/32":[
	    {
	      "installed":true,
	    }
	  ],
	  "2.1.3.23\/32":[
	    {
	      "queued":true,
            }
           ],

So after 10 seconds on the micronet system only 30 of the 100 routes are installed.
Give it more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-18 15:29:32 -05:00
Donald Sharp
6483e73336 tests: pim_basic fails in micronet
Looks like under heavy load, the test is not giving enough
time to come to steady state.  Do this:

a) send more udp packets and for longer
b) Increase time spent waiting

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-18 15:29:32 -05:00
Christian Hopps
7cec6e4359 tests: replace -a (all) with individual flags for nsenter
- required for old OSs like centos 7
- fixes #11924

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-01-17 11:33:27 -05:00
Russ White
e2fd75fce2
Merge pull request #12584 from pguibert6WIND/bgp_imported_distance
bgpd: imported vpn entries get appropriate distance
2023-01-17 10:16:46 -05:00
Russ White
00d7261e20
Merge pull request #12636 from opensourcerouting/fix/bgp_accept-own_connected_routes
bgpd: Allow importing local routes with accept-own mechanism
2023-01-17 09:31:37 -05:00
Russ White
2a71812153
Merge pull request #12601 from opensourcerouting/feature/bgp_neighbor_path-attribute_discard
bgpd: Add `neighbor path-attribute discard` command
2023-01-17 09:12:17 -05:00
Russ White
3b506eccc1
Merge pull request #12597 from opensourcerouting/fix/bgp_sender_as_path_prevention
bgpd: Do not send routes back received from a peer
2023-01-17 09:11:53 -05:00
Russ White
13e9afe9e4
Merge pull request #12424 from opensourcerouting/static-route-bfd
staticd: BFD static route monitoring
2023-01-17 09:09:24 -05:00
Philippe Guibert
a04f1c42eb bgpd: imported vpn entries get appropriate distance
MPLS VPN networks can either peer with iBGP or eBGP. When
calculating the distance to send to zebra, the imported prefix
is never sent with distance information, even if the vty
command is used under the ipv4 unicast address family:

router bgp 65505 vrf vrf1
 address-family ipv4 unicast
  distance bgp 26 27 28
  [vpn config]

The observation is that the distance sent to zebra for an
imported prefix is still 20:

[..]
VRF vrf1:
B>  192.168.0.0/24 [20/0] via 2.2.2.2 (vrf default) (recursive), label 20, weight 1, 00:00:12
  *                          via 10.125.0.6, ntfp3 (vrf default), label implicit-null/20, weight 1, 00:00:12

The expectation is that the incoming prefix has to follow the
distance that is configured, or the distance derived from the peer
relationship established by the parent prefix.

In the case, an iBGP relationship is done, and no distance
configuration is done, the below show is expected:

   [..]
   VRF vrf1:
   B*>  192.168.0.0/24 [200/0] via 192.168.0.2, r1-gre0 (vrf default), label 20, weight 1, 00:00:12

In the case an iBGP relationship is done, and distance configuration
is performed as below:
   [..]
   distance bgp 21 201 41
   [..]

Then the below show is expected:

   [..]
   VRF vrf1:
   B*>  192.168.0.0/24 [201/0] via 192.168.0.2, r1-gre0 (vrf default), label 20, weight 1, 00:00:12

To get this behaviour, get the peer origin where the prefix is coming
from.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-01-17 13:24:33 +01:00
Kuldeep Kashyap
244f2df015 tests: Fix for frr-bot style issues
Fixed style issues repoted by frr-bot

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-01-17 14:07:23 +05:30
Kuldeep Kashyap
db726bb8b7 tests: [topojson]Update assert/error messages
Few assert/error messages are updated for test
scripts for better debugging.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2023-01-17 14:00:49 +05:30
Donatas Abraitis
b4710d034d tests: Check if connected routes are leaked between VRFs using accept-own
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-15 12:22:12 +02:00
Donald Sharp
483b322821 tests: route_scale tests are failing on micronet
I'm seeing test failures after in micronet runs in CI
after 7 seconds * 30 attempts at seeing if it succeeds.
Let's see if another 60 seconds of attempts allows
this to work properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-15 10:13:04 +00:00
Donatas Abraitis
be251beef2
Merge pull request #12639 from donaldsharp/breakup_bgp_vrf_dynamic_route_leak_topo4
tests: Breakup bgp_vrf_dynamic_route_leak_topo4
2023-01-14 22:26:43 +02:00
Donatas Abraitis
c7fe4786dc tests: Check if routes are not sent back from the sender
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-14 21:30:07 +02:00
Donatas Abraitis
760aee9ac2 tests: Check if we can discard unwanted attributes from the paths
Using `neighbor path-attribute discard ...` command.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-14 21:29:41 +02:00
Donald Sharp
186b9ab8c5 tests: Breakup bgp_vrf_dynamic_route_leak_topo4
Single run of this test suite on my machine was 8 minutes.
Breaking this up into 3 test suites halves the run time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-13 15:30:33 -05:00
G. Paul Ziemba
25cdcf1fac topotests/lib/lutil.py: luSetWaitType("strict"|"nostrict")
This change alters the behavior of existing test code. The
    default mode (before any call to luSetWaitType()) is now
    "strict".

    The historical behavior of luCommand(op="wait) is to ignore
    failures to match the specified regexp in the specified time.
    In those cases, no result was logged and no error was signaled.

    This change introduces a new "strict" mode for luCommand(op="wait):
    in "strict" wait mode, each invocation of luCommand(op="wait)
    generates an explicit, logged failure result when it fails to match
    the specified regexp in the specified time. These failures signal
    an error for the test.

    Calling luSetWaitType("nostrict") restores the historical behavior.

    Calling luSetWaitType("strict") (re)enables the new strict behavior.

    Individual calls to luCommand() may also specify op="wait-nostrict"
    to override any default and use the historical behavior.

    Individual calls to luCommand() may also specify op="wait-strict"
    to override any default and use the new behavior.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-01-13 10:53:36 -08:00
Rafael Zalamena
771fdeaf39 topotests: test BFD static route integration
Test that BFD static monitoring works:
When BFD session is up the routes are installed in the RIB and
distributed with routing protocol (in this case BGP). When the session
is down it is removed from RIB and propagated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-01-13 15:32:12 -03:00
Donald Sharp
914c1e35b5 Revert "tests: Fix wrong interface name in SRv6 topotest"
This reverts commit 647c38eab2.
2023-01-13 09:02:34 -05:00
Donald Sharp
2bb8b49ce1 Revert "Merge pull request #11127 from louis-6wind/bgp-leak"
This reverts commit 16aa1809e7, reversing
changes made to f616e71608.
2023-01-13 08:13:52 -05:00
Donald Sharp
c72e51ac70 tests: Pim vrf's need 4.19 or better to run properly not 4.15
Tests are failing in micronet because linux kernel needs are 4.19
not 4.15

2023-01-11 17:15:06,657.657 INFO: topolog.r1: vtysh command => "show zebra"
2023-01-11 17:15:06,657.657 DEBUG: topolog.r1: LinuxNamespace(r1): cmd_status("['/bin/bash', '-c', 'vtysh  -c "show zebra" 2>/dev/null']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2023-01-11 17:15:06,729.729 INFO: topolog.r1: vtysh result:
	OS                             Linux(4.15.0-193-generic)

Notice the missing pimreg11 device needed in vrf blue:

2023-01-11 17:15:06,731.731 DEBUG: topolog.r1: LinuxNamespace(r1): cmd_status("['/bin/bash', '-c', 'vtysh  -c "show int brief" 2>/dev/null']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
2023-01-11 17:15:06,781.781 INFO: topolog.r1: vtysh result:
	Interface       Status  VRF             Addresses
	---------       ------  ---             ---------
	blue            up      blue            192.168.0.1/32
	r1-eth0         up      blue            192.168.100.1/24
	r1-eth1         up      blue            192.168.101.1/24

	Interface       Status  VRF             Addresses
	---------       ------  ---             ---------
	erspan0         down    default
	gre0            down    default
	gretap0         down    default
	lo              up      default
	pimreg          up      default

	Interface       Status  VRF             Addresses
	---------       ------  ---             ---------
	r1-eth2         up      red             192.168.100.1/24
	r1-eth3         up      red             192.168.101.1/24
	red             up      red             192.168.0.1/32

While on a 5.4 machine we have this:

mininet310# show int brief
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
blue            up      blue
dummy1          up      blue
dummy2          up      blue
pimreg11        up      blue

As such let's limit the test to a 4.19 kernel or above that our
documentations states we need for proper pim operation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-11 13:23:51 -05:00
Rafael Zalamena
d3d497afcd
Merge pull request #12581 from cscarpitta/fix/fix-wrong-interface-name-srv6l3vpn-topotest
tests: Fix wrong interface name in `bgp_srv6l3vpn_route_leak` topotest
2023-01-04 13:30:48 -03:00
Donatas Abraitis
23691a80d7
Merge pull request #12318 from gpnaveen/bgp_unique_rid
tests: adding bgp unique router id automation.
2023-01-03 22:18:14 +02:00
Carmine Scarpitta
647c38eab2 tests: Fix wrong interface name in SRv6 topotest
Previously, routes leaked from one VRF to another VRF were associated
with the original nexthop interface.

Commit 14aabc0156 replaced the nexthop
interface with the index of incoming VRF interface.

Due to this change, the `bgp_srv6l3vpn_route_leak` topotest always fails
because it still expects the nexthop interface.

This commit fixes the expected interface name in the
`bgp_srv6l3vpn_route_leak` topotest.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-12-31 15:58:05 +01:00
Russ White
16aa1809e7
Merge pull request #11127 from louis-6wind/bgp-leak
bgpd: multiple fixes for route leaking
2022-12-27 14:51:28 -05:00
Donatas Abraitis
8431489f74
Merge pull request #12551 from proelbtn/fix-install-srv6-local-routes
bgpd: Fix announce SRv6 locally-generated routes to Zebra
2022-12-23 14:51:46 +02:00
Ryoga Saito
4d85efb0d3 tests: Add topotest bgp_srv6l3vpn_route_leak
To verify previous changes, this PR adds topotest to verify whether
imported routes redistributed will be active on other VRF RIB.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-12-20 20:07:44 +09:00
Donatas Abraitis
99f60e5ecb tests: Add an option for SNMP config to specify a custom options
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-20 09:42:36 +02:00
Donatas Abraitis
54257fae5d tests: Add basic tests for SNMP BGP4V2-MIB
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-19 23:27:33 +02:00
David Lamparter
7b78f6c87f
Merge pull request #12522 from donaldsharp/some_various_stuff 2022-12-16 15:30:37 +01:00
Philippe Guibert
4a62ec1669 topotests: fix appropriate number of routes in bgp
The number of routes in BGP ce devices was wrong.
Change the expected values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-12-16 15:07:58 +01:00
Louis Scalbert
767199c683 topotests: raise an error if pinging from vrf is not possible
Because of the issue described in the above link, pinging from vrf with
the command "ip vrf exec <vrf> ping -I <src> <addr>" may fail.

> root@topo:~# ip vrf exec vrf1 ping -c1 -I 192.168.2.1 192.168.1.1
> bind: Cannot assign requested address

Raise an error if pinging its own IP from a VRF fails. This test should
always work unless in the condition of this issue.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=203483
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 15:07:57 +01:00
Louis Scalbert
56748da55f topotests: add tests to bgp-vrf-route-leak-basic
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 15:07:56 +01:00
Louis Scalbert
a1d9f6f2f2 topotests: add VRF leak tests in bgp_l3vpn_to_bgp_vrf
Check that route leaking between VRF within a router works properly.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 15:07:55 +01:00
Louis Scalbert
90bdefa094 topotests: add retry in BGP RIB check
Add a retry option in the BGP RIB test.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 15:07:55 +01:00
Louis Scalbert
a7e794215c topotests: add ability to check that a prefix is not in BGP RIB
Add an "exist" key to check the existence of a prefix in the BGP RIB.
Useful to check that a prefix has not leaked by error.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 15:07:54 +01:00
Louis Scalbert
36c61d5c8b topotests: update bgp_vrf_route_leak_basic
Update bgp_vrf_route_leak_basic to set up the VRF interfaces. Otherwise
the routes to the VRF interface are inactives.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 14:52:47 +01:00
Louis Scalbert
6b74c9fa66 topotests: update ospf_multi_vrf_bgp_route_leak
Leaked connected routes have now the following nexthop interfaces:
- lo for routes imported from the default VRF
- or the VRF interface for routes imported from the other VRFs.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-16 14:52:47 +01:00
Donatas Abraitis
507621139b
Merge pull request #10576 from louis-6wind/fix-l3vpn-igmetric
bgpd: fix the IGP metric for best path selection on VPN import
2022-12-16 09:18:01 +02:00
Donald Sharp
074c80b705 lib, tests, zebra: Remove unused workqueue error function
The wq->spec.errorfunc is never used in the code.
It's been in the code base since 2005 and I also
do not remember ever seeing it being called.  No
workqueue process function ever returns error.
Since it's not used let's just remove it from the
code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-15 11:15:33 -05:00
Donald Sharp
9a5602b8ed tests: Limit run of config_timing when building with --enable-address-sanitizer
Building FRR with --enable-address-sanitizer and then running the
config_timing test makes the test run for over an hour on my machine.
The goal of this test is to ensure that the test runs 10000 routes
in/out in a reasonable amount of time.  We cannot test this with
address-sanitizer enabled.  So just make the test meaningless
from a timing perspective but keep it `alive` from a it might
catch some address sanitizer issue with 50 -vs- 10000 routes

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-15 11:15:33 -05:00
Louis Scalbert
dbb03df84f tests: fix IGP metric best path selection in bgp_l3vpn_to_bgp_vrf
The L3VPN best path computation now takes into accound the IGP metric.

Adapt the bgp_l3vpn_to_bgp_vrf tests so that routes with the best IGP
metric are selected when needed.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-15 17:10:59 +01:00
Louis Scalbert
e577535f15 tests: add a bgp path selection topotest
Add a bgp path selection topotest to the IGP metric path selection.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-12-15 17:10:59 +01:00
Donald Sharp
9da878b66a
Merge pull request #12481 from kuldeepkash/topotests_startup
tests: Topotests daemon start as per feature test
2022-12-15 07:31:49 -05:00
Donatas Abraitis
a1dcf3022a
Merge pull request #12438 from proelbtn/fix-#12349
bgpd: Stop overriding nexthop in vpn_leak_from_vrf_update when the peer is BGP unnumberred
2022-12-15 09:09:09 +02:00
Kuldeep Kashyap
ac6ef90b87 tests: Fix frrbot style issues
There were some style issues found by
frrbot, fixing as part of this commit.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 22:45:48 -08:00
Kuldeep Kashyap
991a971fe9 tests: Cleaning up daemon param used in start_topology()
Earlier daemon parameter was passed to
start_topology(), which is not needed now,
as new code is implemented to start
feature specific daemons.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 22:45:34 -08:00
Kuldeep Kashyap
dc4c450fc2 tests: Topotests daemon start as per feature test
Currently topotests starts all daemons by default,
made changes to f/w so only needed daemons can
be started, daemons which are needed to tests
particular test suite.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-12-13 20:25:41 -08:00
Russ White
c9c71927ea
Merge pull request #12191 from manojvn/463777
ospf6d: ospf6 route installation when changed from nssa to regular area.
2022-12-13 09:58:04 -05:00
nguggarigoud
441875ea4f tests: adding bgp unique router id automation.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-12-12 22:03:54 -08:00
Donald Sharp
21b432f79f tests: Add a test to show that BGP does not crash with unnumbered interfaces
This series of events will crash BGP prior to the prior commit:

a) Configure an interfaced based peering
b) Shut the interface the peering is over
c) remove the peering from bgp

Show that this no longer happens

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-10 07:40:32 -05:00
Donald Sharp
e3f5a669e4
Merge pull request #12462 from opensourcerouting/fix/default_originate_labeled_unicast
bgpd: Labeled unicast with default-originate
2022-12-09 19:44:58 -05:00
Donatas Abraitis
387a5ffe5a tests: Add more tests for labeled-unicast and addpath
Check if we advertise more routes when an additional path comes up, and
if we withdraw if dissapears.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-09 14:12:32 +02:00
Ryoga Saito
2b0efccd05 tests: Add topotest bgp_vrf_leaking_5549_routes
To verify previous changes, this PR introduces topotest to verify
whether imported routes learnt from BGP unnumbered peers will be active
on VPN RIB and other VRF RIB.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-12-09 07:13:54 +09:00
Donald Sharp
f47c65ff87 tests: ospf_gr_helper tests are slow
With a dead interval of 40 seconds, each tests is waiting 40+
seconds for ospf convergence to occurr because the DR is re-elected

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-12-08 14:20:23 -05:00
Donatas Abraitis
31f77524bf tests: Check if default-originate works with labeled-unicast
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-07 23:24:28 +02:00
Donald Sharp
1b97fa9976
Merge pull request #12456 from opensourcerouting/fix/bgpd_labeled_unicast_rr_addpath
bgpd: Labeled unicast fixes for addpath capability
2022-12-07 08:03:59 -05:00
Manoj Naragund
50a275d7c9 tests: Testcase for OSPFv3 learning.
Have added topotest to verify OSPF can learn different types of LSA,
and processes them

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-12-06 09:11:16 -08:00
Donatas Abraitis
b0ade0a111 tests: Check if labeled-unicast works correctly with addpath capability
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-06 18:24:13 +02:00
Russ White
17ccfbb6c2
Merge pull request #12322 from fdumontet6WIND/confed_num
bgp:  fix case where confederation id same as member-as
2022-12-06 08:59:44 -05:00
Donald Sharp
1f98f42443
Merge pull request #12437 from proelbtn/proelbtn-fix-srv6-tests
bgpd, tests: Fix topotests for SRv6 L3VPN and misuse of sid_unregister
2022-12-05 07:38:18 -05:00
Donatas Abraitis
1b484abc7d tests: Check if community-list works as expected
AND/OR cases.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-04 22:25:38 +02:00
Ryoga Saito
625fe20b6d tests: Fix topotests for bgp_srv6l3vpn
In bgp_srv6l3vpn tests, check_ping checks reachability. However, this
function have a bug and if we set expect_connected to True, check will
pass even if all ping packets are lost. This commit fixes this issue.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2022-12-04 17:02:30 +09:00
Donald Sharp
0ec0fee279
Merge pull request #12418 from opensourcerouting/fix/tests_for_while_true
Fix old tests with `while true`
2022-12-01 11:00:23 -05:00
Rafael Zalamena
60ee19e20b
Merge pull request #12425 from cscarpitta/fix/fix-bgp-srv6l3vpn-to-bgp-vrf2-topotest
tests: Fix `bgp_srv6l3vpn_to_bgp_vrf2` topotest failures
2022-12-01 07:46:52 -03:00
Carmine Scarpitta
6e502a0a75 tests: Fix bgp_srv6l3vpn_to_bgp_vrf2 topotest
The `bgp_srv6l3vpn_to_bgp_vrf2` topotest tests the SRv6 IPv4 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.

Currently, the `bgp send-extra-data zebra` option is not set in the
`bgpd` configuration, which always causes the topotest to fail.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf2` topotest by enabling
the `bgp send-extra-data zebra` option for both routers `r1` and `r2`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-11-30 22:18:49 +01:00
Donatas Abraitis
32655aa212 tests: Improve bgp_maximum_prefix_invalid_update test case
Drop `grep'ing` stuff, and check JSON data if notification was send or not.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-30 17:22:43 +02:00
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