Add unit tests for bondethernet

This commit is contained in:
Pim van Pelt
2022-03-20 22:17:41 +00:00
parent 31c3d13c12
commit 1f07f7eadf
4 changed files with 51 additions and 13 deletions

View File

@ -80,19 +80,6 @@ def has_address(yaml, ifname):
return 'addresses' in iface
def is_bond_member(yaml, ifname):
""" Returns True if this interface is a member of a BondEthernet """
if not 'bondethernets' in yaml:
return False
for bond, iface in yaml['bondethernets'].items():
if not 'interfaces' in iface:
continue
if ifname in iface['interfaces']:
return True
return False
def get_bridge_interfaces(yaml):
""" Returns a list of all interfaces that are bridgedomain members """