Commit Graph

3 Commits

Author SHA1 Message Date
8a1da516f3 Fix tests for upcoming LCP assertion that intermediate interfaces 'xe0.1000' must exist as an LCP in order for Qin* sub-interfaces 'xe0.1000.1234' to be allowed 2022-03-16 22:43:13 +00:00
bb57ed8e52 IP Address validator
Returns True if there is at most one occurence of the ip_interface (an IPv4/IPv6 prefix+len)
in the entire config. That said, we need the 'iface_addresses' because VPP is a bit fickle in
this regard.

IP addresses from the same prefix/len can be added to a given interface (ie 192.0.2.1/24 and
192.0.2.2/24), but other than that, any prefix can not occur as a more-specific or less-specific
of any other interface.

So, we will allow:
- any ip_interface that is of equal network/len of existing one(s) _on the same interface_

And, we will reject
- any ip_interface that is a more specific of any existing one
- any ip_interface that is a less specific of any existing one

Update unit tests to ensure ip_interfaces are allowed in all cases.
2022-03-13 23:50:10 +00:00
95c8be553f Simple unit tester, with a few example tests 2022-03-13 17:20:10 +00:00