Commit Graph

3080 Commits

Author SHA1 Message Date
Donatas Abraitis
1da2aac4e3 tests: Adjust AIGP metric numbers for iBGP setup
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-08 23:34:33 +03:00
Donald Sharp
bdcc5df5c3 tests: ospf_metric_propagation should not look for a specific vrfId
There is no guarantee that the vrfId is going to be the same across
tests, as that the vrfId is chosen based upon the ifindex of the
vrf device.  As such we should not be looking for the vrfId, but
the correct vrf name.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-08 08:06:30 -04:00
Donald Sharp
cb7c6fc2b9 tests: ospf_metric_propagation is looking for a specific ifindex
The test ospf_metric_propagation is looking for a specific ifindex
this ifindex is not guaranteed to be any particular value by the underlying
OS.  So let's remove this test for it.  As a side note I am seeing
tests fail in upstream CI because of this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-08 07:47:49 -04:00
Naveen Guggarigoud
2c435e98ad tests: removing un used loopback interface from bgp admin dist.
Signed-off-by: Naveen Guggarigoud <nguggarigoud@vmware.com>
2023-05-05 05:20:40 +00:00
Jafar Al-Gharaibeh
f92f88d361 tests: clear the ospf neighbor to force a state change
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-04 08:27:17 -05:00
Donatas Abraitis
66e0f6c456 tests: Check RIP allow-ecmp an arbitrary number of paths
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:23:26 +03:00
Donatas Abraitis
4972a6ee7f tests: Check if RIP allow-ecmp command can inject specified number of routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:02:42 +03:00
Donatas Abraitis
786e2b8bdb Revert "MPLS allocation mode per next hop"
Broken tests, let's revert now.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-03 13:52:46 +03:00
Donatas Abraitis
99a1ab0b21
Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh
MPLS allocation mode per next hop
2023-05-02 18:36:45 +03:00
Russ White
ccf08bda1a
Merge pull request #13377 from donaldsharp/ospf_dead_interval
tests: Increase the dead interval to be longer for neighbor testing
2023-05-02 10:25:46 -04:00
Donald Sharp
fa8d4970d2
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification
tests: Do not try establishing a connection from r1 to r2
2023-05-02 08:42:43 -04:00
Donatas Abraitis
bec4eeedc4
Merge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto
bgpd, tests: srv6 "no sid vpn export auto" per AF in vtysh
2023-05-01 22:07:03 +03:00
Donald Sharp
4c5f1eeb60
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
startup log timestamp precision build option
2023-05-01 09:51:46 -04:00
Christian Hopps
3e09791861 tests: change topotest log timestamp precision to 6.
- Often millisecond precision is not good enough to differentiate things that
occur directly one after another, and things that have some pause in between,
increase to microsecond precision (reporting)

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29 02:36:17 -04:00
Dmytro Shytyi
4eef588ac3 tests: validate sid export per-vrf and per-af
Verify activation and desactivation of per-vrf and per-af
sid export. Modify the configuration of r2 and verify that
changes are reflected in r1 and on connectivity between ce1 and c2.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-04-28 22:51:12 +02:00
Carmine Scarpitta
778d75a6f2 tests: Fix bgp_srv6l3vpn_to_bgp_vrf3 topotest
The `bgp_srv6l3vpn_to_bgp_vrf3` topotest tests the SRv6 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

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

The `bgp send-extra-data zebra` option has been accidentally commented
out in commit 2007e2dbd0.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by re-adding
the missing `bgp send-extra-data zebra` option.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2023-04-28 17:37:03 +02:00
Donatas Abraitis
47074a99e4 tests: Do not try establishing a connection from r1 to r2
If r1 becomes the "server" (= local port 179), then it initiates the connection
after sending BGP Notification (BFD Down) and r2 resets the last error code.

Telling r1 do not connect to r2, fixes the issue.

