Use random name in network common function
Change-ID Ieb211ce48d2368b1f41109c7fd76e818ee69cfe4 seemed like
missing one position, this patch is to append that.
Use random name in basenetworktest function to remove flushing
random name definitions in networkstest.
Change-Id: I693b72936834e24b3000e38bbdb4562001e17e13
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index dadaaba..6b0c20f 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -276,29 +276,22 @@
@test.idempotent_id('f04f61a9-b7f3-4194-90b2-9bcf660d1bfe')
def test_delete_network_with_subnet(self):
# Creates a network
- name = data_utils.rand_name('network-')
- body = self.networks_client.create_network(name=name)
- network = body['network']
+ network = self.create_network()
net_id = network['id']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.networks_client.delete_network, net_id)
+ self._delete_network, network)
# Find a cidr that is not in use yet and create a subnet with it
subnet = self.create_subnet(network)
subnet_id = subnet['id']
# Delete network while the subnet still exists
- body = self.networks_client.delete_network(net_id)
+ self.networks_client.delete_network(net_id)
# Verify that the subnet got automatically deleted.
self.assertRaises(lib_exc.NotFound, self.subnets_client.show_subnet,
subnet_id)
- # Since create_subnet adds the subnet to the delete list, and it is
- # actually deleted here - this will create and issue, hence remove
- # it from the list.
- self.subnets.pop()
-
@test.idempotent_id('d2d596e2-8e76-47a9-ac51-d4648009f4d3')
def test_create_delete_subnet_without_gateway(self):
self._create_verify_delete_subnet()