diff options
Diffstat (limited to 'os_net_config/tests')
-rw-r--r-- | os_net_config/tests/test_impl_eni.py | 34 | ||||
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 40 |
2 files changed, 37 insertions, 37 deletions
diff --git a/os_net_config/tests/test_impl_eni.py b/os_net_config/tests/test_impl_eni.py index 55502b3..a7fba6f 100644 --- a/os_net_config/tests/test_impl_eni.py +++ b/os_net_config/tests/test_impl_eni.py @@ -96,32 +96,32 @@ class TestENINetConfig(base.TestCase): def test_interface_no_ip(self): interface = self._default_interface() - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_v4_IFACE_NO_IP, self.get_interface_config()) def test_add_interface_with_v4(self): v4_addr = objects.Address('192.168.1.2/24') interface = self._default_interface([v4_addr]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V4_IFACE_STATIC_IP, self.get_interface_config()) def test_add_interface_with_v6(self): v6_addr = objects.Address('fe80::2677:3ff:fe7d:4c') interface = self._default_interface([v6_addr]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V6_IFACE_STATIC_IP, self.get_interface_config()) def test_add_interface_dhcp(self): interface = self._default_interface() interface.use_dhcp = True - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_IFACE_DHCP, self.get_interface_config()) def test_add_interface_with_both_v4_and_v6(self): v4_addr = objects.Address('192.168.1.2/24') v6_addr = objects.Address('fe80::2677:3ff:fe7d:4c') interface = self._default_interface([v4_addr, v6_addr]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V4_IFACE_STATIC_IP + _V6_IFACE_STATIC_IP, self.get_interface_config()) @@ -129,14 +129,14 @@ class TestENINetConfig(base.TestCase): interface = self._default_interface() interface.ovs_port = True interface.bridge_name = 'br0' - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config()) def test_network_with_routes(self): route1 = objects.Route('192.168.1.1', '172.19.0.0/24') v4_addr = objects.Address('192.168.1.2/24') interface = self._default_interface([v4_addr], [route1]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V4_IFACE_STATIC_IP, self.get_interface_config()) self.assertEqual(_RTS, self.get_route_config()) @@ -144,8 +144,8 @@ class TestENINetConfig(base.TestCase): interface = self._default_interface() bridge = objects.OvsBridge('br0', use_dhcp=True, members=[interface]) - self.provider.addBridge(bridge) - self.provider.addInterface(interface) + self.provider.add_bridge(bridge) + self.provider.add_interface(interface) self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config()) self.assertEqual(_OVS_BRIDGE_DHCP, self.provider.bridges['br0']) @@ -158,23 +158,23 @@ class TestENINetConfig(base.TestCase): interface = objects.Interface(self.if_name, primary=True) bridge = objects.OvsBridge('br0', use_dhcp=True, members=[interface]) - self.provider.addBridge(bridge) - self.provider.addInterface(interface) + self.provider.add_bridge(bridge) + self.provider.add_interface(interface) self.assertEqual(_OVS_PORT_IFACE, self.get_interface_config()) self.assertEqual(_OVS_BRIDGE_DHCP_PRIMARY_INTERFACE, self.provider.bridges['br0']) def test_vlan(self): vlan = objects.Vlan('eth0', 5) - self.provider.addVlan(vlan) + self.provider.add_vlan(vlan) self.assertEqual(_VLAN_NO_IP, self.get_interface_config('vlan5')) def test_vlan_ovs_bridge_int_port(self): vlan = objects.Vlan('eth0', 5) bridge = objects.OvsBridge('br0', use_dhcp=True, members=[vlan]) - self.provider.addBridge(bridge) - self.provider.addVlan(vlan) + self.provider.add_bridge(bridge) + self.provider.add_vlan(vlan) self.assertEqual(_VLAN_OVS_PORT, self.get_interface_config('vlan5')) @@ -203,7 +203,7 @@ class TestENINetConfigApply(base.TestCase): v4_addr = objects.Address('192.168.1.2/24') interface = objects.Interface('eth0', addresses=[v4_addr], routes=[route]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.provider.apply() iface_data = utils.get_file_data(self.temp_config_file.name) @@ -213,8 +213,8 @@ class TestENINetConfigApply(base.TestCase): interface = objects.Interface('eth0') bridge = objects.OvsBridge('br0', use_dhcp=True, members=[interface]) - self.provider.addInterface(interface) - self.provider.addBridge(bridge) + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) self.provider.apply() iface_data = utils.get_file_data(self.temp_config_file.name) self.assertEqual((_OVS_BRIDGE_DHCP + _OVS_PORT_IFACE), iface_data) diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index 2157cd0..aee34d3 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -118,26 +118,26 @@ class TestIfcfgNetConfig(base.TestCase): def test_add_base_interface(self): interface = objects.Interface('em1') - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_NO_IP, self.get_interface_config()) def test_add_ovs_interface(self): interface = objects.Interface('em1') interface.ovs_port = True - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_OVS_IFCFG, self.get_interface_config()) def test_add_interface_with_v4(self): v4_addr = objects.Address('192.168.1.2/24') interface = objects.Interface('em1', addresses=[v4_addr]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V4_IFCFG, self.get_interface_config()) self.assertEqual('', self.get_route_config()) def test_add_interface_with_v6(self): v6_addr = objects.Address('2001:abc:a::/64') interface = objects.Interface('em1', addresses=[v6_addr]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V6_IFCFG, self.get_interface_config()) def test_network_with_routes(self): @@ -146,7 +146,7 @@ class TestIfcfgNetConfig(base.TestCase): v4_addr = objects.Address('192.168.1.2/24') interface = objects.Interface('em1', addresses=[v4_addr], routes=[route1, route2]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.assertEqual(_V4_IFCFG, self.get_interface_config()) self.assertEqual(_ROUTES, self.get_route_config()) @@ -154,8 +154,8 @@ class TestIfcfgNetConfig(base.TestCase): interface = objects.Interface('em1') bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, members=[interface]) - self.provider.addInterface(interface) - self.provider.addBridge(bridge) + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) self.assertEqual(_OVS_INTERFACE, self.get_interface_config()) self.assertEqual(_OVS_BRIDGE_DHCP, self.provider.bridges['br-ctlplane']) @@ -168,29 +168,29 @@ class TestIfcfgNetConfig(base.TestCase): interface = objects.Interface('em1', primary=True) bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, members=[interface]) - self.provider.addInterface(interface) - self.provider.addBridge(bridge) + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) self.assertEqual(_OVS_INTERFACE, self.get_interface_config()) self.assertEqual(_OVS_BRIDGE_DHCP_PRIMARY_INTERFACE, self.provider.bridges['br-ctlplane']) def test_add_vlan(self): vlan = objects.Vlan('em1', 5) - self.provider.addVlan(vlan) + self.provider.add_vlan(vlan) self.assertEqual(_VLAN_NO_IP, self.get_interface_config('vlan5')) def test_add_vlan_ovs(self): vlan = objects.Vlan('em1', 5) vlan.ovs_port = True - self.provider.addVlan(vlan) + self.provider.add_vlan(vlan) self.assertEqual(_VLAN_OVS, self.get_interface_config('vlan5')) def test_add_ovs_bridge_with_vlan(self): vlan = objects.Vlan('em1', 5) bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, members=[vlan]) - self.provider.addVlan(vlan) - self.provider.addBridge(bridge) + self.provider.add_vlan(vlan) + self.provider.add_bridge(bridge) self.assertEqual(_VLAN_OVS_BRIDGE, self.get_interface_config('vlan5')) def test_ovs_bond(self): @@ -198,9 +198,9 @@ class TestIfcfgNetConfig(base.TestCase): interface2 = objects.Interface('em2') bond = objects.OvsBond('bond0', use_dhcp=True, members=[interface1, interface2]) - self.provider.addInterface(interface1) - self.provider.addInterface(interface2) - self.provider.addBond(bond) + self.provider.add_interface(interface1) + self.provider.add_interface(interface2) + self.provider.add_bond(bond) self.assertEqual(_NO_IP, self.get_interface_config('em1')) em2_config = """DEVICE=em2 @@ -251,7 +251,7 @@ class TestIfcfgNetConfigApply(base.TestCase): v4_addr = objects.Address('192.168.1.2/24') interface = objects.Interface('em1', addresses=[v4_addr], routes=[route1, route2]) - self.provider.addInterface(interface) + self.provider.add_interface(interface) self.provider.apply() @@ -264,8 +264,8 @@ class TestIfcfgNetConfigApply(base.TestCase): interface = objects.Interface('em1') bridge = objects.OvsBridge('br-ctlplane', use_dhcp=True, members=[interface]) - self.provider.addInterface(interface) - self.provider.addBridge(bridge) + self.provider.add_interface(interface) + self.provider.add_bridge(bridge) self.provider.apply() ifcfg_data = utils.get_file_data(self.temp_ifcfg_file.name) @@ -277,7 +277,7 @@ class TestIfcfgNetConfigApply(base.TestCase): def test_vlan_apply(self): vlan = objects.Vlan('em1', 5) - self.provider.addVlan(vlan) + self.provider.add_vlan(vlan) self.provider.apply() ifcfg_data = utils.get_file_data(self.temp_ifcfg_file.name) |