Tested with `pytest -s -n 48` at least 20 times - no failures.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-26 21:51:33 +03:00
Russ White
257fddaeb6
Merge pull request #13246 from opensourcerouting/rip-bfd
ripd: support BFD integration
2023-04-25 11:54:32 -04:00
Russ White
0ed5c87cfe
Merge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list
ripd: Create non default passive interface if defined so
2023-04-25 11:07:31 -04:00
Russ White
4855ca5e56
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community
bgpd: Add Node Target Extended Communities support
2023-04-25 11:06:23 -04:00
Donald Sharp
7a59014e7d tests: Run black on test_ospf_lan.py
frrbot unhappy.
Let's bring a smile to it's life.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:54:07 -04:00
Donald Sharp
a602765471 tests: Increase the dead interval to be longer for neighbor testing
the ospf_basic_functionality/test_ospf_lan.py script is setting
up a lan env that will have 4 ospf routers on it and shutting/no
shutting interfaces with various priorities to see that ospf
is properly choosing roles.  I am consistently seeing the
ospf_basic_functionality/test_ospf_lan.py script failing
where it is saying a neighbor is not in the correct state.

Upon examination of the logs we are seeing this:

2023/04/24 09:16:42 OSPF: [M7Q4P-46WDR] vty[7]@(config)# interface r0-s1-eth0  <----- This is where we no shut the interface
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:53 OSPF: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task ospf_ism_event (556af08a5b4c) ran for 6038ms (cpu time 0ms)
2023/04/24 09:16:53 OSPF: [HKQ2F-8D0MY][EC 100663315] Thread Starvation: {(thread *)0x556af19da020 arg=0x556af19c0dd0 timer  r=-5.086     ospf_ase_calculate_timer() &ospf->t_ase_calc from ospfd/ospf_ase.c:635} was scheduled to pop greater than 4s ago
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@> enable
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@# show ip ospf neighbor all
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable

This test is setting the dead interval to 4 seconds, seeing a 6 second delay where the os has gone to town
(probably because of the high load on the system ) and not choosing the correct neighbor as the DR.

OSPF when coming up and after seeing the first neighbor, goes into a waiting period before
the DR is elected.  If the neighbor does send it's hello packets but they are not processed
before the wait timer pops because of the starvation event, then the wrong neighbor
will be elected DR.  Let's give this test a bit more time to decide who the
DR is in case everything goes a bit south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:52:31 -04:00
Christian Hopps
1a68b13867 tests: fix missed passing pytestconfig arg
Remove the local ConfigOptionProxy and actually use the munet one.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Christian Hopps
7d12017bd8 tests: import munet 0.13.2
fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Donald Sharp
ea4163ce49
Merge pull request #13365 from LabNConsulting/chopps/add-perf-option
Add ability to profile daemons in topotest with --perf
2023-04-24 07:38:45 -04:00
Donatas Abraitis
766fcb6056
Merge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native
cfgopt in munet and native config support and example
2023-04-24 13:50:36 +03:00
Christian Hopps
e6079f4fa4 tests: add --perf and --perf-options for profiling daemons
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 21:53:44 -04:00
Donald Sharp
3eefea9249
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
lib: typesafe shenanigans
2023-04-23 15:06:59 -04:00
Christian Hopps
a929d94ff5 tests: add an example of using munet native config
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 15:02:46 -04:00
Christian Hopps
0def198cd3 tests: enable using munet native configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00
Christian Hopps
d9de3cc48b tests: munet now supports cfgopt directly
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00
Christian Hopps
67afd9293d tests: import munet version 0.13.1
- adds more generic config option handling than pytestconfig
- Change to search order for kinds.yaml

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:51:46 -04:00
Christian Hopps
9001ae5a67 tests: import munet version 0.12.16
Fixes bad fixed path use and rootcmd functionality to run things
in the root namespace (all but pid at least).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 01:29:49 -04:00
Donald Sharp
2da3174115
Merge pull request #13332 from LabNConsulting/chopps/new-opts 2023-04-22 19:51:05 -04:00
Christian Hopps
c510a9e451 munet: import 0.12.15
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-22 13:10:52 -04:00
Christian Hopps
449e25552b tests: fix ASAN file cleanup and --asan-abort option
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-22 13:10:52 -04:00
Christian Hopps
346374b04f tests: will need new pid_exists if using pid namespaces
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:13:04 -04:00
Christian Hopps
2b62abe441 tests: restore per-node logging functionality
After the munet switch we weren't passing the logger on to low-level
LinuxNamespace and thus Commander parent classes, so the lowest-level
`cmd_status` logs were missing from more specific log files in the run
directory.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
260268c45c tests: fix check for daemon startup, remove sleep hack
- Remove the .pid and .vty files and then wait for them to show back up.
- Fix broken BGP GR test to not fail now that it's bug is exposed. It
only worked b/c when starting a daemon the pid file still existed and
blocked the bogus second BGP launch from happening.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
ff28990ee4 tests: add --logd option
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
773fd82ed5 tests: add --pcap and --pause-at-end options
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
249ac6f0f2 tests: cleanup access to pytest config
Rather than create a new global dict and copy all the config into it, just
expose the pytest config globally and use it directly.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:54 -04:00
Christian Hopps
7592b2ccae tests: blacken re-format
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-21 22:10:48 -04:00
David Lamparter
5523a505f4 lib: fix _hash_member() crash w/ empty hash
The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.

