]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Make sure BGP filters by community lists work with community alias 9343/head
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 9 Aug 2021 12:37:37 +0000 (15:37 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 10 Aug 2021 06:46:16 +0000 (09:46 +0300)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tests/topotests/bgp_community_alias/r1/bgpd.conf
tests/topotests/bgp_community_alias/test_bgp-community-alias.py

index a6366204e8aeacb08d90c89f72690ff262b2d3a5..13b57ad243795ba7031dd49667ab2c1b57ff0bb7 100644 (file)
@@ -3,6 +3,8 @@ bgp community alias 65001:1 community-r2-1
 bgp community alias 65002:2 community-r2-2
 bgp community alias 65001:1:1 large-community-r2-1
 !
+bgp large-community-list expanded r2 seq 5 permit _65001:1:1_
+!
 router bgp 65001
  no bgp ebgp-requires-policy
  neighbor 192.168.1.2 remote-as external
index 6aadff1cfa4a27a012eb340fdb20dd31eba8f049..26933a799269cc08fdb65b0a765a0e47e9e11088 100644 (file)
@@ -138,6 +138,17 @@ def test_bgp_community_alias():
     success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
     assert result is None, "Cannot see BGP prefixes by community alias at r1"
 
+    def _bgp_show_prefixes_by_large_community_list(router):
+        output = json.loads(
+            router.vtysh_cmd("show bgp ipv4 unicast large-community-list r2 json")
+        )
+        expected = {"routes": {"172.16.16.1/32": [{"valid": True}]}}
+        return topotest.json_cmp(output, expected)
+
+    test_func = functools.partial(_bgp_show_prefixes_by_large_community_list, router)
+    success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
+    assert result is None, "Cannot see BGP prefixes by large community list at r1"
+
 
 if __name__ == "__main__":
     args = ["-s"] + sys.argv[1:]