]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotests: add a test to unconfigure aggregated prefix on VPN
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 3 Mar 2025 16:22:59 +0000 (17:22 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 3 Mar 2025 19:43:11 +0000 (20:43 +0100)
That test will ensure the VPN prefix associated is removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests/topotests/bgp_vpnv4_ebgp/test_bgp_vpnv4_ebgp.py

index e2727a3ed73848388e5fb05c471b3c03c9dd7dcb..f6bfed5bb03c0e5bba01506b7cc8ab606ac853ee 100644 (file)
@@ -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()