Test case added to tests/lib/test_typelist.

Note this function is not currently used anywhere.  Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 16:30:32 +02:00
Donald Sharp
de35b3c29a
Merge pull request #13327 from opensourcerouting/fix/rip_status_align
ripd: Align show ip rip status output for sources
2023-04-21 09:41:00 -04:00
Philippe Guibert
7b343a9ed5
Merge pull request #12933 from Orange-OpenSource/link_state
lib: Update edge key in link state database
2023-04-20 18:33:21 +02:00
Donatas Abraitis
696172d7bd tests: Align show ip rip status output in tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-19 22:08:03 +03:00
Donatas Abraitis
5db1931962
Merge pull request #13166 from Jafaral/ospf-external-metric
ospfd: use rib metric as the base for set metric +/-
2023-04-19 21:11:25 +03:00
Rafael Zalamena
7001bdb7b2 topotests: RIP BFD integration topology test
Add new RIP topology to test the BFD integration and RIP ECMP:
shutdown a link and expect the RIP route change immediately instead of
regular RIP timer.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-04-19 11:17:52 -03:00
Donatas Abraitis
0a2268c28e tests: Check if RIPd passive-interface works as expected
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-18 22:37:53 +03:00
Olivier Dugeon
fd4377d9a5
Merge pull request #11667 from louis-6wind/flexalgo-mpls
isisd: Flex-Algo for SR-MPLS
2023-04-18 14:45:30 +02:00
Hiroki Shirokura
b901ee6383 tests: add isis_sr_flex_algo_topo2 for flex-algo
Add a topotest with 9 flex-algo routers to check each router's MPLS
table.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
1a61ef95b2 tests: add isis_sr_flex_algo_topo1 for flex-algo
Add a topotest to check some Flex-Algo configuration changes.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Eric Kinzie
42ac448538 isisd: add option to display isis routes as json
Append an optional parameter to "show isis route [prefix-sid]" that
formats the output as a JSON array.

Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
78774bbcd5 isisd: add isis flex-algo lsp advertisement
Deal with the packing and unpacking of following Flex-Algo
Sub-Sub-TLVs:

- Router Capability (already defined TLV 242)
	- List of the Flex-Algo Definitions (Sub-TLV 26)
		- Exclude admin group (Sub-Sub-TLV 1)
                - Include-any admin group (Sub-Sub-TLV 2)
                - Include-all admin group (Sub-Sub-TLV 3)
                - Flags (for prefix-metric) (Sub-Sub-TLV 4)

This commit splits data into multiple router capability TLVs if needed
because a TLV cannot contains more than 255 bytes.

Note that the list of SR Algorithm (Sub-TLV 19) within Router Capability
(TLV 242) is already set in a previous commit.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 11:33:15 +02:00
Hiroki Shirokura
0de7b43308 isisd: update isis_tlvs_add_*_reach() with multi algorithm
isis_tlvs_add_extended_ip_reach adds IS-IS Extended
IP reachability to the LSP. In this case, if the
pcfg argument is not NULL, you can add IGP
Prefix-SID as its sub tlv.

Before this commit, only one Prefix-SID can be added.
After this commit, the argument is not a single
pointer but an array of pointers, and multiple
Prefix-SIDs can be added.

