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:
@ -23,3 +23,8 @@ class TestBondEthernetMethods(unittest.TestCase):
|
||||
self.assertTrue(bondethernet.is_bond_member(self.cfg, "GigabitEthernet1/0/1"))
|
||||
self.assertFalse(bondethernet.is_bond_member(self.cfg, "GigabitEthernet2/0/0"))
|
||||
self.assertFalse(bondethernet.is_bond_member(self.cfg, "GigabitEthernet2/0/0.100"))
|
||||
|
||||
def test_is_bondethernet(self):
|
||||
self.assertTrue(bondethernet.is_bondethernet(self.cfg, "BondEthernet0"))
|
||||
self.assertFalse(bondethernet.is_bondethernet(self.cfg, "BondEthernet-notexist"))
|
||||
self.assertFalse(bondethernet.is_bondethernet(self.cfg, "GigabitEthernet1/0/0"))
|
||||
|
Reference in New Issue
Block a user