diff options
author | Brent Eagles <beagles@redhat.com> | 2016-11-09 17:19:14 -0330 |
---|---|---|
committer | Brent Eagles <beagles@redhat.com> | 2016-11-15 10:25:33 -0330 |
commit | 38a4ffbfe045b2658abaf9459b5c8ade1f3e5429 (patch) | |
tree | d002165eb1bdca02f84e44f07799211d23526e13 /os_net_config/tests/test_impl_eni.py | |
parent | 3199064d4d5ce5a81fb38c831c11ab539ed8716a (diff) |
Add support for name replacement in OVS_EXTRA
While primarily to work around a heat issue that prevents intrinsic
functions from being used for parameters being passed to NetworkConfig
resources, this could be generally useful in other ways.
Partial-Bug: #1640812
Change-Id: Ie9001f1d41f514666a44c8d9295b78a13e2108dc
Diffstat (limited to 'os_net_config/tests/test_impl_eni.py')
-rw-r--r-- | os_net_config/tests/test_impl_eni.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/os_net_config/tests/test_impl_eni.py b/os_net_config/tests/test_impl_eni.py index 5d3bb8c..086be95 100644 --- a/os_net_config/tests/test_impl_eni.py +++ b/os_net_config/tests/test_impl_eni.py @@ -72,7 +72,7 @@ _OVS_BRIDGE_DHCP_PRIMARY_INTERFACE = _OVS_BRIDGE_DHCP + \ _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" + " -- br-set-external-id br0 bridge-id br0\n" _VLAN_NO_IP = """auto vlan5 @@ -210,7 +210,24 @@ class TestENINetConfig(base.TestCase): 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" + ovs_extra = "br-set-external-id br0 bridge-id br0" + 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_network_ovs_bridge_with_dhcp_and_primary_with_ovs_format(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 {name} bridge-id {name}" bridge = objects.OvsBridge('br0', use_dhcp=True, members=[interface], ovs_extra=[ovs_extra]) |