diff options
author | Andrea Frittoli <andrea.frittoli@hp.com> | 2014-09-15 12:34:27 +0100 |
---|---|---|
committer | Andrea Frittoli <andrea.frittoli@hp.com> | 2014-09-18 21:47:21 +0100 |
commit | 50bb80dd3c57885054a61d4535f8f7f03c59eacf (patch) | |
tree | 9467c219f4a1bf5ccc97507fa874e5061755e143 /tempest/api/compute | |
parent | 73ee247eebc92ed6ab5d16cacd373dd76722dd8e (diff) | |
download | tempest-50bb80dd3c57885054a61d4535f8f7f03c59eacf.tar.gz |
Migrate computev2 API tests to resource_* fixtures
Partially-implements bp:resource-cleanup
Change-Id: I59eb2d9789368c812282ce12ae7e571be720badb
Diffstat (limited to 'tempest/api/compute')
91 files changed, 210 insertions, 224 deletions
diff --git a/tempest/api/compute/admin/test_agents.py b/tempest/api/compute/admin/test_agents.py index 480860114..3bdcfd665 100644 --- a/tempest/api/compute/admin/test_agents.py +++ b/tempest/api/compute/admin/test_agents.py @@ -27,8 +27,8 @@ class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 3485943c0..f33089c1d 100644 --- a/tempest/api/compute/admin/test_aggregates.py +++ b/tempest/api/compute/admin/test_aggregates.py @@ -29,8 +29,8 @@ class AggregatesAdminTestJSON(base.BaseV2ComputeAdminTest): _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 690f2abc3..ef6752bdf 100644 --- a/tempest/api/compute/admin/test_aggregates_negative.py +++ b/tempest/api/compute/admin/test_aggregates_negative.py @@ -27,8 +27,8 @@ class AggregatesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 3a6de3650..0a040d7b1 100644 --- a/tempest/api/compute/admin/test_availability_zone.py +++ b/tempest/api/compute/admin/test_availability_zone.py @@ -24,8 +24,8 @@ class AZAdminV3Test(base.BaseComputeAdminTest): _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 ce974917a..ea157b347 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 @@ class AZAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 939f1a153..e7f269d42 100644 --- a/tempest/api/compute/admin/test_fixed_ips.py +++ b/tempest/api/compute/admin/test_fixed_ips.py @@ -23,8 +23,8 @@ CONF = config.CONF 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 1caa246db..90be8201b 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 @@ CONF = config.CONF 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 18866e5b6..d365f3a71 100644 --- a/tempest/api/compute/admin/test_flavors.py +++ b/tempest/api/compute/admin/test_flavors.py @@ -28,8 +28,8 @@ class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 f2554ea60..176a134f0 100644 --- a/tempest/api/compute/admin/test_flavors_access.py +++ b/tempest/api/compute/admin/test_flavors_access.py @@ -26,8 +26,8 @@ class FlavorsAccessTestJSON(base.BaseV2ComputeAdminTest): """ @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 b636ccda9..9cc2a9261 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 @@ class FlavorsAccessNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 56daf9615..c05abe271 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 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest): """ @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 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest): 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 1e5695f81..30adf731c 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 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest): 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 eece09678..3389aee61 100644 --- a/tempest/api/compute/admin/test_flavors_negative.py +++ b/tempest/api/compute/admin/test_flavors_negative.py @@ -31,8 +31,8 @@ class FlavorsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 16c281023..c1263eab1 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 @@ class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 e61256623..bcae49245 100644 --- a/tempest/api/compute/admin/test_hosts.py +++ b/tempest/api/compute/admin/test_hosts.py @@ -24,8 +24,8 @@ class HostsAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 0f26e849c..4111aba80 100644 --- a/tempest/api/compute/admin/test_hosts_negative.py +++ b/tempest/api/compute/admin/test_hosts_negative.py @@ -25,8 +25,8 @@ class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 85b26a174..c51d0a590 100644 --- a/tempest/api/compute/admin/test_hypervisor.py +++ b/tempest/api/compute/admin/test_hypervisor.py @@ -24,8 +24,8 @@ class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 4ba8d308a..d3804e851 100644 --- a/tempest/api/compute/admin/test_hypervisor_negative.py +++ b/tempest/api/compute/admin/test_hypervisor_negative.py @@ -28,8 +28,8 @@ class HypervisorAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 055a1777d..91f0b0254 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 @@ from tempest import test 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 6a5fc9663..1af340d91 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 @@ from tempest import test 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 514f1fab1..7ba05ef56 100644 --- a/tempest/api/compute/admin/test_migrations.py +++ b/tempest/api/compute/admin/test_migrations.py @@ -24,8 +24,8 @@ CONF = config.CONF 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 032e2f583..75f3199c6 100644 --- a/tempest/api/compute/admin/test_networks.py +++ b/tempest/api/compute/admin/test_networks.py @@ -29,8 +29,8 @@ class NetworksTest(base.BaseComputeAdminTest): """ @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 93ed7ae4f..701e1c280 100644 --- a/tempest/api/compute/admin/test_quotas.py +++ b/tempest/api/compute/admin/test_quotas.py @@ -34,8 +34,8 @@ class QuotasAdminTestJSON(base.BaseV2ComputeAdminTest): 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 @@ class QuotaClassesAdminTestJSON(base.BaseV2ComputeAdminTest): 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 0b29dde7a..a9ed7cec5 100644 --- a/tempest/api/compute/admin/test_quotas_negative.py +++ b/tempest/api/compute/admin/test_quotas_negative.py @@ -25,8 +25,8 @@ class QuotasAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): 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 a07d270bc..4c0bd477a 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 @@ class SecurityGroupDefaultRulesTest(base.BaseV2ComputeAdminTest): @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 004ce8fa1..40ae23692 100644 --- a/tempest/api/compute/admin/test_security_groups.py +++ b/tempest/api/compute/admin/test_security_groups.py @@ -26,8 +26,8 @@ CONF = config.CONF 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 49af645b6..47aaee360 100644 --- a/tempest/api/compute/admin/test_servers.py +++ b/tempest/api/compute/admin/test_servers.py @@ -26,9 +26,8 @@ class ServersAdminTestJSON(base.BaseV2ComputeAdminTest): _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 4d17557b1..bd49fb266 100644 --- a/tempest/api/compute/admin/test_servers_negative.py +++ b/tempest/api/compute/admin/test_servers_negative.py @@ -32,8 +32,8 @@ class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 2feb825f6..76153e734 100644 --- a/tempest/api/compute/admin/test_services.py +++ b/tempest/api/compute/admin/test_services.py @@ -25,8 +25,8 @@ class ServicesAdminTestJSON(base.BaseV2ComputeAdminTest): """ @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 c78d70db6..5331097c2 100644 --- a/tempest/api/compute/admin/test_services_negative.py +++ b/tempest/api/compute/admin/test_services_negative.py @@ -24,8 +24,8 @@ class ServicesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): """ @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 f3a81d1e2..5d596baa8 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 @@ from tempest import test 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 1031b248b..5e2c5939d 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 @@ from tempest import test 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 47d12540a..7e9fe9262 100644 --- a/tempest/api/compute/base.py +++ b/tempest/api/compute/base.py @@ -34,9 +34,9 @@ class BaseComputeTest(tempest.test.BaseTestCase): 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 @@ class BaseComputeTest(tempest.test.BaseTestCase): 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 @@ class BaseComputeAdminTest(BaseComputeTest): _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 c1c2d05fb..7beef2319 100644 --- a/tempest/api/compute/flavors/test_flavors.py +++ b/tempest/api/compute/flavors/test_flavors.py @@ -24,8 +24,8 @@ class FlavorsV3Test(base.BaseComputeTest): _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 7672fc61a..cae1ac44a 100644 --- a/tempest/api/compute/flavors/test_flavors_negative.py +++ b/tempest/api/compute/flavors/test_flavors_negative.py @@ -35,6 +35,6 @@ class FlavorDetailsNegativeTestJSON(base.BaseV2ComputeTest, _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 bf73c0edc..299b18ae1 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 @@ class FlavorsNegativeTestXML(base.BaseV2ComputeTest): _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 fd76e62e3..19b6a5008 100644 --- a/tempest/api/compute/floating_ips/base.py +++ b/tempest/api/compute/floating_ips/base.py @@ -19,8 +19,8 @@ from tempest.api.compute import base 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 1eae66f2b..ba66ab93f 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 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest): 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 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest): 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 042a19a08..104d13027 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 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest): 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 a6878d9ae..cb93177c9 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 @@ from tempest import test 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 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest): 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 b11ef5bed..08819c2be 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 @@ CONF = config.CONF 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 9036726da..1fa591fb4 100644 --- a/tempest/api/compute/images/test_image_metadata.py +++ b/tempest/api/compute/images/test_image_metadata.py @@ -26,9 +26,8 @@ CONF = config.CONF 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 15bb66a60..7f0bc4ef9 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 @@ from tempest import test 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 bbb887f70..68f793aa3 100644 --- a/tempest/api/compute/images/test_images.py +++ b/tempest/api/compute/images/test_images.py @@ -23,8 +23,8 @@ CONF = config.CONF 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 771040bac..e40637465 100644 --- a/tempest/api/compute/images/test_images_negative.py +++ b/tempest/api/compute/images/test_images_negative.py @@ -24,8 +24,8 @@ CONF = config.CONF 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 1c5d4a386..c0b67305f 100644 --- a/tempest/api/compute/images/test_images_oneserver.py +++ b/tempest/api/compute/images/test_images_oneserver.py @@ -47,9 +47,8 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest): 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 51d9b8526..a15cf41c5 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 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest): 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 9f1cfc80a..30a99ddf1 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 @@ LOG = logging.getLogger(__name__) 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 80d59a715..53a21a09f 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 @@ CONF = config.CONF 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 eba331fef..eceac82b0 100644 --- a/tempest/api/compute/images/test_list_images.py +++ b/tempest/api/compute/images/test_list_images.py @@ -23,8 +23,8 @@ CONF = config.CONF 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 01979c034..2f0febf71 100644 --- a/tempest/api/compute/keypairs/test_keypairs.py +++ b/tempest/api/compute/keypairs/test_keypairs.py @@ -23,8 +23,8 @@ class KeyPairsV3Test(base.BaseComputeTest): _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 a91a9c261..0da449b64 100644 --- a/tempest/api/compute/keypairs/test_keypairs_negative.py +++ b/tempest/api/compute/keypairs/test_keypairs_negative.py @@ -23,8 +23,8 @@ from tempest import test 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 d64fd574b..bac1a392d 100644 --- a/tempest/api/compute/limits/test_absolute_limits.py +++ b/tempest/api/compute/limits/test_absolute_limits.py @@ -20,8 +20,8 @@ from tempest import test 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 b2e298165..2b41ea03e 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 @@ from tempest import test 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 6838ce1e3..05cad9a39 100644 --- a/tempest/api/compute/security_groups/base.py +++ b/tempest/api/compute/security_groups/base.py @@ -19,7 +19,7 @@ from tempest.api.compute import base 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 a1808dc2f..b28124c12 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 @@ CONF = config.CONF 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 cfa839a8e..785090931 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 @@ def not_existing_id(): 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 860aebc0e..82dd4f044 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 @@ from tempest import test 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 a9cca551b..310105217 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 @@ CONF = config.CONF 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 d1192c097..d62d19f71 100644 --- a/tempest/api/compute/servers/test_attach_interfaces.py +++ b/tempest/api/compute/servers/test_attach_interfaces.py @@ -26,14 +26,14 @@ CONF = config.CONF 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 cf9837f82..44bd7d3b0 100644 --- a/tempest/api/compute/servers/test_availability_zone.py +++ b/tempest/api/compute/servers/test_availability_zone.py @@ -24,8 +24,8 @@ class AZV3Test(base.BaseComputeTest): _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 279dc5122..5df8d8263 100644 --- a/tempest/api/compute/servers/test_create_server.py +++ b/tempest/api/compute/servers/test_create_server.py @@ -31,9 +31,9 @@ class ServersTestJSON(base.BaseV2ComputeTest): 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 @@ class ServersWithSpecificFlavorTestJSON(base.BaseV2ComputeAdminTest): 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 @@ class ServersTestManualDisk(ServersTestJSON): 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 9c8271f9b..634bc01df 100644 --- a/tempest/api/compute/servers/test_delete_server.py +++ b/tempest/api/compute/servers/test_delete_server.py @@ -28,8 +28,8 @@ class DeleteServersTestJSON(base.BaseV2ComputeTest): # 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 @@ class DeleteServersAdminTestJSON(base.BaseV2ComputeAdminTest): # 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 332358c90..51f2eb4ee 100644 --- a/tempest/api/compute/servers/test_disk_config.py +++ b/tempest/api/compute/servers/test_disk_config.py @@ -25,11 +25,11 @@ CONF = config.CONF 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 dd31165a0..d11ce2569 100644 --- a/tempest/api/compute/servers/test_instance_actions.py +++ b/tempest/api/compute/servers/test_instance_actions.py @@ -20,8 +20,8 @@ from tempest import test 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 e67b69d23..c706ad5d7 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 @@ from tempest import test 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 9d39c9f6c..60329767c 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 @@ CONF = config.CONF 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 28d64fb35..f4d8ddac8 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 @@ class ListServersNegativeTestJSON(base.BaseV2ComputeTest): 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 fd6df3ee5..071bbfb8c 100644 --- a/tempest/api/compute/servers/test_server_actions.py +++ b/tempest/api/compute/servers/test_server_actions.py @@ -52,9 +52,9 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): 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 846bf3e55..6c29f51ee 100644 --- a/tempest/api/compute/servers/test_server_addresses.py +++ b/tempest/api/compute/servers/test_server_addresses.py @@ -23,10 +23,10 @@ CONF = config.CONF 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 e1901614a..c7e4c89d5 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 @@ from tempest import test 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 f1ef5d5af..0af19c0dd 100644 --- a/tempest/api/compute/servers/test_server_group.py +++ b/tempest/api/compute/servers/test_server_group.py @@ -26,9 +26,8 @@ class ServerGroupTestJSON(base.BaseV2ComputeTest): 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 01ff6b96e..c26535207 100644 --- a/tempest/api/compute/servers/test_server_metadata.py +++ b/tempest/api/compute/servers/test_server_metadata.py @@ -20,8 +20,8 @@ from tempest import test 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 fbda4019a..497b94bd8 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 @@ from tempest import test 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 50c881a26..aba9bb6c3 100644 --- a/tempest/api/compute/servers/test_server_password.py +++ b/tempest/api/compute/servers/test_server_password.py @@ -21,8 +21,8 @@ from tempest import test 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 6cc463df5..effb52f7c 100644 --- a/tempest/api/compute/servers/test_server_personality.py +++ b/tempest/api/compute/servers/test_server_personality.py @@ -23,8 +23,8 @@ from tempest import test 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 b7378886b..25f24b95c 100644 --- a/tempest/api/compute/servers/test_server_rescue.py +++ b/tempest/api/compute/servers/test_server_rescue.py @@ -24,14 +24,13 @@ CONF = config.CONF 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 @@ class ServerRescueTestJSON(base.BaseV2ComputeTest): 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 4582a461b..aa406f766 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 @@ CONF = config.CONF 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 @@ class ServerRescueNegativeTestJSON(base.BaseV2ComputeTest): 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 936b8711a..d50183948 100644 --- a/tempest/api/compute/servers/test_servers.py +++ b/tempest/api/compute/servers/test_servers.py @@ -21,8 +21,8 @@ from tempest import test 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 b9ec29e11..b86ee0657 100644 --- a/tempest/api/compute/servers/test_servers_negative.py +++ b/tempest/api/compute/servers/test_servers_negative.py @@ -42,8 +42,8 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest): 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 c5f9fdd60..7fc2d4fb9 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 @@ class GetConsoleOutputNegativeTestJSON(base.BaseV2ComputeTest, _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 421ba8b3e..f20576102 100644 --- a/tempest/api/compute/servers/test_virtual_interfaces.py +++ b/tempest/api/compute/servers/test_virtual_interfaces.py @@ -25,10 +25,10 @@ CONF = config.CONF 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 bcb2686df..1f4a20ea9 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 @@ from tempest import test 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 3fa4a89c4..015d9f580 100644 --- a/tempest/api/compute/test_authorization.py +++ b/tempest/api/compute/test_authorization.py @@ -30,12 +30,12 @@ LOG = logging.getLogger(__name__) 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 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest): 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 93ff4b0ad..86b839514 100644 --- a/tempest/api/compute/test_live_block_migration.py +++ b/tempest/api/compute/test_live_block_migration.py @@ -27,8 +27,8 @@ class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest): _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 c10818ee4..95eea19fb 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 @@ class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest): _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 d7eb7ad0a..e66b65263 100644 --- a/tempest/api/compute/test_quotas.py +++ b/tempest/api/compute/test_quotas.py @@ -26,8 +26,8 @@ class QuotasTestJSON(base.BaseV2ComputeTest): 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 5a6454464..484c34dbf 100644 --- a/tempest/api/compute/volumes/test_attach_volume.py +++ b/tempest/api/compute/volumes/test_attach_volume.py @@ -32,9 +32,9 @@ class AttachVolumeTestJSON(base.BaseV2ComputeTest): 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 708524cdb..4f77fa7dc 100644 --- a/tempest/api/compute/volumes/test_volumes_get.py +++ b/tempest/api/compute/volumes/test_volumes_get.py @@ -27,8 +27,8 @@ CONF = config.CONF 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 25a85472b..dc54c6703 100644 --- a/tempest/api/compute/volumes/test_volumes_list.py +++ b/tempest/api/compute/volumes/test_volumes_list.py @@ -32,8 +32,8 @@ class VolumesTestJSON(base.BaseV2ComputeTest): """ @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 @@ class VolumesTestJSON(base.BaseV2ComputeTest): 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 5dfbad7ae..ad94ea774 100644 --- a/tempest/api/compute/volumes/test_volumes_negative.py +++ b/tempest/api/compute/volumes/test_volumes_negative.py @@ -27,8 +27,8 @@ CONF = config.CONF 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__) |