Add a few additional useful functions

- is_*() returns True if the interface name is of a certain type
  is_bondethernet() is_loopback() is_bvi() is_bridgedomain()
  is_vxlan_tunnel() is_phy()
- get_phys() by process of elimination, returns all interface names
  that are supposed to be physical network interfaces.

Add unit tests for validator/vxlan_tunnel.py
 => Notable: while here, fix a bug in get_by_name()
Add unit tests for all the is_*() and get_phys() functions.
This commit is contained in:
Pim van Pelt
2022-03-24 10:45:34 +00:00
parent ac5b8fcc8f
commit b43d7903fd
10 changed files with 182 additions and 2 deletions

View File

@ -0,0 +1,24 @@
vxlan_tunnels:
vxlan_tunnel0:
description: "Correctly configured VXLAN"
local: 192.0.2.1
remote: 192.0.2.2
vni: 100
vxlan_tunnel1:
description: "VXLAN VNI overlaps with vxlan_tunnel2"
local: 2001:db8::1
remote: 2001:db8::2
vni: 101
vxlan_tunnel2:
description: "VXLAN VNI overlaps with vxlan_tunnel1"
local: 192.0.2.9
remote: 192.0.2.10
vni: 101
vxlan_tunnel3:
description: "VXLAN src/dst address family mismatch"
local: 192.0.2.17
remote: 2001:db8:1::2
vni: 102