Merge "Remove unneeded resource_cleanups in compute tests"

This commit is contained in:
Jenkins 2017-09-21 14:32:02 +00:00 committed by Gerrit Code Review
commit 4dfd78a4e0
4 changed files with 13 additions and 28 deletions

View File

@ -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):

View File

@ -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')

View File

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

View File

@ -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):