summaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_eni.py
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2014-08-22 10:38:17 -0400
committerDan Prince <dprince@redhat.com>2014-08-22 10:38:17 -0400
commit941cbfec49a3ee2d2ff6aa3fa054fb2559886ca4 (patch)
tree50b7273780a84fe7841bb78c08649d28782fb4e8 /os_net_config/tests/test_impl_eni.py
parent3b5e8789871e1722f8a5122236893730cf3d1751 (diff)
Add support for ovs_extra.
Adds support for ovs_extra to the OVS Bridge and OVS bond objects.
Diffstat (limited to 'os_net_config/tests/test_impl_eni.py')
-rw-r--r--os_net_config/tests/test_impl_eni.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_eni.py b/os_net_config/tests/test_impl_eni.py
index a7fba6f..701806f 100644
--- a/os_net_config/tests/test_impl_eni.py
+++ b/os_net_config/tests/test_impl_eni.py
@@ -56,6 +56,12 @@ iface br0 inet dhcp
_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 br-ctlplane bridge-id br-ctlplane\n"
+
+
_VLAN_NO_IP = """auto vlan5
iface vlan5 inet manual
vlan-raw-device eth0
@@ -164,6 +170,23 @@ class TestENINetConfig(base.TestCase):
self.assertEqual(_OVS_BRIDGE_DHCP_PRIMARY_INTERFACE,
self.provider.bridges['br0'])
+ def test_network_ovs_bridge_with_dhcp_and_primary_with_ovs_extra(self):
+
+ def test_interface_mac(name):
+ return "a1:b2:c3:d4:e5"
+ self.stubs.Set(utils, 'interface_mac', test_interface_mac)
+
+ interface = objects.Interface(self.if_name, primary=True)
+ ovs_extra = "br-set-external-id br-ctlplane bridge-id br-ctlplane"
+ bridge = objects.OvsBridge('br0', use_dhcp=True,
+ members=[interface],
+ ovs_extra=[ovs_extra])
+ self.provider.add_bridge(bridge)
+ self.provider.add_interface(interface)
+ self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config())
+ self.assertEqual(_OVS_BRIDGE_DHCP_OVS_EXTRA,
+ self.provider.bridges['br0'])
+
def test_vlan(self):
vlan = objects.Vlan('eth0', 5)
self.provider.add_vlan(vlan)