Make connectivity test less backend dependent

The test_connectivity_between_vms_on_different_networks should assert
connectivity between different VMS on different networks but the test is
also asserting that one VM can ping the services port (such as DHCP)
running on the other network and that may not be the case for all
backends.

OVN for example uses a "localport" type to implement a
DHCP port. That port type in OVN does not allow traffic
outside the network it belongs to [0] which is causing the test
test_connectivity_between_vms_on_different_networks to fail when used
with networking-ovn.

This patch is modifying the test to only ping the relevant ports when
asserting that the VMs have connectivity with each other.

[0]
d9677a1f0e/ovn/controller/physical.c (L1176-L1182)

Closes-Bug: #1798317
Change-Id: Ia4a6ee65d3d737f8452b4aed9bf4624455a3b050
This commit is contained in:
Lucas Alvares Gomes 2018-10-16 14:38:11 +01:00
parent 5d96f65d98
commit d595c3606c
1 changed files with 11 additions and 5 deletions

View File

@ -476,9 +476,14 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
self._check_network_internal_connectivity(network=self.network)
self._check_network_external_connectivity()
self._create_new_network(create_gateway=True)
self._create_server(self.new_net)
self._check_network_internal_connectivity(network=self.new_net,
should_connect=False)
new_server = self._create_server(self.new_net)
new_server_ips = [addr['addr'] for addr in
new_server['addresses'][self.new_net['name']]]
# Assert that pinging the new VM fails since the new network is not
# connected to a router
self._check_server_connectivity(self.floating_ip_tuple.floating_ip,
new_server_ips, should_connect=False)
router_id = self.router['id']
self.routers_client.add_router_interface(
router_id, subnet_id=self.new_subnet['id'])
@ -486,8 +491,9 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.routers_client.remove_router_interface,
router_id, subnet_id=self.new_subnet['id'])
self._check_network_internal_connectivity(network=self.new_net,
should_connect=True)
self._check_server_connectivity(self.floating_ip_tuple.floating_ip,
new_server_ips, should_connect=True)
@decorators.idempotent_id('c5adff73-e961-41f1-b4a9-343614f18cfa')
@testtools.skipUnless(CONF.compute_feature_enabled.interface_attach,