aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests
diff options
context:
space:
mode:
Diffstat (limited to 'os_net_config/tests')
-rw-r--r--os_net_config/tests/test_impl_eni.py5
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py5
-rw-r--r--os_net_config/tests/test_objects.py20
3 files changed, 17 insertions, 13 deletions
diff --git a/os_net_config/tests/test_impl_eni.py b/os_net_config/tests/test_impl_eni.py
index 51354f8..902cc02 100644
--- a/os_net_config/tests/test_impl_eni.py
+++ b/os_net_config/tests/test_impl_eni.py
@@ -73,8 +73,9 @@ 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_STANDALONE = _OVS_BRIDGE_DHCP + (
+ " ovs_extra set bridge br0 fail_mode=standalone "
+ "-- del-controller br0\n")
_OVS_BRIDGE_DHCP_SECURE = _OVS_BRIDGE_DHCP + \
" ovs_extra set bridge br0 fail_mode=secure\n"
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index d41cf60..337eeb3 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -175,8 +175,9 @@ NM_CONTROLLED=yes
PEERDNS=no
"""
-_OVS_BRIDGE_DHCP_STANDALONE = _OVS_BRIDGE_DHCP + \
- "OVS_EXTRA=\"set bridge br-ctlplane fail_mode=standalone\"\n"
+_OVS_BRIDGE_DHCP_STANDALONE = _OVS_BRIDGE_DHCP + (
+ "OVS_EXTRA=\"set bridge br-ctlplane fail_mode=standalone "
+ "-- del-controller br-ctlplane\"\n")
_OVS_BRIDGE_DHCP_SECURE = _OVS_BRIDGE_DHCP + \
"OVS_EXTRA=\"set bridge br-ctlplane fail_mode=secure\"\n"
diff --git a/os_net_config/tests/test_objects.py b/os_net_config/tests/test_objects.py
index eb5adaf..1c07eee 100644
--- a/os_net_config/tests/test_objects.py
+++ b/os_net_config/tests/test_objects.py
@@ -344,10 +344,11 @@ class TestBridge(base.TestCase):
}
"""
bridge = objects.object_from_json(json.loads(data))
- self.assertTrue(2 == len(bridge.ovs_extra))
- self.assertEqual("bar", bridge.ovs_extra[0])
- self.assertEqual("set bridge br-foo fail_mode=standalone",
- bridge.ovs_extra[1])
+ self.assertTrue(3 == len(bridge.ovs_extra))
+ self.assertItemsEqual(["bar",
+ "set bridge br-foo fail_mode=standalone",
+ "del-controller br-foo"],
+ bridge.ovs_extra)
def test_from_json_ovs_extra_string(self):
data = """{
@@ -358,10 +359,10 @@ class TestBridge(base.TestCase):
}
"""
bridge = objects.object_from_json(json.loads(data))
- self.assertTrue(2 == len(bridge.ovs_extra))
- self.assertEqual("bar", bridge.ovs_extra[0])
- self.assertEqual("set bridge br-foo fail_mode=standalone",
- bridge.ovs_extra[1])
+ self.assertItemsEqual(["bar",
+ "set bridge br-foo fail_mode=standalone",
+ "del-controller br-foo"],
+ bridge.ovs_extra)
class TestLinuxBridge(base.TestCase):
@@ -770,7 +771,8 @@ class TestOvsTunnel(base.TestCase):
bridge = objects.object_from_json(json.loads(data))
self.assertEqual("br-foo", bridge.name)
self.assertEqual(["set bridge br-foo something",
- "set bridge br-foo fail_mode=standalone"],
+ "set bridge br-foo fail_mode=standalone",
+ "del-controller br-foo"],
bridge.ovs_extra)
tun0 = bridge.members[0]
self.assertEqual("tun0", tun0.name)