Merge "Set up MTU docker interface"
This commit is contained in:
commit
2c61aca1b5
|
@ -982,7 +982,7 @@ def network_driver_join():
|
|||
|
||||
try:
|
||||
ifname, peer_name, (stdout, stderr) = binding.port_bind(
|
||||
endpoint_id, neutron_port, all_subnets)
|
||||
endpoint_id, neutron_port, all_subnets, filtered_networks[0])
|
||||
app.logger.debug(stdout)
|
||||
if stderr:
|
||||
app.logger.error(stderr)
|
||||
|
|
|
@ -43,12 +43,15 @@ class TestKuryrBase(TestCase):
|
|||
if hasattr(app, 'DEFAULT_POOL_IDS'):
|
||||
del app.DEFAULT_POOL_IDS
|
||||
|
||||
def _mock_out_binding(self, endpoint_id, neutron_port, neutron_subnets):
|
||||
def _mock_out_binding(self, endpoint_id, neutron_port,
|
||||
neutron_subnets, neutron_network=None):
|
||||
self.mox.StubOutWithMock(binding, 'port_bind')
|
||||
fake_binding_response = (
|
||||
'fake-veth', 'fake-veth_c', ('fake stdout', ''))
|
||||
binding.port_bind(endpoint_id, neutron_port,
|
||||
neutron_subnets).AndReturn(fake_binding_response)
|
||||
neutron_subnets,
|
||||
neutron_network).AndReturn(
|
||||
fake_binding_response)
|
||||
self.mox.ReplayAll()
|
||||
return fake_binding_response
|
||||
|
||||
|
@ -86,7 +89,7 @@ class TestKuryrBase(TestCase):
|
|||
app.neutron.list_networks(tags=t).AndReturn(fake_list_response)
|
||||
|
||||
self.mox.ReplayAll()
|
||||
return neutron_network_id
|
||||
return fake_list_response
|
||||
|
||||
@staticmethod
|
||||
def _get_fake_v4_subnetpools(subnetpool_id, prefixes=["192.168.1.0/24"],
|
||||
|
|
|
@ -43,7 +43,7 @@ class TestKuryrJoinFailures(base.TestKuryrFailures):
|
|||
return response
|
||||
|
||||
def _port_bind_with_exeption(self, docker_endpoint_id, neutron_port,
|
||||
neutron_subnets, ex):
|
||||
neutron_subnets, neutron_network, ex):
|
||||
fake_ifname = 'fake-veth'
|
||||
fake_binding_response = (
|
||||
fake_ifname,
|
||||
|
@ -53,10 +53,12 @@ class TestKuryrJoinFailures(base.TestKuryrFailures):
|
|||
self.mox.StubOutWithMock(binding, 'port_bind')
|
||||
if ex:
|
||||
binding.port_bind(
|
||||
docker_endpoint_id, neutron_port, neutron_subnets).AndRaise(ex)
|
||||
docker_endpoint_id, neutron_port, neutron_subnets,
|
||||
neutron_network).AndRaise(ex)
|
||||
else:
|
||||
binding.port_bind(
|
||||
docker_endpoint_id, neutron_port, neutron_subnets).AndReturn(
|
||||
docker_endpoint_id, neutron_port, neutron_subnets,
|
||||
neutron_network).AndReturn(
|
||||
fake_binding_response)
|
||||
self.mox.ReplayAll()
|
||||
|
||||
|
@ -70,7 +72,8 @@ class TestKuryrJoinFailures(base.TestKuryrFailures):
|
|||
fake_container_id = utils.get_hash()
|
||||
|
||||
fake_neutron_network_id = str(uuid.uuid4())
|
||||
self._mock_out_network(fake_neutron_network_id, fake_docker_network_id)
|
||||
fake_neutron_network = self._mock_out_network(
|
||||
fake_neutron_network_id, fake_docker_network_id)
|
||||
fake_neutron_port_id = str(uuid.uuid4())
|
||||
self.mox.StubOutWithMock(app.neutron, 'list_ports')
|
||||
neutron_port_name = utils.get_neutron_port_name(
|
||||
|
@ -97,7 +100,8 @@ class TestKuryrJoinFailures(base.TestKuryrFailures):
|
|||
fake_exception = GivenException(fake_message)
|
||||
self._port_bind_with_exeption(
|
||||
fake_docker_endpoint_id, fake_neutron_port,
|
||||
fake_neutron_subnets, fake_exception)
|
||||
fake_neutron_subnets, fake_neutron_network['networks'][0],
|
||||
fake_exception)
|
||||
self.mox.ReplayAll()
|
||||
|
||||
response = self._invoke_join_request(
|
||||
|
|
|
@ -769,7 +769,8 @@ class TestKuryr(base.TestKuryrBase):
|
|||
fake_container_id = utils.get_hash()
|
||||
|
||||
fake_neutron_net_id = str(uuid.uuid4())
|
||||
self._mock_out_network(fake_neutron_net_id, fake_docker_net_id)
|
||||
fake_neutron_network = self._mock_out_network(
|
||||
fake_neutron_net_id, fake_docker_net_id)
|
||||
fake_neutron_port_id = str(uuid.uuid4())
|
||||
self.mox.StubOutWithMock(app.neutron, 'list_ports')
|
||||
neutron_port_name = utils.get_neutron_port_name(
|
||||
|
@ -792,7 +793,8 @@ class TestKuryr(base.TestKuryrBase):
|
|||
fake_neutron_port = fake_neutron_ports_response['ports'][0]
|
||||
fake_neutron_subnets = fake_neutron_subnets_response['subnets']
|
||||
_, fake_peer_name, _ = self._mock_out_binding(
|
||||
fake_docker_endpoint_id, fake_neutron_port, fake_neutron_subnets)
|
||||
fake_docker_endpoint_id, fake_neutron_port,
|
||||
fake_neutron_subnets, fake_neutron_network['networks'][0])
|
||||
|
||||
if vif_plug_is_fatal:
|
||||
self.mox.StubOutWithMock(app.neutron, 'show_port')
|
||||
|
|
Loading…
Reference in New Issue