summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2025-03-03 17:22:59 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2025-03-03 20:43:11 +0100
commite0f585fcab3e5ab6c1bc6e2174262d4b18872068 (patch)
tree92d3e8bf67af3b984fe9a1a1eb2fe61874718367 /tests
parent32088c43a81d7e5d0ef8d21c3da15676d006a0d9 (diff)
topotests: add a test to unconfigure aggregated prefix on VPN
That test will ensure the VPN prefix associated is removed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py b/tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py
index e2727a3ed7..f6bfed5bb0 100644
--- a/tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py
+++ b/tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py
@@ -574,6 +574,40 @@ def test_aggregated_exported_route_on_r1():
assert result is None, assertmsg
+def test_aggregated_suppress_aggregate_r1():
+ """
+ Check that only the suppressed networks are exported
+ """
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ r1 = tgen.gears["r1"]
+ r1.vtysh_cmd(
+ """
+ configure terminal
+ router bgp 65500 vrf vrf1
+ address-family ipv4 unicast
+ no aggregate-address 172.31.1.0/24
+ """
+ )
+
+ r1 = tgen.gears["r1"]
+ logger.info("Checking 172.31.1.0/24 VPN prefix is hot present on R1")
+
+ expected = {}
+ test_func = partial(
+ topotest.router_json_cmp,
+ r1,
+ "show bgp ipv4 vpn 172.31.1.0/24 json",
+ expected,
+ exact=True,
+ )
+ _, result = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
+ assertmsg = '"{}" JSON output mismatches'.format(r1.name)
+ assert result is None, assertmsg
+
+
def test_memory_leak():
"Run the memory leak test and report results."
tgen = get_topogen()