Merge "Remove unneeded resource_cleanups in compute tests"
This commit is contained in:
commit
4dfd78a4e0
@ -53,12 +53,11 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
|
||||
ephemeral=ephemeral,
|
||||
swap=swap,
|
||||
rxtx_factor=rxtx)['flavor']
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
cls.admin_flavors_client.delete_flavor(cls.flavor['id'])
|
||||
cls.admin_flavors_client.wait_for_resource_deletion(cls.flavor['id'])
|
||||
super(FlavorsExtraSpecsTestJSON, cls).resource_cleanup()
|
||||
cls.addClassResourceCleanup(
|
||||
cls.admin_flavors_client.wait_for_resource_deletion,
|
||||
cls.flavor['id'])
|
||||
cls.addClassResourceCleanup(cls.admin_flavors_client.delete_flavor,
|
||||
cls.flavor['id'])
|
||||
|
||||
@decorators.idempotent_id('0b2f9d4b-1ca2-4b99-bb40-165d4bb94208')
|
||||
def test_flavor_set_get_update_show_unset_keys(self):
|
||||
|
@ -55,12 +55,11 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
||||
ephemeral=ephemeral,
|
||||
swap=swap,
|
||||
rxtx_factor=rxtx)['flavor']
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
cls.admin_flavors_client.delete_flavor(cls.flavor['id'])
|
||||
cls.admin_flavors_client.wait_for_resource_deletion(cls.flavor['id'])
|
||||
super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_cleanup()
|
||||
cls.addClassResourceCleanup(
|
||||
cls.admin_flavors_client.wait_for_resource_deletion,
|
||||
cls.flavor['id'])
|
||||
cls.addClassResourceCleanup(cls.admin_flavors_client.delete_flavor,
|
||||
cls.flavor['id'])
|
||||
|
||||
@decorators.attr(type=['negative'])
|
||||
@decorators.idempotent_id('a00a3b81-5641-45a8-ab2b-4a8ec41e1d7d')
|
||||
|
@ -45,7 +45,6 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(FloatingIPsTestJSON, cls).resource_setup()
|
||||
cls.floating_ip_id = None
|
||||
|
||||
# Server creation
|
||||
server = cls.create_test_server(wait_until='ACTIVE')
|
||||
@ -53,16 +52,10 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
|
||||
# Floating IP creation
|
||||
body = cls.client.create_floating_ip(
|
||||
pool=CONF.network.floating_network_name)['floating_ip']
|
||||
cls.addClassResourceCleanup(cls.client.delete_floating_ip, body['id'])
|
||||
cls.floating_ip_id = body['id']
|
||||
cls.floating_ip = body['ip']
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
# Deleting the floating IP which is created in this method
|
||||
if cls.floating_ip_id:
|
||||
cls.client.delete_floating_ip(cls.floating_ip_id)
|
||||
super(FloatingIPsTestJSON, cls).resource_cleanup()
|
||||
|
||||
@decorators.idempotent_id('f7bfb946-297e-41b8-9e8c-aba8e9bb5194')
|
||||
def test_allocate_floating_ip(self):
|
||||
# Positive test:Allocation of a new floating IP to a project
|
||||
|
@ -41,18 +41,12 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
|
||||
def resource_setup(cls):
|
||||
super(FloatingIPDetailsTestJSON, cls).resource_setup()
|
||||
cls.floating_ip = []
|
||||
cls.floating_ip_id = []
|
||||
for _ in range(3):
|
||||
body = cls.client.create_floating_ip(
|
||||
pool=CONF.network.floating_network_name)['floating_ip']
|
||||
cls.addClassResourceCleanup(cls.client.delete_floating_ip,
|
||||
body['id'])
|
||||
cls.floating_ip.append(body)
|
||||
cls.floating_ip_id.append(body['id'])
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
for f_id in cls.floating_ip_id:
|
||||
cls.client.delete_floating_ip(f_id)
|
||||
super(FloatingIPDetailsTestJSON, cls).resource_cleanup()
|
||||
|
||||
@decorators.idempotent_id('16db31c3-fb85-40c9-bbe2-8cf7b67ff99f')
|
||||
def test_list_floating_ips(self):
|
||||
|
Loading…
Reference in New Issue
Block a user