Migrate computev2 API tests to resource_* fixtures
Partially-implements bp:resource-cleanup
Change-Id: I59eb2d9789368c812282ce12ae7e571be720badb
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py
index 4808601..3bdcfd6 100644
--- a/tempest/api/compute/admin/test_agents.py
+++ b/tempest/api/compute/admin/test_agents.py
@@ -27,8 +27,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AgentsAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AgentsAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.agents_client
def setUp(self):
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index 3485943..f33089c 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -29,8 +29,8 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def setUpClass(cls):
- super(AggregatesAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AggregatesAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.aggregates_client
cls.aggregate_name_prefix = 'test_aggregate_'
cls.az_name_prefix = 'test_az_'
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 690f2ab..ef6752b 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -27,8 +27,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AggregatesAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AggregatesAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os_adm.aggregates_client
cls.user_client = cls.aggregates_client
cls.aggregate_name_prefix = 'test_aggregate_'
diff --git a/tempest/api/compute/admin/test_availability_zone.py b/tempest/api/compute/admin/test_availability_zone.py
index 3a6de36..0a040d7 100644
--- a/tempest/api/compute/admin/test_availability_zone.py
+++ b/tempest/api/compute/admin/test_availability_zone.py
@@ -24,8 +24,8 @@
_api_version = 3
@classmethod
- def setUpClass(cls):
- super(AZAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AZAdminV3Test, cls).resource_setup()
cls.client = cls.availability_zone_admin_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_availability_zone_negative.py b/tempest/api/compute/admin/test_availability_zone_negative.py
index ce97491..ea157b3 100644
--- a/tempest/api/compute/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/admin/test_availability_zone_negative.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AZAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AZAdminNegativeTestJSON, cls).resource_setup()
cls.non_adm_client = cls.availability_zone_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
index 939f1a1..e7f269d 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -23,8 +23,8 @@
class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(FixedIPsTestJson, cls).setUpClass()
+ def resource_setup(cls):
+ super(FixedIPsTestJson, cls).resource_setup()
if CONF.service_available.neutron:
msg = ("%s skipped as neutron is available" % cls.__name__)
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
index 1caa246..90be820 100644
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ b/tempest/api/compute/admin/test_fixed_ips_negative.py
@@ -23,8 +23,8 @@
class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(FixedIPsNegativeTestJson, cls).setUpClass()
+ def resource_setup(cls):
+ super(FixedIPsNegativeTestJson, cls).resource_setup()
if CONF.service_available.neutron:
msg = ("%s skipped as neutron is available" % cls.__name__)
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 18866e5..d365f3a 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAdminTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_flavors_access.py b/tempest/api/compute/admin/test_flavors_access.py
index f2554ea..176a134 100644
--- a/tempest/api/compute/admin/test_flavors_access.py
+++ b/tempest/api/compute/admin/test_flavors_access.py
@@ -26,8 +26,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAccessTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAccessTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_flavors_access_negative.py b/tempest/api/compute/admin/test_flavors_access_negative.py
index b636ccd..9cc2a92 100644
--- a/tempest/api/compute/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/admin/test_flavors_access_negative.py
@@ -29,8 +29,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAccessNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAccessNegativeTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 56daf96..c05abe2 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -27,8 +27,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsExtraSpecsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
@@ -51,10 +51,10 @@
swap=swap, rxtx=rxtx)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
resp, body = cls.client.delete_flavor(cls.flavor['id'])
cls.client.wait_for_resource_deletion(cls.flavor['id'])
- super(FlavorsExtraSpecsTestJSON, cls).tearDownClass()
+ super(FlavorsExtraSpecsTestJSON, cls).resource_cleanup()
@test.attr(type='gate')
def test_flavor_set_get_update_show_unset_keys(self):
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index 1e5695f..30adf73 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsExtraSpecsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
@@ -52,10 +52,10 @@
swap=swap, rxtx=rxtx)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
resp, body = cls.client.delete_flavor(cls.flavor['id'])
cls.client.wait_for_resource_deletion(cls.flavor['id'])
- super(FlavorsExtraSpecsNegativeTestJSON, cls).tearDownClass()
+ super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_cleanup()
@test.attr(type=['negative', 'gate'])
def test_flavor_non_admin_set_keys(self):
diff --git a/tempest/api/compute/admin/test_flavors_negative.py b/tempest/api/compute/admin/test_flavors_negative.py
index eece096..3389aee 100644
--- a/tempest/api/compute/admin/test_flavors_negative.py
+++ b/tempest/api/compute/admin/test_flavors_negative.py
@@ -31,8 +31,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAdminNegativeTestJSON, cls).resource_setup()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
msg = "OS-FLV-EXT-DATA extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
index 16c2810..c1263ea 100644
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ b/tempest/api/compute/admin/test_floating_ips_bulk.py
@@ -31,9 +31,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(FloatingIPsBulkAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPsBulkAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.floating_ips_client
cls.ip_range = CONF.compute.floating_ip_range
cls.verify_unallocated_floating_ip_range(cls.ip_range)
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index e612566..bcae492 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HostsAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(HostsAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.hosts_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_hosts_negative.py b/tempest/api/compute/admin/test_hosts_negative.py
index 0f26e84..4111aba 100644
--- a/tempest/api/compute/admin/test_hosts_negative.py
+++ b/tempest/api/compute/admin/test_hosts_negative.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HostsAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(HostsAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os_adm.hosts_client
cls.non_admin_client = cls.os.hosts_client
diff --git a/tempest/api/compute/admin/test_hypervisor.py b/tempest/api/compute/admin/test_hypervisor.py
index 85b26a1..c51d0a5 100644
--- a/tempest/api/compute/admin/test_hypervisor.py
+++ b/tempest/api/compute/admin/test_hypervisor.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HypervisorAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(HypervisorAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.hypervisor_client
def _list_hypervisors(self):
diff --git a/tempest/api/compute/admin/test_hypervisor_negative.py b/tempest/api/compute/admin/test_hypervisor_negative.py
index 4ba8d30..d3804e8 100644
--- a/tempest/api/compute/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/admin/test_hypervisor_negative.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HypervisorAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(HypervisorAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os_adm.hypervisor_client
cls.non_adm_client = cls.hypervisor_client
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log.py b/tempest/api/compute/admin/test_instance_usage_audit_log.py
index 055a177..91f0b02 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log.py
@@ -23,8 +23,8 @@
class InstanceUsageAuditLogTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(InstanceUsageAuditLogTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceUsageAuditLogTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
index 6a5fc96..1af340d 100644
--- a/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
+++ b/tempest/api/compute/admin/test_instance_usage_audit_log_negative.py
@@ -24,8 +24,8 @@
class InstanceUsageAuditLogNegativeTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(InstanceUsageAuditLogNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceUsageAuditLogNegativeTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.instance_usages_audit_log_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index 514f1fa..7ba05ef 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -24,8 +24,8 @@
class MigrationsAdminTest(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(MigrationsAdminTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(MigrationsAdminTest, cls).resource_setup()
cls.client = cls.os_adm.migrations_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 032e2f5..75f3199 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -29,8 +29,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(NetworksTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(NetworksTest, cls).resource_setup()
cls.client = cls.os_adm.networks_client
def test_get_network(self):
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 93ed7ae..701e1c2 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -34,8 +34,8 @@
super(QuotasAdminTestJSON, self).setUp()
@classmethod
- def setUpClass(cls):
- super(QuotasAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasAdminTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.quotas_client
# NOTE(afazekas): these test cases should always create and use a new
@@ -167,8 +167,8 @@
super(QuotaClassesAdminTestJSON, self).setUp()
@classmethod
- def setUpClass(cls):
- super(QuotaClassesAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotaClassesAdminTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.quota_classes_client
def _restore_default_quotas(self, original_defaults):
diff --git a/tempest/api/compute/admin/test_quotas_negative.py b/tempest/api/compute/admin/test_quotas_negative.py
index 0b29dde..a9ed7ce 100644
--- a/tempest/api/compute/admin/test_quotas_negative.py
+++ b/tempest/api/compute/admin/test_quotas_negative.py
@@ -25,8 +25,8 @@
force_tenant_isolation = True
@classmethod
- def setUpClass(cls):
- super(QuotasAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os.quotas_client
cls.adm_client = cls.os_adm.quotas_client
cls.sg_client = cls.security_groups_client
diff --git a/tempest/api/compute/admin/test_security_group_default_rules.py b/tempest/api/compute/admin/test_security_group_default_rules.py
index a07d270..4c0bd47 100644
--- a/tempest/api/compute/admin/test_security_group_default_rules.py
+++ b/tempest/api/compute/admin/test_security_group_default_rules.py
@@ -30,11 +30,10 @@
@testtools.skipIf(CONF.service_available.neutron,
"Skip as this functionality is not yet "
"implemented in Neutron. Related Bug#1311500")
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
# A network and a subnet will be created for these tests
cls.set_network_resources(network=True, subnet=True)
- super(SecurityGroupDefaultRulesTest, cls).setUpClass()
+ super(SecurityGroupDefaultRulesTest, cls).resource_setup()
cls.adm_client = cls.os_adm.security_group_default_rules_client
def _create_security_group_default_rules(self, ip_protocol='tcp',
diff --git a/tempest/api/compute/admin/test_security_groups.py b/tempest/api/compute/admin/test_security_groups.py
index 004ce8f..40ae236 100644
--- a/tempest/api/compute/admin/test_security_groups.py
+++ b/tempest/api/compute/admin/test_security_groups.py
@@ -26,8 +26,8 @@
class SecurityGroupsTestAdminJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(SecurityGroupsTestAdminJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecurityGroupsTestAdminJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.security_groups_client
cls.client = cls.security_groups_client
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 49af645..47aaee3 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -26,9 +26,8 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ServersAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.servers_client
cls.non_admin_client = cls.servers_client
cls.flavors_client = cls.os_adm.flavors_client
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 4d17557..bd49fb2 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -32,8 +32,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServersAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os_adm.servers_client
cls.non_adm_client = cls.servers_client
cls.flavors_client = cls.os_adm.flavors_client
diff --git a/tempest/api/compute/admin/test_services.py b/tempest/api/compute/admin/test_services.py
index 2feb825..76153e7 100644
--- a/tempest/api/compute/admin/test_services.py
+++ b/tempest/api/compute/admin/test_services.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServicesAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServicesAdminTestJSON, cls).resource_setup()
cls.client = cls.os_adm.services_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index c78d70d..5331097 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServicesAdminNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServicesAdminNegativeTestJSON, cls).resource_setup()
cls.client = cls.os_adm.services_client
cls.non_admin_client = cls.services_client
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage.py b/tempest/api/compute/admin/test_simple_tenant_usage.py
index f3a81d1..5d596ba 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage.py
@@ -23,8 +23,8 @@
class TenantUsagesTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(TenantUsagesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(TenantUsagesTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.tenant_usages_client
cls.client = cls.os.tenant_usages_client
cls.tenant_id = cls.client.tenant_id
diff --git a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
index 1031b24..5e2c593 100644
--- a/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
+++ b/tempest/api/compute/admin/test_simple_tenant_usage_negative.py
@@ -23,8 +23,8 @@
class TenantUsagesNegativeTestJSON(base.BaseV2ComputeAdminTest):
@classmethod
- def setUpClass(cls):
- super(TenantUsagesNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(TenantUsagesNegativeTestJSON, cls).resource_setup()
cls.adm_client = cls.os_adm.tenant_usages_client
cls.client = cls.os.tenant_usages_client
cls.identity_client = cls._get_identity_admin_client()
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 47d1254..7e9fe92 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -34,9 +34,9 @@
force_tenant_isolation = False
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.set_network_resources()
- super(BaseComputeTest, cls).setUpClass()
+ super(BaseComputeTest, cls).resource_setup()
if getattr(cls, '_interface', None) == 'xml' and cls._api_version == 2:
if not CONF.compute_feature_enabled.xml_api_v2:
raise cls.skipException('XML API is not enabled')
@@ -211,13 +211,12 @@
server_group_id)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.clear_images()
cls.clear_servers()
cls.clear_security_groups()
- cls.clear_isolated_creds()
cls.clear_server_groups()
- super(BaseComputeTest, cls).tearDownClass()
+ super(BaseComputeTest, cls).resource_cleanup()
@classmethod
def create_test_server(cls, **kwargs):
@@ -382,8 +381,8 @@
_interface = "json"
@classmethod
- def setUpClass(cls):
- super(BaseComputeAdminTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseComputeAdminTest, cls).resource_setup()
if (CONF.compute.allow_tenant_isolation or
cls.force_tenant_isolation is True):
creds = cls.isolated_creds.get_admin_creds()
diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py
index c1c2d05..7beef23 100644
--- a/tempest/api/compute/flavors/test_flavors.py
+++ b/tempest/api/compute/flavors/test_flavors.py
@@ -24,8 +24,8 @@
_min_ram = 'min_ram'
@classmethod
- def setUpClass(cls):
- super(FlavorsV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsV3Test, cls).resource_setup()
cls.client = cls.flavors_client
@test.attr(type='smoke')
diff --git a/tempest/api/compute/flavors/test_flavors_negative.py b/tempest/api/compute/flavors/test_flavors_negative.py
index 7672fc6..cae1ac4 100644
--- a/tempest/api/compute/flavors/test_flavors_negative.py
+++ b/tempest/api/compute/flavors/test_flavors_negative.py
@@ -35,6 +35,6 @@
_schema = flavors.flavors_details
@classmethod
- def setUpClass(cls):
- super(FlavorDetailsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorDetailsNegativeTestJSON, cls).resource_setup()
cls.set_resource("flavor", cls.flavor_ref)
diff --git a/tempest/api/compute/flavors/test_flavors_negative_xml.py b/tempest/api/compute/flavors/test_flavors_negative_xml.py
index bf73c0e..299b18a 100644
--- a/tempest/api/compute/flavors/test_flavors_negative_xml.py
+++ b/tempest/api/compute/flavors/test_flavors_negative_xml.py
@@ -24,8 +24,8 @@
_interface = 'xml'
@classmethod
- def setUpClass(cls):
- super(FlavorsNegativeTestXML, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsNegativeTestXML, cls).resource_setup()
cls.client = cls.flavors_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/floating_ips/base.py b/tempest/api/compute/floating_ips/base.py
index fd76e62..19b6a50 100644
--- a/tempest/api/compute/floating_ips/base.py
+++ b/tempest/api/compute/floating_ips/base.py
@@ -19,8 +19,8 @@
class BaseFloatingIPsTest(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# Floating IP actions might need a full network configuration
cls.set_network_resources(network=True, subnet=True,
router=True, dhcp=True)
- super(BaseFloatingIPsTest, cls).setUpClass()
+ super(BaseFloatingIPsTest, cls).resource_setup()
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 1eae66f..ba66ab9 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -24,9 +24,8 @@
floating_ip = None
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(FloatingIPsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPsTestJSON, cls).resource_setup()
cls.client = cls.floating_ips_client
cls.floating_ip_id = None
@@ -39,11 +38,11 @@
cls.floating_ip = body['ip']
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
# Deleting the floating IP which is created in this method
if cls.floating_ip_id:
resp, body = cls.client.delete_floating_ip(cls.floating_ip_id)
- super(FloatingIPsTestJSON, cls).tearDownClass()
+ super(FloatingIPsTestJSON, cls).resource_cleanup()
def _try_delete_floating_ip(self, floating_ip_id):
# delete floating ip, if it exists
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
index 042a19a..104d130 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions_negative.py
@@ -28,8 +28,8 @@
server_id = None
@classmethod
- def setUpClass(cls):
- super(FloatingIPsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPsNegativeTestJSON, cls).resource_setup()
cls.client = cls.floating_ips_client
# Server creation
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index a6878d9..cb93177 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -20,8 +20,8 @@
class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(FloatingIPDetailsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPDetailsTestJSON, cls).resource_setup()
cls.client = cls.floating_ips_client
cls.floating_ip = []
cls.floating_ip_id = []
@@ -31,10 +31,10 @@
cls.floating_ip_id.append(body['id'])
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
for i in range(3):
cls.client.delete_floating_ip(cls.floating_ip_id[i])
- super(FloatingIPDetailsTestJSON, cls).tearDownClass()
+ super(FloatingIPDetailsTestJSON, cls).resource_cleanup()
@test.attr(type='gate')
@test.services('network')
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
index b11ef5b..08819c2 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips_negative.py
@@ -27,8 +27,8 @@
class FloatingIPDetailsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(FloatingIPDetailsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPDetailsNegativeTestJSON, cls).resource_setup()
cls.client = cls.floating_ips_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index 9036726..1fa591f 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -26,9 +26,8 @@
class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ImagesMetadataTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesMetadataTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/images/test_image_metadata_negative.py b/tempest/api/compute/images/test_image_metadata_negative.py
index 15bb66a..7f0bc4e 100644
--- a/tempest/api/compute/images/test_image_metadata_negative.py
+++ b/tempest/api/compute/images/test_image_metadata_negative.py
@@ -22,8 +22,8 @@
class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ImagesMetadataTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesMetadataTestJSON, cls).resource_setup()
cls.client = cls.images_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py
index bbb887f..68f793a 100644
--- a/tempest/api/compute/images/test_images.py
+++ b/tempest/api/compute/images/test_images.py
@@ -23,8 +23,8 @@
class ImagesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ImagesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/images/test_images_negative.py b/tempest/api/compute/images/test_images_negative.py
index 771040b..e406374 100644
--- a/tempest/api/compute/images/test_images_negative.py
+++ b/tempest/api/compute/images/test_images_negative.py
@@ -24,8 +24,8 @@
class ImagesNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ImagesNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesNegativeTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/images/test_images_oneserver.py b/tempest/api/compute/images/test_images_oneserver.py
index 1c5d4a3..c0b6730 100644
--- a/tempest/api/compute/images/test_images_oneserver.py
+++ b/tempest/api/compute/images/test_images_oneserver.py
@@ -47,9 +47,8 @@
self.__class__.server_id = self.rebuild_server(self.server_id)
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ImagesOneServerTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesOneServerTestJSON, cls).resource_setup()
cls.client = cls.images_client
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
diff --git a/tempest/api/compute/images/test_images_oneserver_negative.py b/tempest/api/compute/images/test_images_oneserver_negative.py
index 51d9b85..a15cf41 100644
--- a/tempest/api/compute/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/images/test_images_oneserver_negative.py
@@ -55,9 +55,8 @@
self.__class__.server_id = self.rebuild_server(self.server_id)
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ImagesOneServerNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesOneServerNegativeTestJSON, cls).resource_setup()
cls.client = cls.images_client
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 9f1cfc8..30a99dd 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -32,9 +32,8 @@
class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ListImageFiltersTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListImageFiltersTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/images/test_list_image_filters_negative.py b/tempest/api/compute/images/test_list_image_filters_negative.py
index 80d59a7..53a21a0 100644
--- a/tempest/api/compute/images/test_list_image_filters_negative.py
+++ b/tempest/api/compute/images/test_list_image_filters_negative.py
@@ -24,8 +24,8 @@
class ListImageFiltersNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ListImageFiltersNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListImageFiltersNegativeTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/images/test_list_images.py b/tempest/api/compute/images/test_list_images.py
index eba331f..eceac82 100644
--- a/tempest/api/compute/images/test_list_images.py
+++ b/tempest/api/compute/images/test_list_images.py
@@ -23,8 +23,8 @@
class ListImagesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ListImagesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListImagesTestJSON, cls).resource_setup()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
diff --git a/tempest/api/compute/keypairs/test_keypairs.py b/tempest/api/compute/keypairs/test_keypairs.py
index 01979c0..2f0febf 100644
--- a/tempest/api/compute/keypairs/test_keypairs.py
+++ b/tempest/api/compute/keypairs/test_keypairs.py
@@ -23,8 +23,8 @@
_api_version = 3
@classmethod
- def setUpClass(cls):
- super(KeyPairsV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(KeyPairsV3Test, cls).resource_setup()
cls.client = cls.keypairs_client
def _delete_keypair(self, keypair_name):
diff --git a/tempest/api/compute/keypairs/test_keypairs_negative.py b/tempest/api/compute/keypairs/test_keypairs_negative.py
index a91a9c2..0da449b 100644
--- a/tempest/api/compute/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/keypairs/test_keypairs_negative.py
@@ -23,8 +23,8 @@
class KeyPairsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(KeyPairsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(KeyPairsNegativeTestJSON, cls).resource_setup()
cls.client = cls.keypairs_client
def _create_keypair(self, keypair_name, pub_key=None):
diff --git a/tempest/api/compute/limits/test_absolute_limits.py b/tempest/api/compute/limits/test_absolute_limits.py
index d64fd57..bac1a39 100644
--- a/tempest/api/compute/limits/test_absolute_limits.py
+++ b/tempest/api/compute/limits/test_absolute_limits.py
@@ -20,8 +20,8 @@
class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(AbsoluteLimitsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AbsoluteLimitsTestJSON, cls).resource_setup()
cls.client = cls.limits_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/limits/test_absolute_limits_negative.py b/tempest/api/compute/limits/test_absolute_limits_negative.py
index b2e2981..2b41ea0 100644
--- a/tempest/api/compute/limits/test_absolute_limits_negative.py
+++ b/tempest/api/compute/limits/test_absolute_limits_negative.py
@@ -21,8 +21,8 @@
class AbsoluteLimitsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(AbsoluteLimitsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AbsoluteLimitsNegativeTestJSON, cls).resource_setup()
cls.client = cls.limits_client
cls.server_client = cls.servers_client
diff --git a/tempest/api/compute/security_groups/base.py b/tempest/api/compute/security_groups/base.py
index 6838ce1..05cad9a 100644
--- a/tempest/api/compute/security_groups/base.py
+++ b/tempest/api/compute/security_groups/base.py
@@ -19,7 +19,7 @@
class BaseSecurityGroupsTest(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# A network and a subnet will be created for these tests
cls.set_network_resources(network=True, subnet=True)
- super(BaseSecurityGroupsTest, cls).setUpClass()
+ super(BaseSecurityGroupsTest, cls).resource_setup()
diff --git a/tempest/api/compute/security_groups/test_security_group_rules.py b/tempest/api/compute/security_groups/test_security_group_rules.py
index a1808dc..b28124c 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules.py
@@ -23,8 +23,8 @@
class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
@classmethod
- def setUpClass(cls):
- super(SecurityGroupRulesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecurityGroupRulesTestJSON, cls).resource_setup()
cls.client = cls.security_groups_client
cls.neutron_available = CONF.service_available.neutron
diff --git a/tempest/api/compute/security_groups/test_security_group_rules_negative.py b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
index cfa839a..7850909 100644
--- a/tempest/api/compute/security_groups/test_security_group_rules_negative.py
+++ b/tempest/api/compute/security_groups/test_security_group_rules_negative.py
@@ -32,8 +32,8 @@
class SecurityGroupRulesNegativeTestJSON(base.BaseSecurityGroupsTest):
@classmethod
- def setUpClass(cls):
- super(SecurityGroupRulesNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecurityGroupRulesNegativeTestJSON, cls).resource_setup()
cls.client = cls.security_groups_client
@test.attr(type=['negative', 'smoke'])
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 860aebc..82dd4f0 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -22,8 +22,8 @@
class SecurityGroupsTestJSON(base.BaseSecurityGroupsTest):
@classmethod
- def setUpClass(cls):
- super(SecurityGroupsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecurityGroupsTestJSON, cls).resource_setup()
cls.client = cls.security_groups_client
@test.attr(type='smoke')
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index a9cca55..3101052 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -27,8 +27,8 @@
class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
@classmethod
- def setUpClass(cls):
- super(SecurityGroupsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecurityGroupsNegativeTestJSON, cls).resource_setup()
cls.client = cls.security_groups_client
cls.neutron_available = CONF.service_available.neutron
diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py
index d1192c0..d62d19f 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -26,14 +26,14 @@
class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.service_available.neutron:
raise cls.skipException("Neutron is required")
if not CONF.compute_feature_enabled.interface_attach:
raise cls.skipException("Interface attachment is not available.")
# This test class requires network and subnet
cls.set_network_resources(network=True, subnet=True)
- super(AttachInterfacesTestJSON, cls).setUpClass()
+ super(AttachInterfacesTestJSON, cls).resource_setup()
cls.client = cls.os.interfaces_client
def _check_interface(self, iface, port_id=None, network_id=None,
diff --git a/tempest/api/compute/servers/test_availability_zone.py b/tempest/api/compute/servers/test_availability_zone.py
index cf9837f..44bd7d3 100644
--- a/tempest/api/compute/servers/test_availability_zone.py
+++ b/tempest/api/compute/servers/test_availability_zone.py
@@ -24,8 +24,8 @@
_api_version = 3
@classmethod
- def setUpClass(cls):
- super(AZV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AZV3Test, cls).resource_setup()
cls.client = cls.availability_zone_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
index 279dc51..5df8d82 100644
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -31,9 +31,9 @@
disk_config = 'AUTO'
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(ServersTestJSON, cls).setUpClass()
+ super(ServersTestJSON, cls).resource_setup()
cls.meta = {'hello': 'world'}
cls.accessIPv4 = '1.1.1.1'
cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
@@ -129,9 +129,9 @@
disk_config = 'AUTO'
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(ServersWithSpecificFlavorTestJSON, cls).setUpClass()
+ super(ServersWithSpecificFlavorTestJSON, cls).resource_setup()
cls.flavor_client = cls.os_adm.flavors_client
cls.client = cls.servers_client
@@ -214,11 +214,11 @@
disk_config = 'MANUAL'
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.compute_feature_enabled.disk_config:
msg = "DiskConfig extension not enabled."
raise cls.skipException(msg)
- super(ServersTestManualDisk, cls).setUpClass()
+ super(ServersTestManualDisk, cls).resource_setup()
class ServersTestXML(ServersTestJSON):
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 9c8271f..634bc01 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -28,8 +28,8 @@
# for preventing "Quota exceeded for instances"
@classmethod
- def setUpClass(cls):
- super(DeleteServersTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(DeleteServersTestJSON, cls).resource_setup()
cls.client = cls.servers_client
@test.attr(type='gate')
@@ -130,8 +130,8 @@
# for preventing "Quota exceeded for instances".
@classmethod
- def setUpClass(cls):
- super(DeleteServersAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(DeleteServersAdminTestJSON, cls).resource_setup()
cls.non_admin_client = cls.servers_client
cls.admin_client = cls.os_adm.servers_client
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index 332358c..51f2eb4 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -25,11 +25,11 @@
class ServerDiskConfigTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.compute_feature_enabled.disk_config:
msg = "DiskConfig extension not enabled."
raise cls.skipException(msg)
- super(ServerDiskConfigTestJSON, cls).setUpClass()
+ super(ServerDiskConfigTestJSON, cls).resource_setup()
cls.client = cls.os.servers_client
resp, server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index dd31165..d11ce25 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -20,8 +20,8 @@
class InstanceActionsTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(InstanceActionsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceActionsTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, server = cls.create_test_server(wait_until='ACTIVE')
cls.request_id = resp['x-compute-request-id']
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index e67b69d..c706ad5 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -22,8 +22,8 @@
class InstanceActionsNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(InstanceActionsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceActionsNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_list_server_filters.py b/tempest/api/compute/servers/test_list_server_filters.py
index 9d39c9f..6032976 100644
--- a/tempest/api/compute/servers/test_list_server_filters.py
+++ b/tempest/api/compute/servers/test_list_server_filters.py
@@ -26,10 +26,9 @@
class ListServerFiltersTestJSON(base.BaseV2ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
cls.set_network_resources(network=True, subnet=True, dhcp=True)
- super(ListServerFiltersTestJSON, cls).setUpClass()
+ super(ListServerFiltersTestJSON, cls).resource_setup()
cls.client = cls.servers_client
# Check to see if the alternate image ref actually exists...
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index 28d64fb..f4d8dda 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -24,9 +24,8 @@
force_tenant_isolation = True
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ListServersNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListServersNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
# The following servers are created for use
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index fd6df3e..071bbfb 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -52,9 +52,9 @@
super(ServerActionsTestJSON, self).tearDown()
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(ServerActionsTestJSON, cls).setUpClass()
+ super(ServerActionsTestJSON, cls).resource_setup()
cls.client = cls.servers_client
cls.server_id = cls.rebuild_server(None)
diff --git a/tempest/api/compute/servers/test_server_addresses.py b/tempest/api/compute/servers/test_server_addresses.py
index 846bf3e..6c29f51 100644
--- a/tempest/api/compute/servers/test_server_addresses.py
+++ b/tempest/api/compute/servers/test_server_addresses.py
@@ -23,10 +23,10 @@
class ServerAddressesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# This test module might use a network and a subnet
cls.set_network_resources(network=True, subnet=True)
- super(ServerAddressesTestJSON, cls).setUpClass()
+ super(ServerAddressesTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_server_addresses_negative.py b/tempest/api/compute/servers/test_server_addresses_negative.py
index e190161..c7e4c89 100644
--- a/tempest/api/compute/servers/test_server_addresses_negative.py
+++ b/tempest/api/compute/servers/test_server_addresses_negative.py
@@ -21,9 +21,9 @@
class ServerAddressesNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.set_network_resources(network=True, subnet=True)
- super(ServerAddressesNegativeTestJSON, cls).setUpClass()
+ super(ServerAddressesNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_server_group.py b/tempest/api/compute/servers/test_server_group.py
index f1ef5d5..0af19c0 100644
--- a/tempest/api/compute/servers/test_server_group.py
+++ b/tempest/api/compute/servers/test_server_group.py
@@ -26,9 +26,8 @@
It also adds the tests for list and get details of server-groups
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ServerGroupTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerGroupTestJSON, cls).resource_setup()
if not test.is_extension_enabled('os-server-groups', 'compute'):
msg = "os-server-groups extension is not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 01ff6b9..c265352 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -20,8 +20,8 @@
class ServerMetadataTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerMetadataTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerMetadataTestJSON, cls).resource_setup()
cls.client = cls.servers_client
cls.quotas = cls.quotas_client
resp, server = cls.create_test_server(meta={}, wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index fbda401..497b94b 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -22,8 +22,8 @@
class ServerMetadataNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerMetadataNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerMetadataNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
cls.quotas = cls.quotas_client
cls.tenant_id = cls.client.tenant_id
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index 50c881a..aba9bb6 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -21,8 +21,8 @@
class ServerPasswordTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerPasswordTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerPasswordTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until="ACTIVE")
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index 6cc463d..effb52f 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -23,8 +23,8 @@
class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerPersonalityTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerPersonalityTestJSON, cls).resource_setup()
cls.client = cls.servers_client
cls.user_client = cls.limits_client
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index b737888..25f24b9 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -24,14 +24,13 @@
class ServerRescueTestJSON(base.BaseV2ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.compute_feature_enabled.rescue:
msg = "Server rescue not available."
raise cls.skipException(msg)
cls.set_network_resources(network=True, subnet=True, router=True)
- super(ServerRescueTestJSON, cls).setUpClass()
+ super(ServerRescueTestJSON, cls).resource_setup()
# Floating IP creation
resp, body = cls.floating_ips_client.create_floating_ip()
@@ -62,13 +61,13 @@
super(ServerRescueTestJSON, self).setUp()
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
# Deleting the floating IP which is created in this method
cls.floating_ips_client.delete_floating_ip(cls.floating_ip_id)
cls.delete_volume(cls.volume['id'])
resp, cls.sg = cls.security_groups_client.delete_security_group(
cls.sg_id)
- super(ServerRescueTestJSON, cls).tearDownClass()
+ super(ServerRescueTestJSON, cls).resource_cleanup()
def tearDown(self):
super(ServerRescueTestJSON, self).tearDown()
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index 4582a46..aa406f7 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -26,14 +26,13 @@
class ServerRescueNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.compute_feature_enabled.rescue:
msg = "Server rescue not available."
raise cls.skipException(msg)
cls.set_network_resources(network=True, subnet=True, router=True)
- super(ServerRescueNegativeTestJSON, cls).setUpClass()
+ super(ServerRescueNegativeTestJSON, cls).resource_setup()
cls.device = CONF.compute.volume_device_name
# Create a volume and wait for it to become ready for attach
@@ -56,9 +55,9 @@
cls.servers_client.wait_for_server_status(cls.server_id, 'ACTIVE')
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.delete_volume(cls.volume['id'])
- super(ServerRescueNegativeTestJSON, cls).tearDownClass()
+ super(ServerRescueNegativeTestJSON, cls).resource_cleanup()
def _detach(self, server_id, volume_id):
self.servers_client.detach_volume(server_id, volume_id)
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
index 936b871..d501839 100644
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -21,8 +21,8 @@
class ServersTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServersTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersTestJSON, cls).resource_setup()
cls.client = cls.servers_client
def tearDown(self):
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index b9ec29e..b86ee06 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -42,8 +42,8 @@
super(ServersNegativeTestJSON, self).tearDown()
@classmethod
- def setUpClass(cls):
- super(ServersNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
if CONF.compute.allow_tenant_isolation:
cls.alt_os = clients.Manager(cls.isolated_creds.get_alt_creds())
diff --git a/tempest/api/compute/servers/test_servers_negative_new.py b/tempest/api/compute/servers/test_servers_negative_new.py
index c5f9fdd..7fc2d4f 100644
--- a/tempest/api/compute/servers/test_servers_negative_new.py
+++ b/tempest/api/compute/servers/test_servers_negative_new.py
@@ -29,7 +29,7 @@
_schema = servers.get_console_output
@classmethod
- def setUpClass(cls):
- super(GetConsoleOutputNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(GetConsoleOutputNegativeTestJSON, cls).resource_setup()
_resp, server = cls.create_test_server()
cls.set_resource("server", server['id'])
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
index 421ba8b..f205761 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -25,10 +25,10 @@
class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# This test needs a network and a subnet
cls.set_network_resources(network=True, subnet=True)
- super(VirtualInterfacesTestJSON, cls).setUpClass()
+ super(VirtualInterfacesTestJSON, cls).resource_setup()
cls.client = cls.servers_client
resp, server = cls.create_test_server(wait_until='ACTIVE')
cls.server_id = server['id']
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
index bcb2686..1f4a20e 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
@@ -23,10 +23,10 @@
class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# For this test no network resources are needed
cls.set_network_resources()
- super(VirtualInterfacesNegativeTestJSON, cls).setUpClass()
+ super(VirtualInterfacesNegativeTestJSON, cls).resource_setup()
cls.client = cls.servers_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index 3fa4a89..015d9f5 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -30,12 +30,12 @@
class AuthorizationTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.service_available.glance:
raise cls.skipException('Glance is not available.')
# No network resources required for this test
cls.set_network_resources()
- super(AuthorizationTestJSON, cls).setUpClass()
+ super(AuthorizationTestJSON, cls).resource_setup()
if not cls.multi_user:
msg = "Need >1 user"
raise cls.skipException(msg)
@@ -88,12 +88,12 @@
parent_group_id, ip_protocol, from_port, to_port)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
if cls.multi_user:
cls.images_client.delete_image(cls.image['id'])
cls.keypairs_client.delete_keypair(cls.keypairname)
cls.security_client.delete_security_group(cls.security_group['id'])
- super(AuthorizationTestJSON, cls).tearDownClass()
+ super(AuthorizationTestJSON, cls).resource_cleanup()
@test.attr(type='gate')
def test_get_server_for_alt_account_fails(self):
diff --git a/tempest/api/compute/test_live_block_migration.py b/tempest/api/compute/test_live_block_migration.py
index 93ff4b0..86b8395 100644
--- a/tempest/api/compute/test_live_block_migration.py
+++ b/tempest/api/compute/test_live_block_migration.py
@@ -27,8 +27,8 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def setUpClass(cls):
- super(LiveBlockMigrationTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(LiveBlockMigrationTestJSON, cls).resource_setup()
cls.admin_hosts_client = cls.os_adm.hosts_client
cls.admin_servers_client = cls.os_adm.servers_client
diff --git a/tempest/api/compute/test_live_block_migration_negative.py b/tempest/api/compute/test_live_block_migration_negative.py
index c10818e..95eea19 100644
--- a/tempest/api/compute/test_live_block_migration_negative.py
+++ b/tempest/api/compute/test_live_block_migration_negative.py
@@ -27,8 +27,8 @@
_host_key = 'OS-EXT-SRV-ATTR:host'
@classmethod
- def setUpClass(cls):
- super(LiveBlockMigrationNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(LiveBlockMigrationNegativeTestJSON, cls).resource_setup()
if not CONF.compute_feature_enabled.live_migration:
raise cls.skipException("Live migration is not enabled")
cls.admin_hosts_client = cls.os_adm.hosts_client
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index d7eb7ad..e66b652 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -26,8 +26,8 @@
super(QuotasTestJSON, self).setUp()
@classmethod
- def setUpClass(cls):
- super(QuotasTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasTestJSON, cls).resource_setup()
cls.client = cls.quotas_client
cls.tenant_id = cls.client.tenant_id
cls.user_id = cls.client.user_id
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 5a64544..484c34d 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -32,9 +32,9 @@
self.attached = False
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(AttachVolumeTestJSON, cls).setUpClass()
+ super(AttachVolumeTestJSON, cls).resource_setup()
cls.device = CONF.compute.volume_device_name
if not CONF.service_available.cinder:
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 708524c..4f77fa7 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -27,8 +27,8 @@
class VolumesGetTestJSON(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(VolumesGetTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(VolumesGetTestJSON, cls).resource_setup()
cls.client = cls.volumes_extensions_client
if not CONF.service_available.cinder:
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 25a8547..dc54c67 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -32,8 +32,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(VolumesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(VolumesTestJSON, cls).resource_setup()
cls.client = cls.volumes_extensions_client
if not CONF.service_available.cinder:
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
@@ -69,11 +69,11 @@
raise
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
# Delete the created Volumes
for volume in cls.volume_list:
cls.delete_volume(volume['id'])
- super(VolumesTestJSON, cls).tearDownClass()
+ super(VolumesTestJSON, cls).resource_cleanup()
@test.attr(type='gate')
def test_volume_list(self):
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 5dfbad7..ad94ea7 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -27,8 +27,8 @@
class VolumesNegativeTest(base.BaseV2ComputeTest):
@classmethod
- def setUpClass(cls):
- super(VolumesNegativeTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(VolumesNegativeTest, cls).resource_setup()
cls.client = cls.volumes_extensions_client
if not CONF.service_available.cinder:
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)