Commit Graph

2506 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
93a7f236ac topotest: enable pim when detecting pim using unified config
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-03-15 22:29:52 -05:00
nguggarigoud
d1b5fa5b9e tests: adding ospfv3 base cases.
Covers basic test case like route map, rte calc.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fix the issue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #10101.

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

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

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

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

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

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

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

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

Adding correct expectations in the test case.

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

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

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

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

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

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

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

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

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

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

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

      Subcode     Symbolic Name

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

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

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

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

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

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

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

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

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

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

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

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

unet> r0 show ip ospf neigh

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

unet> r1 show ip ospf neigh

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

unet> r2 show ip ospf neigh

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

unet> r3 show ip ospf neigh

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

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

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

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

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

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

Ran >2000 times, no failure.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-12 13:24:04 -05:00
Donald Sharp
4378495a27 bgpd: Add vrf information to best path debugging
When debugging issues for routes in multiple vrf's.  It would
be extremely useful if the debug output had which vrf we
are acting on.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The problem is that the sharp code is doing this:

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

			zapi_nexthop_from_nexthop(api_nh, nh);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Modify the test for in two ways:

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

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-22 14:47:49 -04:00