From: Donatas Abraitis Date: Mon, 9 Aug 2021 12:37:37 +0000 (+0300) Subject: tests: Make sure BGP filters by community lists work with community alias X-Git-Tag: base_8.1~219^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=947a27f5aefac98b24146f8a7db65891c0f48038;p=mirror%2Ffrr.git tests: Make sure BGP filters by community lists work with community alias Signed-off-by: Donatas Abraitis --- diff --git a/tests/topotests/bgp_community_alias/r1/bgpd.conf b/tests/topotests/bgp_community_alias/r1/bgpd.conf index a6366204e8..13b57ad243 100644 --- a/tests/topotests/bgp_community_alias/r1/bgpd.conf +++ b/tests/topotests/bgp_community_alias/r1/bgpd.conf @@ -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 diff --git a/tests/topotests/bgp_community_alias/test_bgp-community-alias.py b/tests/topotests/bgp_community_alias/test_bgp-community-alias.py index 6aadff1cfa..26933a7992 100644 --- a/tests/topotests/bgp_community_alias/test_bgp-community-alias.py +++ b/tests/topotests/bgp_community_alias/test_bgp-community-alias.py @@ -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:]