Fix addCleanup in AutoAllocateNetworkTest
In AutoAllocateNetworkTest, addCleanup is mixed with
assertEqual in one loop, and this may cause some
addCleanups not being executed if assert fails.
This is to put addCleanups standalone.
Change-Id: I1da5afebfbae630cdee87b347486549781dd08b1
diff --git a/tempest/api/compute/admin/test_auto_allocate_network.py b/tempest/api/compute/admin/test_auto_allocate_network.py
index 0c80252..6f23866 100644
--- a/tempest/api/compute/admin/test_auto_allocate_network.py
+++ b/tempest/api/compute/admin/test_auto_allocate_network.py
@@ -175,9 +175,11 @@
_, servers = compute.create_test_server(
self.os_primary, networks='auto', wait_until='ACTIVE',
min_count=3)
- server_nets = set()
for server in servers:
self.addCleanup(self.delete_server, server['id'])
+
+ server_nets = set()
+ for server in servers:
# get the server ips
addresses = self.servers_client.list_addresses(
server['id'])['addresses']