Merge "linuxbridge UT: Mock get_interface_by_ip"

This commit is contained in:
Jenkins 2015-03-12 03:30:12 +00:00 committed by Gerrit Code Review
commit d479b47938

View File

@ -47,6 +47,8 @@ class TestLinuxBridge(base.BaseTestCase):
super(TestLinuxBridge, self).setUp()
interface_mappings = {'physnet1': 'eth1'}
with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
'get_interface_by_ip', return_value=None):
self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager(
interface_mappings)
@ -104,8 +106,10 @@ class TestLinuxBridgeAgent(base.BaseTestCase):
'get_interface_mac')
self.get_mac = self.get_mac_p.start()
self.get_mac.return_value = '00:00:00:00:00:01'
self.agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({},
0)
with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
'get_interface_by_ip', return_value=None):
self.agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC(
{}, 0)
def test_treat_devices_removed_with_existed_device(self):
agent = self.agent
@ -339,6 +343,8 @@ class TestLinuxBridgeManager(base.BaseTestCase):
super(TestLinuxBridgeManager, self).setUp()
self.interface_mappings = {'physnet1': 'eth1'}
with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
'get_interface_by_ip', return_value=None):
self.lbm = linuxbridge_neutron_agent.LinuxBridgeManager(
self.interface_mappings)
@ -752,6 +758,8 @@ class TestLinuxBridgeManager(base.BaseTestCase):
def test_delete_vxlan_bridge_no_int_mappings(self):
interface_mappings = {}
with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
'get_interface_by_ip', return_value=None):
lbm = linuxbridge_neutron_agent.LinuxBridgeManager(
interface_mappings)