This feature is necessary because Flex-Algo
requires multiple Prefix-SIDs for each Algorithm.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:11:52 +02:00
Jafar Al-Gharaibeh
360ed671bc tests: add a topotest for ospf metric propagation across vrfs/protocols
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-04-18 00:48:16 -05:00
Donald Sharp
eda79af4a4
Merge pull request #13230 from LabNConsulting/micronet-is-munet
Micronet is munet
2023-04-17 13:35:29 -04:00
Donatas Abraitis
89618e7e5e
Merge pull request #13320 from LabNConsulting/fix-show-opdata-command
Fix show opdata command
2023-04-17 14:51:38 +03:00
Hiroki Shirokura
329f87b310 isisd: update struct isis_spftree with algorithm id
The spftree has a new property called algorithm
which is id used to identify the algorithm that
separates it in the same IGP network. This is
used in Flex-Algo. In other cases than Flex-Algo,
the algorithm id is always zero.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-17 11:06:08 +02:00
Donatas Abraitis
e7fd314f06
Merge pull request #12550 from AbhishekNR/mld_join
pim6d: Implementing "ipv6 mld join"
2023-04-17 11:01:21 +03:00
Christian Hopps
9b3fd1ef69 tests: use a more specific xpath for finding the route JSON data
Rather than requesting the data for the entire model, just request the route
data for the specific prefix. This also tests the xpath code (which was
previously broken).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:18:56 -04:00
Christian Hopps
b5c12fb1f1 tests: use shlex.quote to pass command arg to vtysh
This makes sure any included quotation is properly escaped and passed
through to vtysh.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps
b70b22af95 tests: quick fix for --gdb-daemons=DAEMONLIST not working
When launching the daemons under gdb it takes a bit for them to come up, the
currently code only looks for pid files to determine if the daemon is running.
This test is no good as these files are left around by previous runs.

For now do a simple sleep when debugging with gdb to get things working.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Donatas Abraitis
eee1fca3eb
Merge pull request #13141 from mjstapp/fix_ospf_json_keys
ospfd: remove deprecated json attrs for neighbor show
2023-04-16 21:33:20 +03:00
Christian Hopps
60e037780e tests: switch to munet
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 13:29:38 -04:00
Christian Hopps
c568b4ac4f tests: restart bgpd to avoid warnings in follow on tests
The tests are killing bgpd and then ending, the next test is checking for all
daemons running and spewing warnings to stderr. Restart the daemons before
ending the test (like other tests in this same module) to avoid this.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 09:39:05 -04:00
Christian Hopps
352ddc72b7 tests: import munet 0.12.12
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 08:48:19 -04:00
Christian Hopps
7c5d70611a tests: fix warning, incorrect use of is.
Remove the never-executed code.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-14 17:23:58 -04:00
Donald Sharp
e503294060 tests: Run formatting script on test_isis_advertise_high_metrics.py
Apparently this is needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-13 07:29:00 -04:00
Donald Sharp
8356f48119
Merge pull request #13284 from isabelladeleon12/fix_adv_high_metrics_ut_warning
tests: Fix topotest invalid escape sequence in isis_advertise_high_me…
2023-04-13 07:26:37 -04:00
Donatas Abraitis
0667f62411
Merge pull request #13276 from pguibert6WIND/explicit_null_complement
Explicit null complement
2023-04-13 08:56:04 +03:00
Donald Sharp
13a1758a6a
Merge pull request #13177 from mjstapp/fix_ospf_supoort_typo
ospf,ospf6: fix json key typo supoort
2023-04-12 14:26:22 -04:00
Isabella de Leon
d3f6aa39df tests: Fix topotest invalid escape sequence in isis_advertise_high_metrics test
Modify test to fix issue 13283

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-04-12 10:53:07 -07:00
Philippe Guibert
6d5f16a45c topotests: fix bgp lu explicit-null test
The label value for the given prefix was ignored,
as the compare function always returns ok.
Do return the json compare output.

Fixes: eee086e6d2 ("topotests: add topotest to check bgp lu explicit-null service")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-12 17:45:52 +02:00
Jafar Al-Gharaibeh
7a29a05023
Merge pull request #13183 from Pdoijode/pdoijode/pim-json-changes
pimd: Option to get IGMP groups and sources for a particular interface
2023-04-11 23:46:18 -05:00
Donatas Abraitis
068c4dfe0b tests: Check if Node Target Extended Communities work
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-11 23:26:33 +03:00
Mark Stapp
f827dc810c
Merge pull request #13258 from donaldsharp/evpn_ping
Evpn ping
2023-04-11 16:15:44 -04:00
Mark Stapp
425e2278d5
Merge pull request #13260 from donaldsharp/bgp_l3vpn_to_vrf_scale_up
tests: Ensure that the scale_up.py script tests for actual sharp inst…
2023-04-11 16:05:32 -04:00
Pooja Jagadeesh Doijode
5519cabe4c pimd: Option to get IGMP groups and sources for a particular interface
1. Added interface name, group address and detail option to existing
   "show ip igmp groups" so that user can retrieve all the groups
   or a particular group for an interface. Detail option shows the source
   information for the group. With that, the show command
   looks like:

   "show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"

