diff options
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index fa1efdb..cf1f0c0 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -60,7 +60,7 @@ HOTPLUG=no DEVICETYPE=ovs TYPE=OVSBridge OVSBOOTPROTO=dhcp -OVSDHCPINTERFACES=em1 +OVSDHCPINTERFACES="em1" """ _BASE_VLAN = """DEVICE=vlan5 @@ -70,6 +70,7 @@ VLAN=yes PHYSDEV=em1 """ + _VLAN_NO_IP = _BASE_VLAN + "BOOTPROTO=none\n" @@ -86,6 +87,16 @@ BOOTPROTO=none """ +_OVS_BOND_DHCP = """DEVICE=bond0 +ONBOOT=yes +HOTPLUG=no +DEVICETYPE=ovs +TYPE=OVSBond +OVSBOOTPROTO=dhcp +BOND_IFACES="em1 em2" +""" + + class TestIfcfgNetConfig(base.TestCase): def setUp(self): @@ -163,6 +174,25 @@ class TestIfcfgNetConfig(base.TestCase): self.provider.addBridge(bridge) self.assertEqual(_VLAN_OVS_BRIDGE, self.get_interface_config('vlan5')) + def test_ovs_bond(self): + interface1 = objects.Interface('em1') + interface2 = objects.Interface('em2') + bond = objects.OvsBond('bond0', use_dhcp=True, + members=[interface1, interface2]) + self.provider.addInterface(interface1) + self.provider.addInterface(interface2) + self.provider.addBond(bond) + self.assertEqual(_NO_IP, self.get_interface_config('em1')) + + em2_config = """DEVICE=em2 +ONBOOT=yes +HOTPLUG=no +BOOTPROTO=none +""" + self.assertEqual(em2_config, self.get_interface_config('em2')) + self.assertEqual(_OVS_BOND_DHCP, + self.get_interface_config('bond0')) + class TestIfcfgNetConfigApply(base.TestCase): |