- Prune bridgedomains before pruning BVIs. The reason for this is that
prune_bridgedomains() will set the BVI to L3 mode, and if the BVI is
removed before the bridge is pruned, this is an error.
- When pruning bridge members, use the VPP configuration as the member
may not exist in the config, upon which the call to interface.is_sub()
will return False even if it is actually a VPP sub-int.
Update README.md, also take into account the previous change which calls
prune_addresses() before object deletion.
1. sub-ints have to be removed before their parent, particularly
bondethernets, because destroying BondEthernet0 will cascade
destruction of all of its sub-ints. So:
- first prune_sub_interfaces()
- then prune_bondethernets()
- finally prune_phys()
2. for any interface (loop, bvi, sub, phy, bond), prune_addresses()
before destroying the interface
Update the README with this new flow.
- 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 is more strict than VPP itself, which does allow a destination to
be L3 while the source is L2:
DBGvpp# show mode
l3 local0
l3 GigabitEthernet3/0/0
l3 GigabitEthernet3/0/1
l3 HundredGigabitEthernet12/0/0
l3 HundredGigabitEthernet12/0/1
DBGvpp# set interface l2 xconnect GigabitEthernet3/0/0 GigabitEthernet3/0/1
DBGvpp# show mode
l3 local0
l2 xconnect GigabitEthernet3/0/0 GigabitEthernet3/0/1
l3 GigabitEthernet3/0/1
l3 HundredGigabitEthernet12/0/0
l3 HundredGigabitEthernet12/0/1
But it seems undesirable to have Gi3/0/1 be in l3 mode even though it's
the target of a cross connect, so I'm going to leave the behavior
stricter than VPP.