Commit Graph

1866 Commits

Author SHA1 Message Date
Donatas Abraitis
b820f3d0a3 tests: Check if bgp community alias NAME ALIAS commands works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-05 16:37:01 +03:00
Donatas Abraitis
48c2039199
Merge pull request #8564 from rameshabhinay/bgp_tcp_mss
bgpd: Support tcp-mss for bgp neighbors
2021-05-05 13:45:39 +03:00
Igor Ryzhov
3adfae9613 tests: fix isis-topo1 topologies
parse_topology function doesn't correctly process vertex types with
spaces. Therefore the reference topology files are completely messed up,
we have values in incorrect fields - types in metrics, metrics in
parents, etc.

This commit fixes the parsing function and the reference files.

The same fix was done for isis-topo1-vrf in #8365.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-05 12:26:38 +03:00
Mark Stapp
403e26cd03 tests: add unit test for nexthop comparisons
Add a nexthop unit test module, just exercising the 'basic'
comparison api for now.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-05-04 15:51:01 -04:00
Abhinay Ramesh
4ab467017e bgpd: Support tcp-mss for bgp neighbors
Problem Statement:
=================
In scale setup BGP sessions start flapping.

RCA:
====
In virtualized environment there are multiple places where
MTU need to be set. If there are some places were MTU is not set
properly then there is chances that BGP packets get fragmented,
in scale setup this will lead to BGP session flap.

Fix:
====
A new tcp option is provided as part of this implementation,
which can be configured per neighbor and helps to set the TCP
max segment size. User need to derive the path MTU between the BGP
neighbors and set that value as part of tcp-mss setting.

1. CLI Configuration:
	[no] neighbor <A.B.C.D|X:X::X:X|WORD> tcp-mss (1-65535)

2. Running config
    frr# show running-config
    router bgp 100
     neighbor 198.51.100.2 tcp-mss 150       => new entry
     neighbor 2001:DB8::2 tcp-mss 400        => new entry

3. Show command
    frr# show bgp neighbors 198.51.100.2
    BGP neighbor is 198.51.100.2, remote AS 100, local AS 100, internal link
    Hostname: frr
      Configured tcp-mss is 150, synced tcp-mss is 138     => new display

