From 7b1f9b11e66b81eabdc8361c89f8ccfdb3448f9a Mon Sep 17 00:00:00 2001 From: zhouhenglc Date: Thu, 25 May 2023 08:42:36 +0800 Subject: [PATCH] [fwaas]Disassociate all ports before deleting firewall group If the firewall group has associated ports, the firewall group may be in an active state. Firewall group is active, deletion is not allowed. This patch cannot solve the bug[1] at the moment. Because there are other bugs[2] present. We plan to avoid bugs[2] through patches[3] now. To solve the bug[1]. There are other patches[1] here to try and solve the bug[2]. Partial-Bug: #2018967 [1] https://bugs.launchpad.net/neutron/+bug/2018967 [2] https://bugs.launchpad.net/neutron/+bug/2021457 [3] https://review.opendev.org/c/openstack/neutron-fwaas/+/884333 [4] https://review.opendev.org/c/openstack/neutron-fwaas/+/884335 Change-Id: Id328446be8591fac3affe2cf8adeaeee09697085 --- neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py b/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py index 0dd18f12..4341ec78 100644 --- a/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py +++ b/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py @@ -336,7 +336,10 @@ def test_update_firewall_group(self): ports=[intf_2['port_id']]) updated_fwg = body["firewall_group"] self.assertEqual([intf_2['port_id']], updated_fwg['ports']) - + # Wait for the firewall resource to become ready + self._wait_until_ready(fwg_id) + # Disassociate all ports with this firewall group + self.firewall_groups_client.update_firewall_group(fwg_id, ports=[]) # Delete firewall_group self.firewall_groups_client.delete_firewall_group(fwg_id)