move the correct veth into the netns for the LB

bug 1035649

This fix moves the correct device into the namespace and improves the test
to ensure the proper device was moved.  The previous generic check
failed to catch an error during refactoring.

Change-Id: Ifa2e2bb97dc923549d00b1750c61a22e139647d7
This commit is contained in:
Mark McClain 2012-08-11 11:29:14 -04:00
parent 532dc02d23
commit b45d4eb280
2 changed files with 2 additions and 2 deletions

View File

@ -165,7 +165,7 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver):
root_veth.link.set_address(mac_address)
namespace = ip.ensure_namespace(network_id)
namespace.add_device_to_namespace(root_veth)
namespace.add_device_to_namespace(dhcp_veth)
root_veth.link.set_up()
dhcp_veth.link.set_up()

View File

@ -178,7 +178,7 @@ class TestBridgeInterfaceDriver(TestBase):
[mock.call('sudo'),
mock.call().add_veth('tap0', 'dhc0'),
mock.call().ensure_namespace('01234567-1234-1234-99'),
mock.call().ensure_namespace().add_device_to_namespace(mock.ANY)])
mock.call().ensure_namespace().add_device_to_namespace(ns_veth)])
root_veth.assert_has_calls([mock.call.link.set_up()])
ns_veth.assert_has_calls([mock.call.link.set_up()])