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
This commit is contained in:
Lukas Piwowarski 2021-04-27 15:16:02 +00:00 committed by lpiwowar
parent f4bae14ce9
commit 4769f92f6b

View File

@ -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"]