4. Show command json output

    frr# show bgp neighbors 2001:DB8::2 json
    {
      "2001:DB8::2":{
        "remoteAs":100,
        "bgpTimerKeepAliveIntervalMsecs":60000,
        "bgpTcpMssConfigured":400,                               => new entry
        "bgpTcpMssSynced":388,                                  => new entry

Risk:
=====
Low - This is a config driven feature and it sets the max segment
size for the TCP session between BGP peers.

Tests Executed:
===============
Have done manual testing with three router topology.
1. Executed basic config and un config scenarios
2. Verified if the config is updated in running config
   during config and no config operation
3. Verified the show command output in both CLI format and
   JSON format.
4. Verified if TCP SYN messages carry the max segment size
   in their initial packets.
5. Verified the behaviour during clear bgp session.
6. done packet capture to see if the new segment size
   takes effect.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-05-04 06:21:24 +00:00
David Lamparter
62cd66d90b tests: add scapy to topotests Docker
Not having scapy in the docker image leads to very obtuse failures in
the pim bsm tests (obtuse, as in, it just fails without any hint as to
why...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:55 +02:00
David Lamparter
507e0e5d66 lib: add *_swap_all to typesafe containers
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:04 +02:00
Mark Stapp
f71e1ff6a9
Merge pull request #8545 from opensourcerouting/assert-our-own
*: make our own assert() actually work
2021-05-03 11:17:36 -04:00
David Lamparter
8dff30f801 tests: fix assert.h header change fallout
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
64dd77361f lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.

Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
Igor Ryzhov
b32454e10c tests: fix bgp-auth topotest
Individual tests must not depend on each other. In particular, a test
can't be sure that the previous test config is applied or cleared.
It is definitely not true when a single test is executed, for example:
`test_bgp_auth.py::test_prefix_peer_remove_passwords`.

This commit makes all tests independent of each other. It also adds a
call to check_all_peers_established at the start of "remove_passwords"
tests to make sure that we not only block new peers with an incorrect
password, but also clean the existing peers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-01 01:31:26 +03:00
Rafael Zalamena
058d0236b6
Merge pull request #8588 from idryzhov/a-lot-of-isis-fixes
a lot of isis fixes
2021-04-30 07:58:19 -03:00
Igor Ryzhov
ec62fbaa07 isisd: fix ldp-sync configuration
YANG model and CLI commands allow user to configure LDP-sync per area.
But the actual implementation is incorrect - all commands are changing
the config for the whole VRF instead of a single area. This commit fixes
this issue by actually implementing per area configuration.

Fixes #8578.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
bcf2208156 isisd: allow arbitrary order of area/interface configuration
Currently we don't allow to configure the interface before the area is
configured. This approach has the following issues:

1. The area config can be deleted even when we have an interface config
   relying on it. The code is not ready for that - we'll have a whole
   bunch of stale pointers if user does that.
2. The code doesn't correctly process the event of changing the VRF for
   an interface. There is no mechanism to ensure that the area exists
   in the new VRF so currently the circuit still stays in the old VRF.

This commit allows an arbitrary order of area/interface configuration.
There is no more need to configure the area before configuring the
interface.

This change fixes both the issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
rgirada
2fbb8f4543 ospfd: show ip ospf interface only shows BDR info, Added DR info.
Description:
	DR information is missing under "show ip ospf interface [json]".
	Added DR infomation to display in "show ip ospf interface".

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-04-29 04:20:14 -07:00
Quentin Young
e70620f6a6
Merge pull request #8546 from ton31337/fix/add_markers_for_recent_bgpd 2021-04-28 19:51:28 +00:00
Jafar Al-Gharaibeh
fa4154ef8b
Merge pull request #8322 from qlyoung/topotests
Assorted topotests cleanup
2021-04-28 10:40:25 -05:00
Igor Ryzhov
8d3dab20b5 tests: fix topotest polling log
The current log prints maximum wait time which is not actually correct,
because it doesn't include the command execution time. We usually have
"failed after X seconds" log with X being far longer than this maximum.

Let's print the maximum number of tries instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-28 02:52:58 +03:00
Donatas Abraitis
ad889e0d17 tests: Add pytest bgpd markers for recent BGP tests
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-27 09:23:58 +03:00
Rafael Zalamena
ae08637827
Merge pull request #8540 from donaldsharp/kill_them_all
tests: Remove kill_mininet_router_process
2021-04-26 11:52:38 +00:00
Rafael Zalamena
cd66038b98
Merge pull request #8555 from idryzhov/fix-bfd-test
tests: fix bfd-bgp-cbit-topo3 test
2021-04-26 11:49:00 +00:00
Igor Ryzhov
f49bdb86eb tests: fix bfd-bgp-cbit-topo3 test
This test is completely incorrect on test_bfd_loss_intermediate step.
It shuts down the interface and then "waiting" for the BGP session to
fail. But instead of the actual wait it compares the output of "show bfd
peers" with the "up" state. As it does this comparison right after the
interface shutdown, the BFD session has not yet failed and the comparison
is always successful except very rare cases when the command takes a lot
of time to execute (due to the heavy load on CI system I suppose).

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-24 01:33:32 +03:00
Igor Ryzhov
2ccc493333
Merge pull request #8495 from opensourcerouting/ospfv3-bfd-rework
ospf6d: rework BFD integration and add BFD profiles support
2021-04-24 00:47:31 +03:00
Rafael Zalamena
d5f9847a9e topotests: test PIM BFD profile integration
Test that PIM BFD profile integration works.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:29:00 -03:00
Rafael Zalamena
0d00ac9cb5 topotests: add new basic PIM topology test
Test for PIM (re)convergence and BFD usage.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:29:00 -03:00
David Lamparter
6a0eb6885b *: drop zassert.h
It's not actually working properly...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-23 12:06:35 +02:00
Donald Sharp
ec8f360f2d tests: Remove kill_mininet_router_process
This function kills all processes that happen to have the same
name to frr processes and it was only ever used in the setup.
Setup should not be used to kill old runs.  That should be a
separate process.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-22 15:47:37 -04:00
Rafael Zalamena
7fcb9ef4cc topotests: test OSPFv3 BFD profiles
See if the BFD sessions created by OSPFv3 are using the configured BFD profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:04 -03:00
Rafael Zalamena
4a9e802c3c topotests: converge OSPFv3 faster
Tweak OSPFv3 interface configuration to converge faster.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:04 -03:00
David Lamparter
0c4285d77e build: properly split CFLAGS from AC_CFLAGS
`CFLAGS` is a "user variable", not intended to be controlled by
configure itself.  Let's put all the "important" stuff in AC_CFLAGS and
only leave debug/optimization controls in CFLAGS.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21 15:42:36 +02:00
Martin Winter
6e0368f61a
Merge pull request #8434 from donaldsharp/python_bullshit
Python pylint stuff
2021-04-16 23:17:04 +02:00
Martin Winter
0575d5a8f8
Merge pull request #8437 from donaldsharp/verify_bgp_community_no_sleep
tests: Do not sleep(5) when verifying bgp communities
2021-04-15 14:03:37 +02:00
Donald Sharp
afbb000e26 tests: test_bgp_vrf_dynamic_route_leak_topo1.py was missing a variable
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
6882ab5e7f tests: Fix test_bgp_multi_vrf_topo2.py string formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
0b711f0a20 tests: test_bgp_multi_vrf_topo1.py fix formatting issues pointed out by pylint
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
f4baa8fe25 tests: Remove unnecessary formating for strings
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
d9df892180 tests: Remove duplicate functions in python code
We have basically two identical functions in test_bgp_gr_functionality_topo1.py
Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:06 -04:00
Sri Mohana Singamsetty
e64a538c70
Merge pull request #8448 from ton31337/feature/show_rpki_state_in_global_show_bgp
bgpd: Show RPKI short state in `show bgp <afi> <safi>`
2021-04-13 17:32:37 -07:00
Mark Stapp
d7265db9b3 tests: run black over mcast-pim-static, static_routing_with_[ei]bgp
Run black and clean up formatting along with pylint cleanup.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 13:34:57 -04:00
Mark Stapp
ec3ed7234d tests: fix pylint errors in static_routing_with_ibgp
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
aa59a7090a tests: fix pylint errors in static_routing_with_ebgp tests
Fix pylint errors; also enable the test in 'topo4', which has never
run.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
914faab594 tests: fix pylint errors in mcast-pim-static-rp-topo1
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
f3dbd9d3ef
Merge pull request #8145 from pguibert6WIND/nhrp_use_zebra
nhrp: use zebra
2021-04-13 08:02:56 -04:00
Donatas Abraitis
d89b48fe28 tests: Add BGP RPKI show header to outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:34:52 +03:00
Philippe Guibert
e63801cd5f topotests: add standard nhrp test between spoke and hub
This test establishes a binding between nbma ip of a spoke and its
protocol address. This information is pushed to hub.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Donald Sharp
9e7fd5ecbd tests: Do not sleep(5) when verifying bgp communities
There are better ways of ensuring that the remote side
has your change instead of sleeping

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 12:02:18 -04:00
Donald Sharp
0b25370e95 tests: More black fixups
Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:35:05 -04:00
Donald Sharp
98ca91e181 tests: Add some more pytest marks for bgpd
Just another round of trying to add pytest.mark.bgpd.  Not finished yet just
what I could stand doing for a few minutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:34:45 -04:00
Donatas Abraitis
6740a191ad Revert "bgpd: BGP session not established for ipv6 link local address with vrf config"
This reverts commit 0b6d35324e.
2021-04-09 10:14:32 +03:00
Patrick Ruddy
fb94a2e65d
Merge pull request #8402 from opensourcerouting/debian10-topotest-fix
tests: fix for l3mdev topotests on kernel 4.19
2021-04-08 14:54:54 +01:00
Donatas Abraitis
9d78be6aac
Merge pull request #7434 from sudhanshukumar22/bgp-link-local-address
bgpd: BGP session not established for ipv6 link local address with vrf config
2021-04-08 09:26:55 +03:00
Mark Stapp
a702694a60
Merge pull request #8365 from aldobrrrr/fix_parse_topology_function_in_isis_topo1_vrf_test
topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
2021-04-07 15:01:12 -04:00
Quentin Young
660c59ed6f tests: fix use of undefined variable in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
5aab262b74 tests: fix improper format strings in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
8ab4625666 tests: remove duplicate pim test function
Twice defined

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
c287dfd25c tests: provide sane default for --topology-only
Fixes:

/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1463: in getoption
    val = getattr(self.option, name)
E   AttributeError: 'Namespace' object has no attribute 'topology_only'

The above exception was the direct cause of the following exception:
/usr/lib/python3.9/site-packages/pluggy/manager.py:127: in register
    hook._maybe_apply_history(hookimpl)
/usr/lib/python3.9/site-packages/pluggy/hooks.py:333: in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:84: in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
tests/topotests/conftest.py:62: in pytest_configure
    if config.getoption("--topology-only"):
/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1474: in getoption
    raise ValueError(f"no option named {name!r}") from e
E   ValueError: no option named 'topology_only'

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Russ White
63caaeb2c1
Merge pull request #8407 from ton31337/fix/nexthop_should_not_be_changed_if_peer_shares_common_subnet
tests: Nexthop should not be changed if peer X shares a common subnet
2021-04-06 11:02:19 -04:00
Mark Stapp
1832ff8b49
Merge pull request #8295 from opensourcerouting/ospf6-topo-stabilize
topotest: stabilize OSPFv3 topology
2021-04-06 09:48:45 -04:00
Donatas Abraitis
b1367d6859 tests: Nexthop should not be changed if peer X shares a common subnet
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-06 10:32:02 +03:00
David Schweizer
6a93e3df4e
tests: fix python3 backported iproute2 vrf check
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:55 +02:00
David Schweizer
b04af734aa
tests: fix l3mdev config in isis-topo1-vrf topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:54 +02:00
David Schweizer
b7589f4e5c
tests: fix l3mdev config in bgp_vrf_lite_ipv6_rtadv topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:53 +02:00
David Schweizer
f2d729056e
tests: fix l3mdev config in bgp_l3vpn_to_bgp_vrf topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:52 +02:00
David Schweizer
a94d054dfd
tests: fix l3mdev config in bgp_evpn_rt5 topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:51 +02:00
David Schweizer
3d762f26a6
tests: add l3mdev config helpers for VRF topotests
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:50 +02:00
Kuldeep Kashyap
2268cf50d5 tests: Fix for BGP_GR test failures
Few tests were failing in BGP-GR intermittently. Fixing the failures.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-04-05 00:15:40 -07:00
sudhanshukumar22
0b6d35324e bgpd: BGP session not established for ipv6 link local address with vrf config
Description:
BGP session not established for ipv6 link local address with vrf config

Problem Description/Summary :
BGP session not established for ipv6 link local address with vrf configyy
1.Configure ipv6 link-local address fe80::1234/64 on dut1 and fe80::4567/64 on dut2
2.Configure BGP neighbors for ipv6 link-local on both dut1 and dut2
3.Verify BGP session is UP over link-local ipv6 address
4.Observed that bgp session not established for ipv6 link local address

Expected Behavior :
BGP session should be established for ipv6 link local address with vrf config

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2021-04-01 02:43:51 -07:00
Mark Stapp
e2efe13327
Merge pull request #8350 from opensourcerouting/printfrr-revamp
lib: `printfrr()` care package
2021-03-31 09:10:30 -04:00
David Lamparter
7798203f5c lib: add %pSQ and %pSE string escape formats
These are for string quoting (`%pSQ`) and string escaping (`%pSE`); the
sets / escape methods are currently rather "basic" and might be extended
in the future.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:34:56 +02:00
David Lamparter
a4cb97a6c1 lib: add %*pHX + %*pHS hexdump in printfrr
(I'll get to `zlog_hexdump()` in a separate pass.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:34:51 +02:00
David Lamparter
9c4380daee lib: add %pVA recursive printfrr
Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier
chars and `%pVA` is clearer anyway.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:32:59 +02:00
David Lamparter
cb4928ce77 lib: add FMT_NSTD() for non-standard printf exts
... to suppress the warnings when using something that isn't quite ISO C
compatible and would otherwise cause compiler warnings from `-Wformat`.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:32:59 +02:00
Russ White
1bed7a6fef
Merge pull request #8057 from ranjanyash54/default-route
ospf6d: Default Route functionality
2021-03-30 10:34:05 -04:00
Russ White
a2d351d19e
Merge pull request #8137 from Orange-OpenSource/ospf_ls
ospfd: Add Link State support
2021-03-30 10:28:37 -04:00
Russ White
40bf85a391
Merge pull request #8056 from jmmikkel/peertype
bgpd: Add "bgp bestpath peer-type multipath-relax"
2021-03-30 10:26:57 -04:00
Emanuele Altomare
dbceeaa502 topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
Now the parse_topology function handles well the vertex type identifier.

Signed-off-by: Emanuele Altomare <emanuele@common-net.org>
2021-03-29 17:41:16 +02:00
Rafael Zalamena
bcddbefe04 topotests: add tests for OSPFv3 default route
Three new tests:

 - OSPFv3 convergence using 'ipv6 ospf6 neighbor json'
 - Default route functionality:
   * Check that the LSA is present
   * Check that the route was installed

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-29 06:37:10 -07:00
David Lamparter
487eefcfbe lib: record output positions in printfrr
This replaces `%n` with a safe, out-of-band option that simply records
the start and end offset of the output produced for each `%...`
specifier.

The old `%n` code is removed.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 17:01:29 +01:00
David Lamparter
212e04e5a7 lib: rework printfrr extensions to output directly
Allowing printfrr extensions to directly write to the output buffer has
a few advantages:
- there is no arbitrary length limit imposed (previously 64)
- the output doesn't need to be copied another time
- the extension can directly use bprintfrr() to put together pieces

The downside is that the theoretical length (regardless of available
buffer space) must be computed correctly.

Extended unit tests to test these paths a bit more thoroughly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 16:56:55 +01:00
David Lamparter
9a5d359ce8
Merge pull request #8317 from mjstapp/fix_short_printfrr_buf 2021-03-26 19:40:21 +01:00
Donald Sharp
ecf9b1bb50
Merge pull request #8167 from LabNConsulting/chopps/tests-add-gdb
tests: add option for auto-launching gdb
2021-03-25 10:27:50 -04:00
ckishimo
4436ba8d46 ospfd: add topotest for suppress-fa feature
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-24 16:00:35 +01:00
Igor Ryzhov
09e2d8ed97
Merge pull request #8203 from opensourcerouting/ospf-bfd-napi
ospfd,doc,topotests: rework OSPFv2 BFD integrantion
2021-03-24 10:36:48 +03:00
Mark Stapp
f62fd2ac9f tests: use printfrr to use extended format specs
Test was using 'pFX' with printf() - need to use printfrr().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-23 14:50:14 -04:00
Joanne Mikkelson
1a9cb083b7 bgpd: Allow next hop recursion in zebra if any multipath is not eBGP
When "bgp bestpath peer-type multipath-relax" is enabled, multipaths
with both eBGP and iBGP learned routes may exist. It is not desirable
for the iBGP next hops to be discarded from the FIB because they are not
directly connected. When publishing a nexthop group to zebra, the
ZEBRA_FLAG_ALLOW_RECURSION flag is normally not set when the best path
is eBGP; when "bgp bestpath aspath multipath-relax" is configured, the
flag will now be set if any paths are from iBGP peers. This leaves
all-eBGP multipaths still requiring nexthops over connected routes.

Signed-off-by: Joanne Mikkelson <jmmikkel@arista.com>
2021-03-23 08:59:33 -07:00
Joanne Mikkelson
ee88563ac2 bgpd: Add "bgp bestpath peer-type multipath-relax"
This new BGP configuration is akin to "bgp bestpath aspath
multipath-relax". When applied, paths learned from different peer types
will be eligible to be considered for multipath (ECMP). Paths from all
of eBGP, iBGP, and confederation peers may be included in multipaths
if they are otherwise equal cost.

This change preserves the existing bestpath behavior of step 10's result
being returned, not the result from steps 8 and 9, in the case where
both 8+9 and 10 determine a winner.

Signed-off-by: Joanne Mikkelson <jmmikkel@arista.com>
2021-03-23 08:59:33 -07:00
Russ White
638fa8dd4e
Merge pull request #8253 from opensourcerouting/topotest-python3-backports
tests: iproute2 VRF capability check for topotests
2021-03-23 11:25:35 -04:00
Olivier Dugeon
927b08024e topotest: Add new OSPF TE topotest
This new test launches a small network composed by 4 OSPF routers with
Traffic Engineering and Segment Routing configuration. To assess the Link
State Traffic Engineering feature, the TED of each router is compared
against the reference TED which corresponds to the network topology.
Then a series of 6 steps, where Link, TE & SR configurations are modified
up to r4 shutwdown, are used to verify that the TED is correctly updated
on the 4 routers.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-03-23 15:39:29 +01:00
Russ White
38981e4bba
Merge pull request #8120 from ton31337/feature/bgp_ipv6_default_activated
bgpd: Activate ipv6-unicast for peer automatically if globally defined
2021-03-23 09:36:43 -04:00
Rafael Zalamena
8d69272b8f topotests: test OSPF BFD profile
Use BFD profiles in test to make sure it doesn't break.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:18:42 -03:00
Rafael Zalamena
c98581cdc8 topotests: improve OSPF(v2|v3) convergence test
Wait until all routers are actually `Full` instead of just looking at routes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:13:19 -03:00
Rafael Zalamena
639b03ca24 topotests: remove old configuration files
We version the tests with FRR so it is no longer necessary to support
old versions.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:12:40 -03:00
Rafael Zalamena
25329da182 topotest: stabilize OSPFv3 topology
Changes:
- Decrease hello interval to avoid packet loss slow downs
- Decrease dead interval to converge faster
- Remove previous 'Full' state check that wasn't checking for all
  peers (only one per router)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 09:48:16 -03:00
Donald Sharp
cb39b2d4aa
Merge pull request #8280 from kuldeepkash/bgp_convergence_test
tests: Fix bgp convergence issue mentioned in #8279
2021-03-22 10:15:36 -04:00
Donatas Abraitis
37916b2b11
Merge pull request #8121 from opensourcerouting/macro-cleanup
*: require ISO C11 + semicolons after file-scope macros
2021-03-22 11:00:34 +02:00
Donald Sharp
6dfe243c38
Merge pull request #8278 from ckishimo/ospfv3_iface
ospf6d: fix iface commands lost when removing from area
2021-03-20 20:11:16 -04:00
Christian Hopps
3f950192fe tests: add options for debugging topotest failures
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-03-19 12:45:37 -04:00
Donald Sharp
e43ba29689
Merge pull request #8263 from opensourcerouting/docker-update
tests: docker fixes & improvements
2021-03-18 13:59:30 -04:00
Kuldeep Kashyap
53402dbf1e tests: Fix bgp convergence issue mentioned in #8279
1. Enhance verify_bgp_convergence() to solve issue mentioned in #8279

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-17 17:43:57 -07:00
Donald Sharp
28bada3d8f
Merge pull request #8255 from pjdruddy/fix-ifindex-test
Fix ifindex test
2021-03-17 09:10:20 -04:00
David Lamparter
53abc26569 tests: simplify docker rsync & support worktrees
The previous, more complex mechanism failed to take into account that
git worktrees only have a stub .git file & copying the worktree itself
is not enough.  Just extract a file list beforehand & don't bother with
git inside the container.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 13:42:20 +01:00
David Lamparter
071f5c1664 tests: add libelf-dev to Dockerfile
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 13:42:20 +01:00
Rafael Zalamena
57e627628d
Merge pull request #8229 from idryzhov/bfdd-echo-rx-tx
bfdd: separate echo rx/tx timers
2021-03-17 10:41:33 +00:00
ckishimo
d205f01e1d tests: fix too many arguments for logging
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 09:35:47 +01:00
David Lamparter
80413c2073 *: require semicolon after FRR_DAEMON_INFO & co.
... again ...

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter
960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter
bf8d3d6aca *: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...

With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.

Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
ckishimo
9b1bb522e0 tests: fix warning when checking ospfv3 convergence
The following error is shown when running the OSPFv3 tests

2021-03-16 23:37:44,792 INFO: Function returned global name 'data_rid' is not defined
2021-03-16 23:37:44,792 INFO: Retry [#1] after sleeping for 2s
2021-03-16 23:37:46,794 INFO: Verifying OSPF6 neighborship on router r1:
2021-03-16 23:37:46,993 INFO: Output for command [ show ipv6 ospf6 neighbor ] on router r1:
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:03     Full/PointToPoint    00:00:01 r1-r2-eth0[PointToPoint]

Fix the "data_rid" warning by using the correct variable

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 00:19:54 +01:00
Igor Ryzhov
4df3e31c3d bfdd: separate echo rx/tx timers
Currently there is a single interval for both RX and TX echo functions.
This commit introduces separate RX and TX timers for echo packets.

The main advantage is to be able to set the receive interval to zero
when we don't want to receive echo packets from the remote system.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-16 22:14:57 +03:00
Pat Ruddy
a1997ea033 tests: re-enable RTE tests after removing fixed ifindices
Change ifindex test to grab the correct indices using the API
provided.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-03-16 15:29:20 +00:00
Pat Ruddy
2bf118962f tests: fix formatting error to make black clean
Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-03-16 15:29:19 +00:00
Karen Schoener
eb44a85454 tests: update LDP SNMP topotest to walk mib objects that are statistics
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-03-16 10:23:34 -04:00
lynne
83543d89ae test: fix isis-snmp test
Remove ifindex values being tested because it can change
between runs of the test.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-03-16 08:00:41 -04:00
David Schweizer
83d2076e4f tests: add. iproute2 VRF capability check example
Additional example usage of iproute2_is_vrf_capable check in
isis-topo1-vrf topotest.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-16 09:34:21 +01:00
David Schweizer
ddbc1ad2a0 tests: iproute2 VRF capability check examples
Example usage of iproute2_is_vrf_capable check in bgp_multi_vrf_topo1
and bgp_multi_vrf_topo2 topotests.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-15 12:49:59 +01:00
David Schweizer
0414a76446 tests: check for iproute2 VRF capability
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-15 12:48:38 +01:00
Renato Westphal
bfa46e3bdd
Merge pull request #8147 from volta-networks/feat_ldp_snmp_without_stats
ldpd: Add support for read-only snmp mib objects (excluding statistics)
2021-03-14 22:25:00 -03:00
Renato Westphal
e1908ceb42
Merge pull request #7945 from volta-networks/feat_isis_snmp
isisd: add support for read-only snmp mibs objects
2021-03-14 22:14:27 -03:00
Rafael Zalamena
5b2906f4b4 topotests: temporary disable test assert
The test has been failing often recently and it is causing some false
positives for unrelated PRs.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-14 10:15:20 -03:00
Rafael Zalamena
296951b598 topotests: remove some interface index check
Don't expect the interface index to be always the same.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-12 17:33:23 -03:00
Rafael Zalamena
0085000b9e topotests: remove some FRR version checks
We version the tests with the source code so we should no longer attempt
to support old versions in development branch.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-12 17:32:12 -03:00
GalaxyGorilla
17128dea27 tests: Replace ospf-sr-topo1 by ospf-sr-topo2
The new ospf-sr-topo2 tests are much broader and detailed,
hence it makes no sense to keep the old ospf-sr-topo1
tests.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-03-10 10:37:58 +00:00
GalaxyGorilla
9dd6fc9ded tests: OSPF SR topotests (ospf-sr-topo2)
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-03-10 10:14:38 +00:00
Russ White
7c7e4db935
Merge pull request #8123 from gromit1811/fix_topotest_ipv6_linklocal
tests: Fix determination of IPv6 link-local addresses
2021-03-09 11:25:10 -05:00
David Lamparter
6adedc6fe3
Merge pull request #8176 from LabNConsulting/chopps/fix-locale-fail
tests: Sort expected and actual to avoid locale issues
2021-03-09 12:34:38 +01:00
Donatas Abraitis
f79d311b3e
Merge pull request #8180 from kuldeepkash/topojson_framework
tests: Improve error/assert message logging
2021-03-08 09:32:09 +02:00
Donatas Abraitis
7b94dd35dd
Merge pull request #8195 from qlyoung/fix-community-type-command
tests: fix community-list invalid command
2021-03-07 17:04:57 +02:00
Kuldeep Kashyap
5cbb02ebde tests: Improve error/assert message logging
1. Improved error meesage logging.
2. No functionality changes only put some meaningfull error messages.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-06 00:51:43 -08:00
Donald Sharp
122a7974dd
Merge pull request #8196 from ton31337/feature/rfc8654_bgpd
bgpd: Add BGP Extended message support
2021-03-05 07:18:42 -05:00
Rafael Zalamena
ee56932473
Merge pull request #8165 from wesleycoakley/misc-qol-fixups
staticd, pimd, tests: small fixups and cov fix
2021-03-05 11:22:47 +00:00
Christian Hopps
00756aa345 tests: Sort expected and actual to avoid locale issues
Avoid undocumented topotest dependency on installing en_US locale.
With this change dependency is removed.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-03-04 12:33:26 -05:00
Quentin Young
bb4bcaad9a
Merge pull request #8190 from gromit1811/fix_topotest_pylint
tests: Fix topotest.py pylint errors
2021-03-03 15:43:38 -05:00
Donatas Abraitis
8b6ff0de56 tests: Use BGP Extended Message length
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-03 22:21:08 +02:00
Rafael Zalamena
fecbc5d2e7
Merge pull request #8189 from idryzhov/topotest-mkdir
tests: don't complain when /tmp/topotests exists
2021-03-03 19:30:11 +00:00
Quentin Young
60e7da0cff tests: fix community-list invalid command
Didn't test this but it's already randomly broken so cant be worse

Hopefully fixes:

raise InvalidCLIError("%s" % output)
InvalidCLIError: line 2: % Command incomplete[4]: bgp
large-community-list standard Test1 permit

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-03-03 13:56:39 -05:00
Martin Buck
67c3bf97c3 tests: Fix topotest.py pylint errors
Fix 2 string formatting errors (cosmetic only - remove unused string
formatting arguments). Also fix obvious typos in empty class FreeBSDRouter
implementation.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-03-03 16:19:59 +01:00
Igor Ryzhov
f60e5fd3d1
Merge pull request #8183 from kuldeepkash/multicast_pim_bsm
tests: Fix for test failure in PR #8158
2021-03-03 18:05:41 +03:00
Igor Ryzhov
cac0ed050e tests: don't complain when /tmp/topotests exists
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-03 14:22:15 +03:00
Wesley Coakley
23f3a92e34
tests: address coverity / styling issues in topotests
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-03-02 20:44:15 -05:00
Donald Sharp
17d1e8a386 tests: Don't generate support bundles when we get the results we want
We are generating support bundles for tests being run that
are passing.  Tell the system...

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-02 13:41:50 -05:00
Donald Sharp
9dfe1acd2a tests: Remove sleep(60) and look for convergence
Sleeping when convergence is not guaranteed in 60 seconds
and then testing the rib to see if it has the data is
not a great way to have a test complete all the time.

Modify the code so that we check for convergence
and if we have converged then look in the rib.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-02 13:41:50 -05:00
lynne
0a4340469e tests: Adding test for ISIS SNMP
Adding test to verify walking of the ISIS SNMP MIB

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-03-02 10:06:31 -05:00
Kuldeep Kashyap
d99438d27d tests: Fix for test failure in PR #8158
1. There were few tests where routes were configured with blackhole and
non-blackhole nexthops simultaneously, enhanced tests accordingly and
verified in master branch and with PR #8158 changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-02 05:32:28 -08:00
Donald Sharp
5980ad0ae0 tests: Run black against tests again to clean up formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:18:49 -05:00
Donald Sharp
b9a210f951 tests: Add pytest.mark.snmp
Add the ability to run snmp tests

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:17:53 -05:00
Donald Sharp
5ad1fd54a8 tests: Add some pytest.mark.bgpd
Add some pytest.mark.bgpd.  This is about all I could stomach doing
in one patch.  I'll do another pass at another time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:11:38 -05:00
Donatas Abraitis
484ff4899b tests: Check if bgp default ipv[46]-unicast commands work
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-02-28 19:51:12 +02:00
Renato Westphal
784f92f052 isisd: handle corner case involving TI-LFA and the SR No-PHP flag
When the last SID in the TI-LFA repair list is an Adj-SID from the
penultimate hop router towards the final hop, the No-PHP flag of the
original Prefix-SID must be honored in the repair list itself since
the penultimate hop router won't have a chance to process that SID
and pop it if necessary.

Reported-by: Fredi Raspall <fredi@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-02-26 15:54:01 -03:00
Kuldeep Kashyap
5900cf46f7 tests: Fix for blackhole test in test_mcast_pim_bsmp suite
1. Fixed for blackhole test in test_mcast_pim_bsmp suite

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-02-25 23:49:58 -08:00
Karen Schoener
0534e94c10 tests: add topotest for LDP SNMP
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-02-24 17:38:02 -05:00