From 4769f92f6b78994ba1cdf593f9646daa77217699 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Tue, 27 Apr 2021 15:16:02 +0000 Subject: [PATCH] Add cleanup for test_show_auto_allocated_topology test This patch makes sure that test_show_auto_allocated_topology deletes resources that are created during its execution. Before, the test didn't clean the following resources: - network: auto_allocated_network - subnets: auto_allocated_subnet_v4 & auto_allocated_subnet_v6 - router: auto_allocated_router Story: 2007941 Task: 40406 Change-Id: I8cc77f7d47918d8329298ee32733d569294f11b7 --- .../api/network/test_auto_allocated_topology_rbac.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patrole_tempest_plugin/tests/api/network/test_auto_allocated_topology_rbac.py b/patrole_tempest_plugin/tests/api/network/test_auto_allocated_topology_rbac.py index 3db06164..aee5e99f 100644 --- a/patrole_tempest_plugin/tests/api/network/test_auto_allocated_topology_rbac.py +++ b/patrole_tempest_plugin/tests/api/network/test_auto_allocated_topology_rbac.py @@ -43,6 +43,15 @@ class AutoAllocationTopologyExtRbacTest(base.BaseNetworkExtRbacTest): self.ntp_client.get_auto_allocated_topology( tenant_id=self.os_primary.credentials.tenant_id) + # Auto allocated topology has to be deleted here because + # Neutron provisions new auto allocated topology for a project + # when: + # - receives GET request for auto allocated topology and + # - there is no auto allocated topology already associated + # with the project. + self.ntp_client.delete_auto_allocated_topology( + tenant_id=self.os_primary.credentials.tenant_id) + def _ensure_network_not_in_use(cls, network_id): ports = cls.ntp_client.list_ports(network_id=network_id)["ports"]