From 4aa23680679f3b63e5d38aec5aa8a59031416052 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Tue, 22 Jun 2021 12:03:55 +0200 Subject: [PATCH] Fix external networks scenario test cases Ignore testing external subnet port IPs that have DHCP enabled Change-Id: I8487d270c2e639a1b010cbc92633a1eb599543ba --- tobiko/openstack/stacks/_nova.py | 5 +++++ tobiko/tests/scenario/neutron/test_port.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tobiko/openstack/stacks/_nova.py b/tobiko/openstack/stacks/_nova.py index 3a07cb339..abc762d02 100644 --- a/tobiko/openstack/stacks/_nova.py +++ b/tobiko/openstack/stacks/_nova.py @@ -406,10 +406,15 @@ class ExternalServerStackFixture(ServerStackFixture, abc.ABC): # external servers doesn't need floating IPs has_floating_ip = False + # We must rely on ways of configuring IPs without relying on DHCP config_drive = True + # external network servers are visible from test host peer_ssh_client = None + # external network DHCP could conflict with Neutron one + need_dhcp = False + @property def floating_network(self): return self.network_stack.network_id diff --git a/tobiko/tests/scenario/neutron/test_port.py b/tobiko/tests/scenario/neutron/test_port.py index 2c67aaa14..40cb73da4 100644 --- a/tobiko/tests/scenario/neutron/test_port.py +++ b/tobiko/tests/scenario/neutron/test_port.py @@ -83,9 +83,8 @@ class PortTest(testtools.TestCase): def test_ping_subnet_gateways(self): """Checks server can ping its gateway IPs""" network_id = self.stack.network_stack.network_id - subnets = neutron.list_subnets(network_id=network_id, - enable_dhcp=True) - LOG.debug("Subnets with DHCP enabled are:\n" + subnets = neutron.list_subnets(network_id=network_id) + LOG.debug("Subnets enabled are:\n" f"{json.dumps(subnets, indent=4, sort_keys=True)}") gateway_ips = [netaddr.IPAddress(subnet['gateway_ip']) for subnet in subnets] @@ -98,7 +97,8 @@ class PortTest(testtools.TestCase): port_ips = neutron.list_device_ip_addresses( device_id=device_id or self.stack.server_id, network_id=network_id or self.stack.network_stack.network_id, - need_dhcp=self.stack.need_dhcp, ip_version=ip_version) + need_dhcp=self.stack.need_dhcp, + ip_version=ip_version) if port_ips: ping.assert_reachable_hosts(port_ips, timeout=600.,