summaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_ifcfg.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-25 17:35:48 +0000
committerGerrit Code Review <review@openstack.org>2016-03-25 17:35:48 +0000
commit4da6d609bbcd25438a41de87111aed3180a10007 (patch)
treeaa91b203dcd86f5726325e3a3a6c9f70d83b6703 /os_net_config/tests/test_impl_ifcfg.py
parent5d8bb4c6a1baee3f9e677f25086eadebef167d9e (diff)
parentbfc72bd5ce838dad03e41e44cae661074552cb39 (diff)
Merge "Fix order-of-operations bug in os-net-config restart_interfaces"
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index 3500e4c..fa85de7 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -179,11 +179,11 @@ BOOTPROTO=none
"""
_VLAN_LINUX_BRIDGE = _BASE_VLAN_OVS + """VLAN=yes
+PHYSDEV=em1
BRIDGE=br-ctlplane
BOOTPROTO=none
"""
-
_OVS_BOND_DHCP = """# This file is autogenerated by os-net-config
DEVICE=bond0
ONBOOT=yes
@@ -246,6 +246,12 @@ class TestIfcfgNetConfig(base.TestCase):
def get_interface_config(self, name='em1'):
return self.provider.interface_data[name]
+ def get_vlan_config(self, name='vlan1'):
+ return self.provider.vlan_data[name]
+
+ def get_linux_bond_config(self, name='bond0'):
+ return self.provider.linuxbond_data[name]
+
def get_route_config(self, name='em1'):
return self.provider.route_data.get(name, '')
@@ -430,19 +436,19 @@ class TestIfcfgNetConfig(base.TestCase):
def test_add_vlan(self):
vlan = objects.Vlan('em1', 5)
self.provider.add_vlan(vlan)
- self.assertEqual(_VLAN_NO_IP, self.get_interface_config('vlan5'))
+ self.assertEqual(_VLAN_NO_IP, self.get_vlan_config('vlan5'))
def test_add_vlan_ovs(self):
vlan = objects.Vlan('em1', 5)
vlan.ovs_port = True
self.provider.add_vlan(vlan)
- self.assertEqual(_VLAN_OVS, self.get_interface_config('vlan5'))
+ self.assertEqual(_VLAN_OVS, self.get_vlan_config('vlan5'))
def test_add_vlan_mtu_1500(self):
vlan = objects.Vlan('em1', 5, mtu=1500)
self.provider.add_vlan(vlan)
expected = _VLAN_NO_IP + 'MTU=1500\n'
- self.assertEqual(expected, self.get_interface_config('vlan5'))
+ self.assertEqual(expected, self.get_vlan_config('vlan5'))
def test_add_ovs_bridge_with_vlan(self):
vlan = objects.Vlan('em1', 5)
@@ -450,16 +456,15 @@ class TestIfcfgNetConfig(base.TestCase):
members=[vlan])
self.provider.add_vlan(vlan)
self.provider.add_bridge(bridge)
- self.assertEqual(_VLAN_OVS_BRIDGE, self.get_interface_config('vlan5'))
+ self.assertEqual(_VLAN_OVS_BRIDGE, self.get_vlan_config('vlan5'))
def test_add_linux_bridge_with_vlan(self):
- vlan = objects.Vlan(None, 5)
+ vlan = objects.Vlan('em1', 5)
bridge = objects.LinuxBridge('br-ctlplane', use_dhcp=True,
members=[vlan])
self.provider.add_vlan(vlan)
self.provider.add_bridge(bridge)
- self.assertEqual(_VLAN_LINUX_BRIDGE,
- self.get_interface_config('vlan5'))
+ self.assertEqual(_VLAN_LINUX_BRIDGE, self.get_vlan_config('vlan5'))
def test_ovs_bond(self):
interface1 = objects.Interface('em1')
@@ -489,7 +494,7 @@ BOOTPROTO=none
members=[interface1, interface2])
self.provider.add_linux_bond(bond)
self.assertEqual(_LINUX_BOND_DHCP,
- self.get_interface_config('bond0'))
+ self.get_linux_bond_config('bond0'))
def test_interface_defroute(self):
interface1 = objects.Interface('em1')