From eeb9f76588b753f27ff6977c8d453a4bd91f4f35 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Thu, 1 Feb 2024 11:08:57 +0100 Subject: [PATCH] topotests: test leak from unknown vrf Add a test in bgp_vrf_route_leak_basic topotest to check that route leaking from a non existing VRF results in an inactive route. Signed-off-by: Louis Scalbert --- .../bgp_vrf_route_leak_basic/r1/bgpd.conf | 9 +++++++ .../test_bgp-vrf-route-leak-basic.py | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/tests/topotests/bgp_vrf_route_leak_basic/r1/bgpd.conf b/tests/topotests/bgp_vrf_route_leak_basic/r1/bgpd.conf index 03dfbf9322..ff217b3f2f 100644 --- a/tests/topotests/bgp_vrf_route_leak_basic/r1/bgpd.conf +++ b/tests/topotests/bgp_vrf_route_leak_basic/r1/bgpd.conf @@ -5,6 +5,7 @@ router bgp 99 vrf DONNA address-family ipv4 unicast redistribute connected import vrf EVA + import vrf NOTEXISTING ! ! router bgp 99 vrf EVA @@ -12,5 +13,13 @@ router bgp 99 vrf EVA address-family ipv4 unicast redistribute connected import vrf DONNA + import vrf NOTEXISTING + ! +! +router bgp 99 vrf NOTEXISTING + no bgp ebgp-requires-policy + no bgp network import-check + address-family ipv4 unicast + network 172.16.101.0/24 ! ! diff --git a/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py b/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py index d26b6968d3..4803bf64c4 100644 --- a/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py +++ b/tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py @@ -109,6 +109,18 @@ def test_vrf_route_leak(): ], }, ], + "172.16.101.0/24": [ + { + "protocol": "bgp", + "nexthops": [ + { + "interfaceIndex": 0, + "interfaceName": "unknown", + "vrf": "Unknown", + }, + ], + }, + ], } test_func = partial( @@ -157,6 +169,18 @@ def test_vrf_route_leak(): "protocol": "connected", } ], + "172.16.101.0/24": [ + { + "protocol": "bgp", + "nexthops": [ + { + "interfaceIndex": 0, + "interfaceName": "unknown", + "vrf": "Unknown", + }, + ], + }, + ], } test_func = partial(