[OVN] Remove OVN metadata ports from network port list

In "_check_network_internal_connectivity", all "network:" and
"compute:" ports belonging to a network are retrieved. OVN
metadata ports "network:distributed" should be filtered out because
are not a DHCP nor L3 ports.

This port type was introduced in Neutron in [1][2].

[1]https://review.opendev.org/c/openstack/neutron-lib/+/732141
[2]https://review.opendev.org/c/openstack/neutron/+/732364

Partial-Bug: #1942913
Change-Id: I7db94247c55f9ac39e3e30a4195cdcda6ed657d7
This commit is contained in:
Rodolfo Alonso Hernandez 2021-09-09 13:55:11 +00:00
parent 7d22b1f6b7
commit 17655434ee
1 changed files with 5 additions and 2 deletions

View File

@ -329,13 +329,16 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
floating_ip, server = self.floating_ip_tuple
# get internal ports' ips:
# get all network and compute ports in the new network
# NOTE(ralonsoh): device_owner="network:distributed" ports are OVN
# metadata ports and should be filtered out.
internal_ips = (
p['fixed_ips'][0]['ip_address'] for p in
self.os_admin.ports_client.list_ports(
project_id=server['tenant_id'],
network_id=network['id'])['ports']
if p['device_owner'].startswith('network') or
p['device_owner'].startswith('compute')
if ((p['device_owner'].startswith('network') and
not p['device_owner'] == 'network:distributed') or
p['device_owner'].startswith('compute'))
)
self._check_server_connectivity(floating_ip,