mirror_frr/tests/topotests/bgp_large_community
Wesley Coakley c850908b9d bgpd: separate lcommunity validation from tokenizer
`lcommunity_gettoken` expects a space-delimeted list of 0 or more large
communities. `lcommunity_list_valid` can perform this check.
`lcommunity_list_valid` now validates large community lists more
accurately based on the following condition: Each quantity in a standard bgp
large community must:

1. Contain at least one digit
2. Fit within 4 octets
3. Contain only digits unless the lcommunity is "expanded"
4. Contain a valid regex if the lcommunity is "expanded"

Moreover we validate that each large community list contains exactly 3
such values separated by a single colon each.

One quirk of our validation which is worth documenting is:

```
bgp large-community-list standard test2 permit 1:c:3
bgp large-community-list expanded test1 permit 1:c:3
```

The first line will throw an error complaining about a "malformed community-list
value". The second line will be accepted because the each value is each treated as
a regex when matching large communities, it simply will never match anything so
it's rather useless.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-01-06 07:18:20 -05:00
..
__init__.py tests: Add test cases for bgp community and large community 2019-10-17 09:19:26 +05:30
bgp_large_community_topo_1.json tests: Add test cases for bgp community and large community 2019-10-17 09:19:26 +05:30
bgp_large_community_topo_2.json tests: Add test cases for bgp community and large community 2019-10-17 09:19:26 +05:30
test_bgp_large_community_topo_1.py bgpd: separate lcommunity validation from tokenizer 2021-01-06 07:18:20 -05:00
test_bgp_large_community_topo_2.py tests: please follow the style guide 2020-12-17 15:32:55 -05:00