aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_eni.py
diff options
context:
space:
mode:
authorBrent Eagles <beagles@redhat.com>2016-11-14 18:52:40 -0330
committerBrent Eagles <beagles@redhat.com>2016-11-15 10:25:33 -0330
commite479535b508b4072f64300809b824dfecc3a9182 (patch)
tree026bcef6da8b71e5188e636f30eeaf62f5ac18e7 /os_net_config/tests/test_impl_eni.py
parent38a4ffbfe045b2658abaf9459b5c8ade1f3e5429 (diff)
Add ovs_fail_mode option for OVS bridges
This patch adds an option "ovs_fail_mode" with a default value of 'standalone'. This is written to the interface configuration data as part of the ovs_extra options. Closes-Bug: #1640812 Change-Id: I2f30e56ff9fbda7beac21d95d15dbde0b01ba451
Diffstat (limited to 'os_net_config/tests/test_impl_eni.py')
-rw-r--r--os_net_config/tests/test_impl_eni.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/os_net_config/tests/test_impl_eni.py b/os_net_config/tests/test_impl_eni.py
index 086be95..e445ed4 100644
--- a/os_net_config/tests/test_impl_eni.py
+++ b/os_net_config/tests/test_impl_eni.py
@@ -66,10 +66,15 @@ iface br0 inet dhcp
pre-up ip addr flush dev eth0
"""
+_OVS_BRIDGE_DHCP_STANDALONE = _OVS_BRIDGE_DHCP + \
+ " ovs_extra set bridge br0 fail_mode=standalone\n"
+
+_OVS_BRIDGE_DHCP_SECURE = _OVS_BRIDGE_DHCP + \
+ " ovs_extra set bridge br0 fail_mode=secure\n"
+
_OVS_BRIDGE_DHCP_PRIMARY_INTERFACE = _OVS_BRIDGE_DHCP + \
" ovs_extra set bridge br0 other-config:hwaddr=a1:b2:c3:d4:e5\n"
-
_OVS_BRIDGE_DHCP_OVS_EXTRA = _OVS_BRIDGE_DHCP + \
" ovs_extra set bridge br0 other-config:hwaddr=a1:b2:c3:d4:e5" + \
" -- br-set-external-id br0 bridge-id br0\n"
@@ -188,6 +193,28 @@ class TestENINetConfig(base.TestCase):
self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config())
self.assertEqual(_OVS_BRIDGE_DHCP, self.provider.bridges['br0'])
+ def test_network_ovs_bridge_with_standalone_fail_mode(self):
+ interface = self._default_interface()
+ bridge = objects.OvsBridge('br0', use_dhcp=True,
+ members=[interface],
+ fail_mode='standalone')
+ self.provider.add_bridge(bridge)
+ self.provider.add_interface(interface)
+ self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config())
+ self.assertEqual(_OVS_BRIDGE_DHCP_STANDALONE,
+ self.provider.bridges['br0'])
+
+ def test_network_ovs_bridge_with_secure_fail_mode(self):
+ interface = self._default_interface()
+ bridge = objects.OvsBridge('br0', use_dhcp=True,
+ members=[interface],
+ fail_mode='secure')
+ self.provider.add_bridge(bridge)
+ self.provider.add_interface(interface)
+ self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config())
+ self.assertEqual(_OVS_BRIDGE_DHCP_SECURE,
+ self.provider.bridges['br0'])
+
def test_network_ovs_bridge_with_dhcp_and_primary_interface(self):
def test_interface_mac(name):