From 7c44604e4f391725c1232847f3af7c9937e62a25 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 31 Oct 2024 11:24:35 +0100 Subject: [PATCH] Check only ports owned by the dhcp service in the dhcp scheduler tests In the DHCPAgentSchedulersTestJSON.test_dhcp_port_status_active test it was checked if all ports from the network are ACTIVE. This is typically correct but in case of the e.g. ML2/OVN backend with deployed Neutron DHCP agent (which is rare but still possible, supported and required in some corner use cases) this test was failing as in addition to the port with device owner ``network:dhcp`` there was also ``network:distributed`` port created by the ovn driver and this port is DOWN which is normal. To avoid such false failure of this test this patch adds filtering only for the ports with the owner like: ``network:dhcp``. Change-Id: Id53a4b4dffe5ec18bbd9eaf2a9e74175b4dd87bb --- tempest/api/network/admin/test_dhcp_agent_scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py index b4bfc61e83..8b4766c85a 100644 --- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py +++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py @@ -48,12 +48,13 @@ class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest): @decorators.idempotent_id('f164801e-1dd8-4b8b-b5d3-cc3ac77cfaa5') def test_dhcp_port_status_active(self): - ports = self.admin_ports_client.list_ports( + dhcp_ports = self.admin_ports_client.list_ports( + device_owner='network:dhcp', network_id=self.network['id'])['ports'] - for port in ports: + for dhcp_port in dhcp_ports: waiters.wait_for_port_status( client=self.admin_ports_client, - port_id=port['id'], + port_id=dhcp_port['id'], status='ACTIVE') @decorators.idempotent_id('5032b1fe-eb42-4a64-8f3b-6e189d8b5c7d')