diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-08-09 15:37:37 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-08-10 09:46:16 +0300 | 
| commit | 947a27f5aefac98b24146f8a7db65891c0f48038 (patch) | |
| tree | 848ebdba98172cc055f53f5fe99aa9f8841f353c /tests/topotests/bgp_community_alias | |
| parent | f4dd829679f33495622a9f3d40c9a5aca925df72 (diff) | |
tests: Make sure BGP filters by community lists work with community alias
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'tests/topotests/bgp_community_alias')
| -rw-r--r-- | tests/topotests/bgp_community_alias/r1/bgpd.conf | 2 | ||||
| -rw-r--r-- | tests/topotests/bgp_community_alias/test_bgp-community-alias.py | 11 | 
2 files changed, 13 insertions, 0 deletions
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:]  | 