2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present

3. Changed "detail" option to print non pretty JSON

4. Added interface name and group address to existing
   "show ip igmp sources" so that user can retrieve all the sources for
   all the groups or, all the sorces for a particular group for an
   interface. With that, the show command looks like:

   "show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-04-11 11:00:39 -07:00
Donald Sharp
66d0d2184e tests: Ensure that the scale_up.py script tests for actual sharp installed routes first
The scale_up.py script used by several tests installs 50k routes into the rib from
sharpd.  It is first looking for the results in the bgp database.  Let's ensure
that the routes are actually installed into the rib first before looking in
the bgp tables.  This should help situations where the system is under extreme
load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 10:49:34 -04:00
Philippe Guibert
eee086e6d2 topotests: add topotest to check bgp lu explicit-null service
The test ensures that the incoming prefixes are received with
the appropriate label value, and that connectivity is ensured
between prefixes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-11 16:08:15 +02:00
Donald Sharp
d6f34434e8 tests: Cleanup formatting in a couple of test scripts
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 09:16:36 -04:00
Donald Sharp
18a8f40793 tests: Fix evpn tests to ensure mac addresses will show up
Locally, the bgp_evpn_vxlan_svd_topo1 and bgp_evpn_vxlan_topo1
tests are failing for me.  Upon inspection the test is looking
for the mac addresses of the interfaces participating in the
evpn bridging on the hosts.  For some reason on my machine
these mac addresses are not in the l2 tables at all on
PE1 or PE2.  Adding quick pings solves the problems.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-11 09:15:13 -04:00
Jafar Al-Gharaibeh
8b985768bf
Merge pull request #13239 from opensourcerouting/fix/enable_scripting_for_docker_alpine_build
docker: Fix --enable-scripting for Docker images
2023-04-10 11:29:20 -05:00
Donatas Abraitis
897bb1675e tests: Copy script1.lua for make dist
This is needed for `make dist` when building Docker images with Lua support.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-08 21:04:07 +03:00
Christian Hopps
8d6765aa6d tests: fix cause of intermittent failure
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-08 04:03:11 +00:00
Mark Stapp
a63fecfb56 ospf,ospf6: fix json key typo supoort
Fix json key 'supoort' -> 'support'; add 1-year deprecation
notice; fix topotests to use corrected json key.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:19:01 -04:00
Mark Stapp
c42ac5f64b tests: replace deprecated ospf json keys
Replace many deprecated json keys in topotests after removing
those keys from ospfd.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:17:59 -04:00
Jafar Al-Gharaibeh
d5243675f2
Merge pull request #13109 from LabNConsulting/topotest-cleanup
minor topotest cleanup
2023-04-07 14:45:33 -05:00
Igor Ryzhov
083369e16a
Merge pull request #13228 from LabNConsulting/chopps/json-via-yang
Update ripd YANG operational state (ECMP routes)
2023-04-07 17:56:54 +03:00
Olivier Dugeon
c62067c1a6 tests: Update TE topotests to follow new Edge Key
Following replacement of Edge Key type (uint64_t by new structure), this patch
updates the various TE topotests to the new Edge Key references.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Donatas Abraitis
83c78d54c2 tests: Check if RIP allow-ecmp command works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 04:21:25 -04:00
Christian Hopps
19003d6e99 tests: don't warn with expected results
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:58:15 +00:00
Christian Hopps
fa773d1109 tests: initialize parent test namespace too
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
66707495d9 tests: cleanup infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
cd453c23f6 tests: create 8 link, switch pairs, not 8 links on one switch
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
eb9e801f8b tests: don't flush ipv6 addresses
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Donald Sharp
aa056a2a64 bgpd: Treat withdraw variable as a bool
Used as a bool, treated as a bool.  Make it a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 17:41:32 -04:00
Jafar Al-Gharaibeh
f25a43ad12
Merge pull request #13200 from kuldeepkash/socat_cleanup
tests: [topojson] multicast pimv6 socat cleanup
2023-04-04 13:36:03 -05:00
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