[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
diff --git a/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py b/neutron_tempest_plugin/fwaas/api/test_fwaasv2_extensions.py
index 0dd18f1..4341ec7 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 @@
             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)