diff options
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index bfbe5b8..2f5b3af 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -143,6 +143,13 @@ OVSBOOTPROTO=dhcp OVSDHCPINTERFACES="em1" """ +_OVS_BRIDGE_DHCP_STANDALONE = _OVS_BRIDGE_DHCP + \ + "OVS_EXTRA=\"set bridge br-ctlplane fail_mode=standalone\"\n" + +_OVS_BRIDGE_DHCP_SECURE = _OVS_BRIDGE_DHCP + \ + "OVS_EXTRA=\"set bridge br-ctlplane fail_mode=secure\"\n" + + _LINUX_BRIDGE_DHCP = """# This file is autogenerated by os-net-config DEVICE=br-ctlplane ONBOOT=yes @@ -499,6 +506,28 @@ class TestIfcfgNetConfig(base.TestCase): self.assertEqual(_OVS_BRIDGE_DHCP, self.provider.bridge_data['br-ctlplane']) + def test_network_ovs_bridge_with_standalone_fail_mode(self): + interface = objects.Interface('em1') + bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, + members=[interface], + fail_mode='standalone') + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) + self.assertEqual(_OVS_INTERFACE, self.get_interface_config()) + self.assertEqual(_OVS_BRIDGE_DHCP_STANDALONE, + self.provider.bridge_data['br-ctlplane']) + + def test_network_ovs_bridge_with_secure_fail_mode(self): + interface = objects.Interface('em1') + bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, + members=[interface], + fail_mode='secure') + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) + self.assertEqual(_OVS_INTERFACE, self.get_interface_config()) + self.assertEqual(_OVS_BRIDGE_DHCP_SECURE, + self.provider.bridge_data['br-ctlplane']) + def test_network_linux_bridge_with_dhcp(self): interface = objects.Interface('em1') bridge = objects.LinuxBridge('br-ctlplane', use_dhcp=True, |