Merge "Removes bogus negative create image compute"
diff --git a/tempest/api/baremetal/admin/base.py b/tempest/api/baremetal/admin/base.py
index 62edd10..8efddcb 100644
--- a/tempest/api/baremetal/admin/base.py
+++ b/tempest/api/baremetal/admin/base.py
@@ -28,6 +28,10 @@
# which has no external dependencies.
SUPPORTED_DRIVERS = ['fake']
+# NOTE(jroll): resources must be deleted in a specific order, this list
+# defines the resource types to clean up, and the correct order.
+RESOURCE_TYPES = ['port', 'node', 'chassis']
+
def creates(resource):
"""Decorator that adds resources to the appropriate cleanup list."""
@@ -66,16 +70,17 @@
mgr = clients.AdminManager()
cls.client = mgr.baremetal_client
cls.power_timeout = CONF.baremetal.power_timeout
- cls.created_objects = {'chassis': set(),
- 'port': set(),
- 'node': set()}
+ cls.created_objects = {}
+ for resource in RESOURCE_TYPES:
+ cls.created_objects[resource] = set()
@classmethod
def tearDownClass(cls):
"""Ensure that all created objects get destroyed."""
try:
- for resource, uuids in cls.created_objects.iteritems():
+ for resource in RESOURCE_TYPES:
+ uuids = cls.created_objects[resource]
delete_method = getattr(cls.client, 'delete_%s' % resource)
for u in uuids:
delete_method(u, ignore_errors=exc.NotFound)
diff --git a/tempest/api/baremetal/admin/test_chassis.py b/tempest/api/baremetal/admin/test_chassis.py
index 254a969..2131e78 100644
--- a/tempest/api/baremetal/admin/test_chassis.py
+++ b/tempest/api/baremetal/admin/test_chassis.py
@@ -75,3 +75,9 @@
description=new_description))
_, chassis = self.client.show_chassis(uuid)
self.assertEqual(chassis['description'], new_description)
+
+ @test.attr(type='smoke')
+ def test_chassis_node_list(self):
+ _, node = self.create_node(self.chassis['uuid'])
+ _, body = self.client.list_chassis_nodes(self.chassis['uuid'])
+ self.assertIn(node['uuid'], [n['uuid'] for n in body['nodes']])
diff --git a/tempest/api/baremetal/admin/test_nodes.py b/tempest/api/baremetal/admin/test_nodes.py
index b9b9b55..8ccd36b 100644
--- a/tempest/api/baremetal/admin/test_nodes.py
+++ b/tempest/api/baremetal/admin/test_nodes.py
@@ -13,6 +13,8 @@
import six
from tempest.api.baremetal.admin import base
+from tempest.common.utils import data_utils
+from tempest.common import waiters
from tempest import exceptions as exc
from tempest import test
@@ -33,6 +35,17 @@
self.assertIn(key, actual)
self.assertEqual(value, actual[key])
+ def _associate_node_with_instance(self):
+ self.client.set_node_power_state(self.node['uuid'], 'power off')
+ waiters.wait_for_bm_node_status(self.client, self.node['uuid'],
+ 'power_state', 'power off')
+ instance_uuid = data_utils.rand_uuid()
+ self.client.update_node(self.node['uuid'],
+ instance_uuid=instance_uuid)
+ self.addCleanup(self.client.update_node,
+ uuid=self.node['uuid'], instance_uuid=None)
+ return instance_uuid
+
@test.attr(type='smoke')
def test_create_node(self):
params = {'cpu_arch': 'x86_64',
@@ -63,6 +76,34 @@
[i['uuid'] for i in body['nodes']])
@test.attr(type='smoke')
+ def test_list_nodes_association(self):
+ _, body = self.client.list_nodes(associated=True)
+ self.assertNotIn(self.node['uuid'],
+ [n['uuid'] for n in body['nodes']])
+
+ self._associate_node_with_instance()
+
+ _, body = self.client.list_nodes(associated=True)
+ self.assertIn(self.node['uuid'], [n['uuid'] for n in body['nodes']])
+
+ _, body = self.client.list_nodes(associated=False)
+ self.assertNotIn(self.node['uuid'], [n['uuid'] for n in body['nodes']])
+
+ @test.attr(type='smoke')
+ def test_node_port_list(self):
+ _, port = self.create_port(self.node['uuid'],
+ data_utils.rand_mac_address())
+ _, body = self.client.list_node_ports(self.node['uuid'])
+ self.assertIn(port['uuid'],
+ [p['uuid'] for p in body['ports']])
+
+ @test.attr(type='smoke')
+ def test_node_port_list_no_ports(self):
+ _, node = self.create_node(self.chassis['uuid'])
+ _, body = self.client.list_node_ports(node['uuid'])
+ self.assertEmpty(body['ports'])
+
+ @test.attr(type='smoke')
def test_update_node(self):
props = {'cpu_arch': 'x86_64',
'cpu_num': '12',
@@ -120,3 +161,10 @@
_, body = self.client.get_console(self.node['uuid'])
self.assertEqual(True, body['console_enabled'])
+
+ @test.attr(type='smoke')
+ def test_get_node_by_instance_uuid(self):
+ instance_uuid = self._associate_node_with_instance()
+ _, body = self.client.show_node_by_instance_uuid(instance_uuid)
+ self.assertEqual(len(body['nodes']), 1)
+ self.assertIn(self.node['uuid'], [n['uuid'] for n in body['nodes']])
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 e9059b8..dc3d6bc 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/v3/admin/test_agents.py b/tempest/api/compute/v3/admin/test_agents.py
index 9d01b71..b7c0011 100644
--- a/tempest/api/compute/v3/admin/test_agents.py
+++ b/tempest/api/compute/v3/admin/test_agents.py
@@ -23,8 +23,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AgentsAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AgentsAdminV3Test, cls).resource_setup()
cls.client = cls.agents_admin_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_aggregates.py b/tempest/api/compute/v3/admin/test_aggregates.py
index 886b6a7..1beeb13 100644
--- a/tempest/api/compute/v3/admin/test_aggregates.py
+++ b/tempest/api/compute/v3/admin/test_aggregates.py
@@ -28,8 +28,8 @@
_host_key = 'os-extended-server-attributes:host'
@classmethod
- def setUpClass(cls):
- super(AggregatesAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AggregatesAdminV3Test, cls).resource_setup()
cls.client = cls.aggregates_admin_client
cls.aggregate_name_prefix = 'test_aggregate_'
cls.az_name_prefix = 'test_az_'
diff --git a/tempest/api/compute/v3/admin/test_aggregates_negative.py b/tempest/api/compute/v3/admin/test_aggregates_negative.py
index 1505f74..093963f 100644
--- a/tempest/api/compute/v3/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/v3/admin/test_aggregates_negative.py
@@ -27,8 +27,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AggregatesAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AggregatesAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.aggregates_admin_client
cls.user_client = cls.aggregates_client
cls.aggregate_name_prefix = 'test_aggregate_'
diff --git a/tempest/api/compute/v3/admin/test_availability_zone_negative.py b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
index b012e65..56cdd6c 100644
--- a/tempest/api/compute/v3/admin/test_availability_zone_negative.py
+++ b/tempest/api/compute/v3/admin/test_availability_zone_negative.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(AZAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(AZAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.availability_zone_admin_client
cls.non_adm_client = cls.availability_zone_client
diff --git a/tempest/api/compute/v3/admin/test_flavors.py b/tempest/api/compute/v3/admin/test_flavors.py
index 09d76b8..f307907 100644
--- a/tempest/api/compute/v3/admin/test_flavors.py
+++ b/tempest/api/compute/v3/admin/test_flavors.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAdminV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
cls.user_client = cls.flavors_client
diff --git a/tempest/api/compute/v3/admin/test_flavors_access.py b/tempest/api/compute/v3/admin/test_flavors_access.py
index 09b6ebd..c79e591 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access.py
@@ -26,8 +26,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAccessV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAccessV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
admin_client = cls._get_identity_admin_client()
diff --git a/tempest/api/compute/v3/admin/test_flavors_access_negative.py b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
index 0fdfabd..87e8cbf 100644
--- a/tempest/api/compute/v3/admin/test_flavors_access_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_access_negative.py
@@ -29,8 +29,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAccessNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAccessNegativeV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
cls.tenant_id = cls.client.tenant_id
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
index 29cd8db..24844b1 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs.py
@@ -27,8 +27,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsExtraSpecsV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
flavor_name = data_utils.rand_name('test_flavor')
@@ -48,10 +48,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(FlavorsExtraSpecsV3Test, cls).tearDownClass()
+ super(FlavorsExtraSpecsV3Test, cls).resource_cleanup()
@test.attr(type='gate')
def test_flavor_set_get_update_show_unset_keys(self):
diff --git a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
index e9c04a3..5fcd7a4 100644
--- a/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_extra_specs_negative.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsExtraSpecsNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsExtraSpecsNegativeV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
flavor_name = data_utils.rand_name('test_flavor')
@@ -49,10 +49,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(FlavorsExtraSpecsNegativeV3Test, cls).tearDownClass()
+ super(FlavorsExtraSpecsNegativeV3Test, cls).resource_cleanup()
@test.attr(type=['negative', 'gate'])
def test_flavor_non_admin_set_keys(self):
diff --git a/tempest/api/compute/v3/admin/test_flavors_negative.py b/tempest/api/compute/v3/admin/test_flavors_negative.py
index 6d3308e..426d13e 100644
--- a/tempest/api/compute/v3/admin/test_flavors_negative.py
+++ b/tempest/api/compute/v3/admin/test_flavors_negative.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FlavorsAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorsAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.flavors_admin_client
cls.user_client = cls.flavors_client
diff --git a/tempest/api/compute/v3/admin/test_hosts.py b/tempest/api/compute/v3/admin/test_hosts.py
index 8cb1f23..898a704 100644
--- a/tempest/api/compute/v3/admin/test_hosts.py
+++ b/tempest/api/compute/v3/admin/test_hosts.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HostsAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(HostsAdminV3Test, cls).resource_setup()
cls.client = cls.hosts_admin_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_hosts_negative.py b/tempest/api/compute/v3/admin/test_hosts_negative.py
index 79cd97f..2b82baa 100644
--- a/tempest/api/compute/v3/admin/test_hosts_negative.py
+++ b/tempest/api/compute/v3/admin/test_hosts_negative.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HostsAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(HostsAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.hosts_admin_client
cls.non_admin_client = cls.hosts_client
diff --git a/tempest/api/compute/v3/admin/test_hypervisor.py b/tempest/api/compute/v3/admin/test_hypervisor.py
index 9a23789..831e20f 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor.py
@@ -24,8 +24,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HypervisorAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(HypervisorAdminV3Test, cls).resource_setup()
cls.client = cls.hypervisor_admin_client
def _list_hypervisors(self):
diff --git a/tempest/api/compute/v3/admin/test_hypervisor_negative.py b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
index ae4df15..df23b46 100644
--- a/tempest/api/compute/v3/admin/test_hypervisor_negative.py
+++ b/tempest/api/compute/v3/admin/test_hypervisor_negative.py
@@ -28,8 +28,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(HypervisorAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(HypervisorAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.hypervisor_admin_client
cls.non_adm_client = cls.hypervisor_client
diff --git a/tempest/api/compute/v3/admin/test_quotas.py b/tempest/api/compute/v3/admin/test_quotas.py
index 19c31fe..3dad45c 100644
--- a/tempest/api/compute/v3/admin/test_quotas.py
+++ b/tempest/api/compute/v3/admin/test_quotas.py
@@ -25,8 +25,8 @@
force_tenant_isolation = True
@classmethod
- def setUpClass(cls):
- super(QuotasAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasAdminV3Test, cls).resource_setup()
cls.client = cls.quotas_client
cls.adm_client = cls.quotas_admin_client
diff --git a/tempest/api/compute/v3/admin/test_quotas_negative.py b/tempest/api/compute/v3/admin/test_quotas_negative.py
index e115e7b..86abcab 100644
--- a/tempest/api/compute/v3/admin/test_quotas_negative.py
+++ b/tempest/api/compute/v3/admin/test_quotas_negative.py
@@ -23,8 +23,8 @@
force_tenant_isolation = True
@classmethod
- def setUpClass(cls):
- super(QuotasAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.quotas_client
cls.adm_client = cls.quotas_admin_client
diff --git a/tempest/api/compute/v3/admin/test_servers.py b/tempest/api/compute/v3/admin/test_servers.py
index d99c329..36ea7ba 100644
--- a/tempest/api/compute/v3/admin/test_servers.py
+++ b/tempest/api/compute/v3/admin/test_servers.py
@@ -26,9 +26,8 @@
_host_key = 'os-extended-server-attributes:host'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ServersAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersAdminV3Test, cls).resource_setup()
cls.client = cls.servers_admin_client
cls.non_admin_client = cls.servers_client
cls.flavors_client = cls.flavors_admin_client
diff --git a/tempest/api/compute/v3/admin/test_servers_negative.py b/tempest/api/compute/v3/admin/test_servers_negative.py
index 070dc2b..e48432b 100644
--- a/tempest/api/compute/v3/admin/test_servers_negative.py
+++ b/tempest/api/compute/v3/admin/test_servers_negative.py
@@ -32,8 +32,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServersAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.servers_admin_client
cls.non_adm_client = cls.servers_client
cls.flavors_client = cls.flavors_admin_client
diff --git a/tempest/api/compute/v3/admin/test_services.py b/tempest/api/compute/v3/admin/test_services.py
index e6efb70..f1c3b9a 100644
--- a/tempest/api/compute/v3/admin/test_services.py
+++ b/tempest/api/compute/v3/admin/test_services.py
@@ -25,8 +25,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServicesAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServicesAdminV3Test, cls).resource_setup()
cls.client = cls.services_admin_client
@test.attr(type='gate')
diff --git a/tempest/api/compute/v3/admin/test_services_negative.py b/tempest/api/compute/v3/admin/test_services_negative.py
index 6ac78d4..1f9f2b1 100644
--- a/tempest/api/compute/v3/admin/test_services_negative.py
+++ b/tempest/api/compute/v3/admin/test_services_negative.py
@@ -26,8 +26,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ServicesAdminNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServicesAdminNegativeV3Test, cls).resource_setup()
cls.client = cls.services_admin_client
cls.non_admin_client = cls.services_client
diff --git a/tempest/api/compute/v3/flavors/test_flavors_negative.py b/tempest/api/compute/v3/flavors/test_flavors_negative.py
index cdf018f..2dd7b71 100644
--- a/tempest/api/compute/v3/flavors/test_flavors_negative.py
+++ b/tempest/api/compute/v3/flavors/test_flavors_negative.py
@@ -35,6 +35,6 @@
_schema = flavors.flavors_details
@classmethod
- def setUpClass(cls):
- super(FlavorDetailsNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(FlavorDetailsNegativeV3Test, cls).resource_setup()
cls.set_resource("flavor", cls.flavor_ref)
diff --git a/tempest/api/compute/v3/images/test_images.py b/tempest/api/compute/v3/images/test_images.py
index bb81626..a234a22 100644
--- a/tempest/api/compute/v3/images/test_images.py
+++ b/tempest/api/compute/v3/images/test_images.py
@@ -23,8 +23,8 @@
class ImagesV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ImagesV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesV3Test, 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/v3/images/test_images_negative.py b/tempest/api/compute/v3/images/test_images_negative.py
index 0705bdc..83e9436 100644
--- a/tempest/api/compute/v3/images/test_images_negative.py
+++ b/tempest/api/compute/v3/images/test_images_negative.py
@@ -24,8 +24,8 @@
class ImagesNegativeV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ImagesNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesNegativeV3Test, 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/v3/images/test_images_oneserver.py b/tempest/api/compute/v3/images/test_images_oneserver.py
index edf91a7..87e730c 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver.py
+++ b/tempest/api/compute/v3/images/test_images_oneserver.py
@@ -47,9 +47,8 @@
super(ImagesOneServerV3Test, self).tearDown()
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ImagesOneServerV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesOneServerV3Test, 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/v3/images/test_images_oneserver_negative.py b/tempest/api/compute/v3/images/test_images_oneserver_negative.py
index 544a5a5..5892cd7 100644
--- a/tempest/api/compute/v3/images/test_images_oneserver_negative.py
+++ b/tempest/api/compute/v3/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(ImagesOneServerNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ImagesOneServerNegativeV3Test, 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/v3/keypairs/test_keypairs_negative.py b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
index e426b85..1f7206a 100644
--- a/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
+++ b/tempest/api/compute/v3/keypairs/test_keypairs_negative.py
@@ -23,8 +23,8 @@
class KeyPairsNegativeV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(KeyPairsNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(KeyPairsNegativeV3Test, cls).resource_setup()
cls.client = cls.keypairs_client
def _create_keypair(self, keypair_name, pub_key=None):
diff --git a/tempest/api/compute/v3/servers/test_attach_interfaces.py b/tempest/api/compute/v3/servers/test_attach_interfaces.py
index c2cf7e0..d4d4fca 100644
--- a/tempest/api/compute/v3/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/v3/servers/test_attach_interfaces.py
@@ -26,14 +26,14 @@
class AttachInterfacesV3Test(base.BaseV3ComputeTest):
@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(AttachInterfacesV3Test, cls).setUpClass()
+ super(AttachInterfacesV3Test, cls).resource_setup()
cls.client = cls.interfaces_client
def _check_interface(self, iface, port_id=None, network_id=None,
diff --git a/tempest/api/compute/v3/servers/test_attach_volume.py b/tempest/api/compute/v3/servers/test_attach_volume.py
index e994c7f..76b5549 100644
--- a/tempest/api/compute/v3/servers/test_attach_volume.py
+++ b/tempest/api/compute/v3/servers/test_attach_volume.py
@@ -32,9 +32,9 @@
self.attached = False
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(AttachVolumeV3Test, cls).setUpClass()
+ super(AttachVolumeV3Test, 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/v3/servers/test_create_server.py b/tempest/api/compute/v3/servers/test_create_server.py
index c59fe91..bcd6176 100644
--- a/tempest/api/compute/v3/servers/test_create_server.py
+++ b/tempest/api/compute/v3/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(ServersV3Test, cls).setUpClass()
+ super(ServersV3Test, 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'
@@ -108,9 +108,9 @@
disk_config = 'AUTO'
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(ServersWithSpecificFlavorV3Test, cls).setUpClass()
+ super(ServersWithSpecificFlavorV3Test, cls).resource_setup()
cls.client = cls.servers_client
cls.flavor_client = cls.flavors_admin_client
@@ -192,8 +192,8 @@
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(ServersV3TestManualDisk, cls).setUpClass()
+ super(ServersV3TestManualDisk, cls).resource_setup()
diff --git a/tempest/api/compute/v3/servers/test_delete_server.py b/tempest/api/compute/v3/servers/test_delete_server.py
index e2b47ee..ab10b4c 100644
--- a/tempest/api/compute/v3/servers/test_delete_server.py
+++ b/tempest/api/compute/v3/servers/test_delete_server.py
@@ -26,8 +26,8 @@
# for preventing "Quota exceeded for instances".
@classmethod
- def setUpClass(cls):
- super(DeleteServersV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(DeleteServersV3Test, cls).resource_setup()
cls.client = cls.servers_client
@test.attr(type='gate')
@@ -128,8 +128,8 @@
# for preventing "Quota exceeded for instances".
@classmethod
- def setUpClass(cls):
- super(DeleteServersAdminV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(DeleteServersAdminV3Test, cls).resource_setup()
cls.non_admin_client = cls.servers_client
cls.admin_client = cls.servers_admin_client
diff --git a/tempest/api/compute/v3/servers/test_instance_actions.py b/tempest/api/compute/v3/servers/test_instance_actions.py
index 4c2dcbe..227f6cd 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions.py
@@ -20,8 +20,8 @@
class InstanceActionsV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(InstanceActionsV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceActionsV3Test, cls).resource_setup()
cls.client = cls.servers_client
resp, server = cls.create_test_server(wait_until='ACTIVE')
cls.resp = resp
diff --git a/tempest/api/compute/v3/servers/test_instance_actions_negative.py b/tempest/api/compute/v3/servers/test_instance_actions_negative.py
index 0b2c6f9..b9d4be2 100644
--- a/tempest/api/compute/v3/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/v3/servers/test_instance_actions_negative.py
@@ -22,8 +22,8 @@
class InstanceActionsNegativeV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(InstanceActionsNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(InstanceActionsNegativeV3Test, 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/v3/servers/test_list_server_filters.py b/tempest/api/compute/v3/servers/test_list_server_filters.py
index 778b033..209d293 100644
--- a/tempest/api/compute/v3/servers/test_list_server_filters.py
+++ b/tempest/api/compute/v3/servers/test_list_server_filters.py
@@ -26,10 +26,9 @@
class ListServerFiltersV3Test(base.BaseV3ComputeTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
cls.set_network_resources(network=True, subnet=True, dhcp=True)
- super(ListServerFiltersV3Test, cls).setUpClass()
+ super(ListServerFiltersV3Test, cls).resource_setup()
cls.client = cls.servers_client
# Check to see if the alternate image ref actually exists...
diff --git a/tempest/api/compute/v3/servers/test_list_servers_negative.py b/tempest/api/compute/v3/servers/test_list_servers_negative.py
index 18e5c67..67e1155 100644
--- a/tempest/api/compute/v3/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_list_servers_negative.py
@@ -26,9 +26,8 @@
force_tenant_isolation = True
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ListServersNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListServersNegativeV3Test, cls).resource_setup()
cls.client = cls.servers_client
# The following servers are created for use
diff --git a/tempest/api/compute/v3/servers/test_server_actions.py b/tempest/api/compute/v3/servers/test_server_actions.py
index 538507f..a4e8dba 100644
--- a/tempest/api/compute/v3/servers/test_server_actions.py
+++ b/tempest/api/compute/v3/servers/test_server_actions.py
@@ -51,9 +51,9 @@
super(ServerActionsV3Test, self).tearDown()
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
cls.prepare_instance_network()
- super(ServerActionsV3Test, cls).setUpClass()
+ super(ServerActionsV3Test, cls).resource_setup()
cls.client = cls.servers_client
cls.server_id = cls.rebuild_server(None)
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index efd7500..0590146 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -23,10 +23,10 @@
class ServerAddressesV3Test(base.BaseV3ComputeTest):
@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(ServerAddressesV3Test, cls).setUpClass()
+ super(ServerAddressesV3Test, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/v3/servers/test_server_addresses_negative.py b/tempest/api/compute/v3/servers/test_server_addresses_negative.py
index 8a9877b..7a1b6fc 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses_negative.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses_negative.py
@@ -23,10 +23,10 @@
_interface = 'json'
@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(ServerAddressesV3NegativeTest, cls).setUpClass()
+ super(ServerAddressesV3NegativeTest, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/v3/servers/test_server_metadata.py b/tempest/api/compute/v3/servers/test_server_metadata.py
index c5443ee..ccdfbad 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata.py
@@ -20,8 +20,8 @@
class ServerMetadataV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerMetadataV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerMetadataV3Test, 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/v3/servers/test_server_metadata_negative.py b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
index f746be3..036b126 100644
--- a/tempest/api/compute/v3/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/v3/servers/test_server_metadata_negative.py
@@ -21,8 +21,8 @@
class ServerMetadataV3NegativeTest(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerMetadataV3NegativeTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerMetadataV3NegativeTest, 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/v3/servers/test_server_password.py b/tempest/api/compute/v3/servers/test_server_password.py
index fc0b145..bb0e310 100644
--- a/tempest/api/compute/v3/servers/test_server_password.py
+++ b/tempest/api/compute/v3/servers/test_server_password.py
@@ -21,8 +21,8 @@
class ServerPasswordV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServerPasswordV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServerPasswordV3Test, cls).resource_setup()
cls.client = cls.servers_client
resp, cls.server = cls.create_test_server(wait_until="ACTIVE")
diff --git a/tempest/api/compute/v3/servers/test_server_rescue.py b/tempest/api/compute/v3/servers/test_server_rescue.py
index da58f26..ae21a7e 100644
--- a/tempest/api/compute/v3/servers/test_server_rescue.py
+++ b/tempest/api/compute/v3/servers/test_server_rescue.py
@@ -23,11 +23,11 @@
class ServerRescueV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.compute_feature_enabled.rescue:
msg = "Server rescue not available."
raise cls.skipException(msg)
- super(ServerRescueV3Test, cls).setUpClass()
+ super(ServerRescueV3Test, cls).resource_setup()
# Server for positive tests
resp, server = cls.create_test_server(wait_until='BUILD')
diff --git a/tempest/api/compute/v3/servers/test_server_rescue_negative.py b/tempest/api/compute/v3/servers/test_server_rescue_negative.py
index 6d192a3..db26298 100644
--- a/tempest/api/compute/v3/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/v3/servers/test_server_rescue_negative.py
@@ -26,13 +26,12 @@
class ServerRescueNegativeV3Test(base.BaseV3ComputeTest):
@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)
- super(ServerRescueNegativeV3Test, cls).setUpClass()
+ super(ServerRescueNegativeV3Test, cls).resource_setup()
cls.device = CONF.compute.volume_device_name
# Create a volume and wait for it to become ready for attach
@@ -55,10 +54,10 @@
cls.servers_client.wait_for_server_status(cls.server_id, 'ACTIVE')
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
if hasattr(cls, 'volume'):
cls.delete_volume(cls.volume['id'])
- super(ServerRescueNegativeV3Test, cls).tearDownClass()
+ super(ServerRescueNegativeV3Test, 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/v3/servers/test_servers.py b/tempest/api/compute/v3/servers/test_servers.py
index 426ee8d..e09f4a8 100644
--- a/tempest/api/compute/v3/servers/test_servers.py
+++ b/tempest/api/compute/v3/servers/test_servers.py
@@ -21,8 +21,8 @@
class ServersV3Test(base.BaseV3ComputeTest):
@classmethod
- def setUpClass(cls):
- super(ServersV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersV3Test, cls).resource_setup()
cls.client = cls.servers_client
def tearDown(self):
diff --git a/tempest/api/compute/v3/servers/test_servers_negative.py b/tempest/api/compute/v3/servers/test_servers_negative.py
index f8ff7c8..30ac0ac 100644
--- a/tempest/api/compute/v3/servers/test_servers_negative.py
+++ b/tempest/api/compute/v3/servers/test_servers_negative.py
@@ -42,8 +42,8 @@
super(ServersNegativeV3Test, self).tearDown()
@classmethod
- def setUpClass(cls):
- super(ServersNegativeV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServersNegativeV3Test, 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/v3/test_live_block_migration.py b/tempest/api/compute/v3/test_live_block_migration.py
index 6ca37e6..d6231b7 100644
--- a/tempest/api/compute/v3/test_live_block_migration.py
+++ b/tempest/api/compute/v3/test_live_block_migration.py
@@ -26,8 +26,8 @@
_host_key = 'os-extended-server-attributes:host'
@classmethod
- def setUpClass(cls):
- super(LiveBlockMigrationV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(LiveBlockMigrationV3Test, cls).resource_setup()
cls.admin_hosts_client = cls.hosts_admin_client
cls.admin_servers_client = cls.servers_admin_client
diff --git a/tempest/api/compute/v3/test_live_block_migration_negative.py b/tempest/api/compute/v3/test_live_block_migration_negative.py
index b4ec505..93127f3 100644
--- a/tempest/api/compute/v3/test_live_block_migration_negative.py
+++ b/tempest/api/compute/v3/test_live_block_migration_negative.py
@@ -27,8 +27,8 @@
_host_key = 'os-extended-server-attributes:host'
@classmethod
- def setUpClass(cls):
- super(LiveBlockMigrationV3NegativeTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(LiveBlockMigrationV3NegativeTest, cls).resource_setup()
if not CONF.compute_feature_enabled.live_migration:
raise cls.skipException("Live migration is not enabled")
diff --git a/tempest/api/compute/v3/test_quotas.py b/tempest/api/compute/v3/test_quotas.py
index ecf70cf..f6d8b3f 100644
--- a/tempest/api/compute/v3/test_quotas.py
+++ b/tempest/api/compute/v3/test_quotas.py
@@ -26,8 +26,8 @@
super(QuotasV3Test, self).setUp()
@classmethod
- def setUpClass(cls):
- super(QuotasV3Test, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasV3Test, 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__)
diff --git a/tempest/api/identity/admin/test_roles.py b/tempest/api/identity/admin/test_roles.py
index 492d56f..d87d5c1 100644
--- a/tempest/api/identity/admin/test_roles.py
+++ b/tempest/api/identity/admin/test_roles.py
@@ -24,9 +24,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(RolesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(RolesTestJSON, cls).resource_setup()
for _ in moves.xrange(5):
role_name = data_utils.rand_name(name='role-')
_, role = cls.client.create_role(role_name)
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index d3ac6dd..66a1737 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -24,8 +24,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(UsersTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(UsersTestJSON, cls).resource_setup()
cls.alt_user = data_utils.rand_name('test_user_')
cls.alt_password = data_utils.rand_name('pass_')
cls.alt_email = cls.alt_user + '@testmail.tm'
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index a584a7b..bad2b89 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -25,8 +25,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(UsersNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(UsersNegativeTestJSON, cls).resource_setup()
cls.alt_user = data_utils.rand_name('test_user_')
cls.alt_password = data_utils.rand_name('pass_')
cls.alt_email = cls.alt_user + '@testmail.tm'
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 433eaed..7a0edb0 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -22,9 +22,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(CredentialsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(CredentialsTestJSON, cls).resource_setup()
cls.projects = list()
cls.creds_list = [['project_id', 'user_id', 'id'],
['access', 'secret']]
@@ -43,11 +42,11 @@
email=u_email, project_id=cls.projects[0])
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.client.delete_user(cls.user_body['id'])
for p in cls.projects:
cls.client.delete_project(p)
- super(CredentialsTestJSON, cls).tearDownClass()
+ super(CredentialsTestJSON, cls).resource_cleanup()
def _delete_credential(self, cred_id):
self.creds_client.delete_credential(cred_id)
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index ad46af2..f1f1eb6 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -22,9 +22,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(EndPointsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(EndPointsTestJSON, cls).resource_setup()
cls.identity_client = cls.client
cls.client = cls.endpoints_client
cls.service_ids = list()
@@ -47,12 +46,12 @@
cls.setup_endpoints.append(endpoint)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
for e in cls.setup_endpoints:
cls.client.delete_endpoint(e['id'])
for s in cls.service_ids:
cls.service_client.delete_service(s)
- super(EndPointsTestJSON, cls).tearDownClass()
+ super(EndPointsTestJSON, cls).resource_cleanup()
@test.attr(type='gate')
def test_list_endpoints(self):
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index d728b1d..b987d12 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -25,8 +25,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(EndpointsNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(EndpointsNegativeTestJSON, cls).resource_setup()
cls.identity_client = cls.client
cls.client = cls.endpoints_client
cls.service_ids = list()
@@ -40,10 +40,10 @@
cls.service_ids.append(cls.service_id)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
for s in cls.service_ids:
cls.service_client.delete_service(s)
- super(EndpointsNegativeTestJSON, cls).tearDownClass()
+ super(EndpointsNegativeTestJSON, cls).resource_cleanup()
@test.attr(type=['negative', 'gate'])
def test_create_with_enabled_False(self):
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index 4d2cc46..987a9d5 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -22,8 +22,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(GroupsV3TestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(GroupsV3TestJSON, cls).resource_setup()
@test.attr(type='smoke')
def test_group_create_update_get(self):
diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py
index a3944e2..be06c7f 100644
--- a/tempest/api/identity/admin/v3/test_list_projects.py
+++ b/tempest/api/identity/admin/v3/test_list_projects.py
@@ -22,8 +22,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(ListProjectsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ListProjectsTestJSON, cls).resource_setup()
cls.project_ids = list()
cls.data.setup_test_domain()
# Create project with domain
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index 497c5ea..903ad5c 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -32,8 +32,8 @@
map(lambda x: x[key], body))
@classmethod
- def setUpClass(cls):
- super(UsersV3TestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(UsersV3TestJSON, cls).resource_setup()
alt_user = data_utils.rand_name('test_user')
alt_password = data_utils.rand_name('pass')
cls.alt_email = alt_user + '@testmail.tm'
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index 8fc0e22..c5d5824 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -23,9 +23,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(RegionsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(RegionsTestJSON, cls).resource_setup()
cls.setup_regions = list()
cls.client = cls.region_client
for i in range(2):
@@ -34,10 +33,10 @@
cls.setup_regions.append(region)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
for r in cls.setup_regions:
cls.client.delete_region(r['id'])
- super(RegionsTestJSON, cls).tearDownClass()
+ super(RegionsTestJSON, cls).resource_cleanup()
def _delete_region(self, region_id):
self.client.delete_region(region_id)
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index 1f7cf48..5e14a04 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -22,9 +22,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(RolesV3TestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(RolesV3TestJSON, cls).resource_setup()
for _ in range(3):
role_name = data_utils.rand_name(name='role-')
_, role = cls.client.create_role(role_name)
@@ -52,7 +51,7 @@
data_utils.rand_name('Role-'))
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.client.delete_role(cls.role['id'])
cls.client.delete_group(cls.group_body['id'])
cls.client.delete_user(cls.user_body['id'])
@@ -61,7 +60,7 @@
# before deleting,or else it would result in unauthorized error
cls.client.update_domain(cls.domain['id'], enabled=False)
cls.client.delete_domain(cls.domain['id'])
- super(RolesV3TestJSON, cls).tearDownClass()
+ super(RolesV3TestJSON, cls).resource_cleanup()
def _list_assertions(self, body, fetched_role_ids, role_id):
self.assertEqual(len(body), 1)
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index 68d61f6..230e09f 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -47,7 +47,6 @@
self.assertRaises(exceptions.NotFound, self.client.get_token,
subject_token)
- @test.skip_because(bug="1351026")
@test.attr(type='gate')
def test_rescope_token(self):
"""Rescope a token.
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 3996cc1..a225f12 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -29,8 +29,8 @@
class BaseIdentityAdminTest(tempest.test.BaseTestCase):
@classmethod
- def setUpClass(cls):
- super(BaseIdentityAdminTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseIdentityAdminTest, cls).resource_setup()
cls.os_adm = clients.AdminManager(interface=cls._interface)
cls.os = clients.Manager(interface=cls._interface)
@@ -72,10 +72,10 @@
class BaseIdentityV2AdminTest(BaseIdentityAdminTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.identity_feature_enabled.api_v2:
raise cls.skipException("Identity api v2 is not enabled")
- super(BaseIdentityV2AdminTest, cls).setUpClass()
+ super(BaseIdentityV2AdminTest, cls).resource_setup()
cls.client = cls.os_adm.identity_client
cls.token_client = cls.os_adm.token_client
if not cls.client.has_admin_extensions():
@@ -84,18 +84,18 @@
cls.non_admin_client = cls.os.identity_client
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.data.teardown_all()
- super(BaseIdentityV2AdminTest, cls).tearDownClass()
+ super(BaseIdentityV2AdminTest, cls).resource_cleanup()
class BaseIdentityV3AdminTest(BaseIdentityAdminTest):
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.identity_feature_enabled.api_v3:
raise cls.skipException("Identity api v3 is not enabled")
- super(BaseIdentityV3AdminTest, cls).setUpClass()
+ super(BaseIdentityV3AdminTest, cls).resource_setup()
cls.client = cls.os_adm.identity_v3_client
cls.token = cls.os_adm.token_v3_client
cls.endpoints_client = cls.os_adm.endpoints_client
@@ -108,9 +108,9 @@
cls.non_admin_client = cls.os.identity_v3_client
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls.data.teardown_all()
- super(BaseIdentityV3AdminTest, cls).tearDownClass()
+ super(BaseIdentityV3AdminTest, cls).resource_cleanup()
class DataGenerator(object):
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index f8782ad..0d27afa 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -21,8 +21,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(AgentManagementTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AgentManagementTestJSON, cls).resource_setup()
if not test.is_extension_enabled('agent', 'network'):
msg = "agent extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index c84d1a7..78f211d 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -20,9 +20,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(DHCPAgentSchedulersTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(DHCPAgentSchedulersTestJSON, cls).resource_setup()
if not test.is_extension_enabled('dhcp_agent_scheduler', 'network'):
msg = "dhcp_agent_scheduler extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 710c669..2e58dae 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -18,8 +18,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(ExternalNetworksTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ExternalNetworksTestJSON, cls).resource_setup()
cls.network = cls.create_network()
def _create_network(self, external=True):
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py
index 3718cb5..46c5e76 100644
--- a/tempest/api/network/admin/test_floating_ips_admin_actions.py
+++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py
@@ -26,8 +26,8 @@
force_tenant_isolation = True
@classmethod
- def setUpClass(cls):
- super(FloatingIPAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPAdminTestJSON, cls).resource_setup()
cls.ext_net_id = CONF.network.public_network_id
cls.floating_ip = cls.create_floatingip(cls.ext_net_id)
cls.alt_manager = clients.Manager(cls.isolated_creds.get_alt_creds())
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index d7de73b..567af24 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -34,8 +34,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(L3AgentSchedulerTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(L3AgentSchedulerTestJSON, cls).resource_setup()
if not test.is_extension_enabled('l3_agent_scheduler', 'network'):
msg = "L3 Agent Scheduler Extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
index d0c31b3..1476f30 100644
--- a/tempest/api/network/admin/test_lbaas_agent_scheduler.py
+++ b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
@@ -35,9 +35,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(LBaaSAgentSchedulerTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(LBaaSAgentSchedulerTestJSON, cls).resource_setup()
if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
msg = "LBaaS Agent Scheduler Extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/admin/test_load_balancer_admin_actions.py b/tempest/api/network/admin/test_load_balancer_admin_actions.py
index a97d275..6d115e8 100644
--- a/tempest/api/network/admin/test_load_balancer_admin_actions.py
+++ b/tempest/api/network/admin/test_load_balancer_admin_actions.py
@@ -29,9 +29,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(LoadBalancerAdminTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(LoadBalancerAdminTestJSON, cls).resource_setup()
if not test.is_extension_enabled('lbaas', 'network'):
msg = "lbaas extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index 9ac97f9..72aef36 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -39,8 +39,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(QuotasTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(QuotasTest, cls).resource_setup()
if not test.is_extension_enabled('quotas', 'network'):
msg = "quotas extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 1a23cb6..834c010 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -56,10 +56,10 @@
_ip_version = 4
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
# Create no network resources for these test.
cls.set_network_resources()
- super(BaseNetworkTest, cls).setUpClass()
+ super(BaseNetworkTest, cls).resource_setup()
if not CONF.service_available.neutron:
raise cls.skipException("Neutron support is required")
@@ -85,7 +85,7 @@
cls.ipsecpolicies = []
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
if CONF.service_available.neutron:
# Clean up ipsec policies
for ipsecpolicy in cls.ipsecpolicies:
@@ -138,7 +138,7 @@
for network in cls.networks:
cls.client.delete_network(network['id'])
cls.clear_isolated_creds()
- super(BaseNetworkTest, cls).tearDownClass()
+ super(BaseNetworkTest, cls).resource_cleanup()
@classmethod
def create_network(cls, network_name=None):
@@ -363,8 +363,8 @@
class BaseAdminNetworkTest(BaseNetworkTest):
@classmethod
- def setUpClass(cls):
- super(BaseAdminNetworkTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseAdminNetworkTest, cls).resource_setup()
admin_username = CONF.compute_admin.username
admin_password = CONF.compute_admin.password
admin_tenant = CONF.compute_admin.tenant_name
diff --git a/tempest/api/network/base_routers.py b/tempest/api/network/base_routers.py
index f69e6fd..38985a0 100644
--- a/tempest/api/network/base_routers.py
+++ b/tempest/api/network/base_routers.py
@@ -22,8 +22,8 @@
# require admin credentials by default
@classmethod
- def setUpClass(cls):
- super(BaseRouterTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseRouterTest, cls).resource_setup()
def _delete_router(self, router_id):
self.client.delete_router(router_id)
diff --git a/tempest/api/network/base_security_groups.py b/tempest/api/network/base_security_groups.py
index c2af2f2..622ed01 100644
--- a/tempest/api/network/base_security_groups.py
+++ b/tempest/api/network/base_security_groups.py
@@ -20,8 +20,8 @@
class BaseSecGroupTest(base.BaseNetworkTest):
@classmethod
- def setUpClass(cls):
- super(BaseSecGroupTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseSecGroupTest, cls).resource_setup()
def _create_security_group(self):
# Create a security group
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index 86acc71..c085c39 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -37,9 +37,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(AllowedAddressPairTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(AllowedAddressPairTestJSON, cls).resource_setup()
if not test.is_extension_enabled('allowed-address-pairs', 'network'):
msg = "Allowed Address Pairs extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py
index c3607c8..715136c 100644
--- a/tempest/api/network/test_extensions.py
+++ b/tempest/api/network/test_extensions.py
@@ -33,8 +33,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(ExtensionsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ExtensionsTestJSON, cls).resource_setup()
@test.attr(type='smoke')
def test_list_show_extensions(self):
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
index 82ebc5a..86da9b7 100644
--- a/tempest/api/network/test_extra_dhcp_options.py
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -36,9 +36,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(ExtraDHCPOptionsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ExtraDHCPOptionsTestJSON, cls).resource_setup()
if not test.is_extension_enabled('extra_dhcp_opt', 'network'):
msg = "Extra DHCP Options extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 8b42a9e..52672ea 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -46,9 +46,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(FloatingIPTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FloatingIPTestJSON, cls).resource_setup()
if not test.is_extension_enabled('router', 'network'):
msg = "router extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_fwaas_extensions.py b/tempest/api/network/test_fwaas_extensions.py
index 9300c5e..193bf76 100644
--- a/tempest/api/network/test_fwaas_extensions.py
+++ b/tempest/api/network/test_fwaas_extensions.py
@@ -46,8 +46,8 @@
"""
@classmethod
- def setUpClass(cls):
- super(FWaaSExtensionTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(FWaaSExtensionTestJSON, cls).resource_setup()
if not test.is_extension_enabled('fwaas', 'network'):
msg = "FWaaS Extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index e3109ea..baa8cad 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -38,9 +38,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(LoadBalancerTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(LoadBalancerTestJSON, cls).resource_setup()
if not test.is_extension_enabled('lbaas', 'network'):
msg = "lbaas extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
index 0cc218b..2cfb841 100644
--- a/tempest/api/network/test_metering_extensions.py
+++ b/tempest/api/network/test_metering_extensions.py
@@ -35,9 +35,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(MeteringJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(MeteringJSON, cls).resource_setup()
if not test.is_extension_enabled('metering', 'network'):
msg = "metering extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index f3da614..e1eb48d 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -59,9 +59,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(NetworksTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(NetworksTestJSON, cls).resource_setup()
cls.network = cls.create_network()
cls.name = cls.network['name']
cls.subnet = cls.create_subnet(cls.network)
@@ -366,11 +365,11 @@
_ip_version = 6
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.network_feature_enabled.ipv6:
skip_msg = "IPv6 Tests are disabled."
raise cls.skipException(skip_msg)
- super(NetworksIpV6TestJSON, cls).setUpClass()
+ super(NetworksIpV6TestJSON, cls).resource_setup()
@test.attr(type='smoke')
def test_create_delete_subnet_with_gw(self):
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index 26f6b8f..ce0bb57 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -38,9 +38,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(PortsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(PortsTestJSON, cls).resource_setup()
cls.network = cls.create_network()
cls.port = cls.create_port(cls.network)
@@ -162,9 +161,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(PortsAdminExtendedAttrsTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(PortsAdminExtendedAttrsTestJSON, cls).resource_setup()
cls.identity_client = cls._get_identity_admin_client()
cls.tenant = cls.identity_client.get_tenant_by_name(
CONF.identity.tenant_name)
@@ -245,9 +243,8 @@
_tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(PortsIpV6TestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(PortsIpV6TestJSON, cls).resource_setup()
if not CONF.network_feature_enabled.ipv6:
skip_msg = "IPv6 Tests are disabled."
raise cls.skipException(skip_msg)
@@ -263,11 +260,11 @@
_tenant_network_mask_bits = CONF.network.tenant_network_v6_mask_bits
@classmethod
- def setUpClass(cls):
+ def resource_setup(cls):
if not CONF.network_feature_enabled.ipv6:
skip_msg = "IPv6 Tests are disabled."
raise cls.skipException(skip_msg)
- super(PortsAdminExtendedAttrsIpV6TestJSON, cls).setUpClass()
+ super(PortsAdminExtendedAttrsIpV6TestJSON, cls).resource_setup()
class PortsAdminExtendedAttrsIpV6TestXML(PortsAdminExtendedAttrsIpV6TestJSON):
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index bcd8113..f3f25ac 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -28,8 +28,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(RoutersTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(RoutersTest, cls).resource_setup()
if not test.is_extension_enabled('router', 'network'):
msg = "router extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index feee51b..4c226af 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -28,9 +28,8 @@
_interface = 'json'
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(RoutersNegativeTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(RoutersNegativeTest, cls).resource_setup()
if not test.is_extension_enabled('router', 'network'):
msg = "router extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index cea8344..9764b4d 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -24,8 +24,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(SecGroupTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(SecGroupTest, cls).resource_setup()
if not test.is_extension_enabled('security-group', 'network'):
msg = "security-group extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index 53c9d12..9c6c267 100644
--- a/tempest/api/network/test_security_groups_negative.py
+++ b/tempest/api/network/test_security_groups_negative.py
@@ -24,8 +24,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(NegativeSecGroupTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(NegativeSecGroupTest, cls).resource_setup()
if not test.is_extension_enabled('security-group', 'network'):
msg = "security-group extension not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_service_type_management.py b/tempest/api/network/test_service_type_management.py
index dbb72fb..302069f 100644
--- a/tempest/api/network/test_service_type_management.py
+++ b/tempest/api/network/test_service_type_management.py
@@ -18,8 +18,8 @@
_interface = 'json'
@classmethod
- def setUpClass(cls):
- super(ServiceTypeManagementTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(ServiceTypeManagementTestJSON, cls).resource_setup()
if not test.is_extension_enabled('service-type', 'network'):
msg = "Neutron Service Type Management not enabled."
raise cls.skipException(msg)
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
index 09e9640..c61bf41 100644
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ b/tempest/api/network/test_vpnaas_extensions.py
@@ -34,12 +34,11 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
+ def resource_setup(cls):
if not test.is_extension_enabled('vpnaas', 'network'):
msg = "vpnaas extension not enabled."
raise cls.skipException(msg)
- super(VPNaaSTestJSON, cls).setUpClass()
+ super(VPNaaSTestJSON, cls).resource_setup()
cls.network = cls.create_network()
cls.subnet = cls.create_subnet(cls.network)
cls.router = cls.create_router(
diff --git a/tempest/cli/simple_read_only/compute/__init__.py b/tempest/cli/simple_read_only/compute/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/compute/__init__.py
diff --git a/tempest/cli/simple_read_only/data_processing/__init__.py b/tempest/cli/simple_read_only/data_processing/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/data_processing/__init__.py
diff --git a/tempest/cli/simple_read_only/identity/__init__.py b/tempest/cli/simple_read_only/identity/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/identity/__init__.py
diff --git a/tempest/cli/simple_read_only/image/__init__.py b/tempest/cli/simple_read_only/image/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/image/__init__.py
diff --git a/tempest/cli/simple_read_only/network/__init__.py b/tempest/cli/simple_read_only/network/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/network/__init__.py
diff --git a/tempest/cli/simple_read_only/object_storage/__init__.py b/tempest/cli/simple_read_only/object_storage/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/object_storage/__init__.py
diff --git a/tempest/cli/simple_read_only/orchestration/__init__.py b/tempest/cli/simple_read_only/orchestration/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/orchestration/__init__.py
diff --git a/tempest/cli/simple_read_only/orchestration/test_heat.py b/tempest/cli/simple_read_only/orchestration/test_heat.py
index 019818b..430cdf1 100644
--- a/tempest/cli/simple_read_only/orchestration/test_heat.py
+++ b/tempest/cli/simple_read_only/orchestration/test_heat.py
@@ -38,6 +38,9 @@
"not available")
raise cls.skipException(msg)
super(SimpleReadOnlyHeatClientTest, cls).setUpClass()
+ cls.heat_template_path = os.path.join(os.path.dirname(
+ os.path.dirname(os.path.realpath(__file__))),
+ 'heat_templates/heat_minimal.yaml')
def test_heat_stack_list(self):
self.heat('stack-list')
@@ -70,17 +73,13 @@
self.assertIsInstance(json.loads(rsrc_schema), dict)
def test_heat_template_validate_yaml(self):
- filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- 'heat_templates/heat_minimal.yaml')
- ret = self.heat('template-validate -f %s' % filepath)
+ ret = self.heat('template-validate -f %s' % self.heat_template_path)
# On success template-validate returns a json representation
# of the template parameters
self.assertIsInstance(json.loads(ret), dict)
def test_heat_template_validate_hot(self):
- filepath = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- 'heat_templates/heat_minimal_hot.yaml')
- ret = self.heat('template-validate -f %s' % filepath)
+ ret = self.heat('template-validate -f %s' % self.heat_template_path)
self.assertIsInstance(json.loads(ret), dict)
def test_heat_help(self):
diff --git a/tempest/cli/simple_read_only/telemetry/__init__.py b/tempest/cli/simple_read_only/telemetry/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/telemetry/__init__.py
diff --git a/tempest/cli/simple_read_only/volume/__init__.py b/tempest/cli/simple_read_only/volume/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tempest/cli/simple_read_only/volume/__init__.py
diff --git a/tempest/cli/simple_read_only/volume/test_cinder.py b/tempest/cli/simple_read_only/volume/test_cinder.py
index 3a9a7a6..e44a577 100644
--- a/tempest/cli/simple_read_only/volume/test_cinder.py
+++ b/tempest/cli/simple_read_only/volume/test_cinder.py
@@ -121,8 +121,12 @@
self.assertTableStruct(zone_list, ['Name', 'Status'])
def test_cinder_endpoints(self):
- endpoints = self.parser.listing(self.cinder('endpoints'))
- self.assertTableStruct(endpoints, ['nova', 'Value'])
+ out = self.cinder('endpoints')
+ tables = self.parser.tables(out)
+ for table in tables:
+ headers = table['headers']
+ self.assertTrue(2 >= len(headers))
+ self.assertEqual('Value', headers[1])
def test_cinder_service_list(self):
service_list = self.parser.listing(self.cinder('service-list'))
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py
index c491169..7423c17 100644
--- a/tempest/common/accounts.py
+++ b/tempest/common/accounts.py
@@ -38,7 +38,12 @@
def __init__(self, name):
super(Accounts, self).__init__(name)
- accounts = read_accounts_yaml(CONF.auth.test_accounts_file)
+ if os.path.isfile(CONF.auth.test_accounts_file):
+ accounts = read_accounts_yaml(CONF.auth.test_accounts_file)
+ self.use_default_creds = False
+ else:
+ accounts = {}
+ self.use_default_creds = True
self.hash_dict = self.get_hash_dict(accounts)
self.accounts_dir = os.path.join(CONF.lock_path, 'test_accounts')
self.isolated_creds = {}
@@ -77,6 +82,9 @@
raise exceptions.InvalidConfiguration(msg)
def _get_creds(self):
+ if self.use_default_creds:
+ raise exceptions.InvalidConfiguration(
+ "Account file %s doesn't exist" % CONF.auth.test_accounts_file)
free_hash = self._get_free_hash(self.hash_dict.keys())
return self.hash_dict[free_hash]
@@ -150,16 +158,22 @@
def get_primary_creds(self):
if self.isolated_creds.get('primary'):
return self.isolated_creds.get('primary')
- creds = self.get_creds(0)
- primary_credential = auth.get_credentials(**creds)
+ if not self.use_default_creds:
+ creds = self.get_creds(0)
+ primary_credential = auth.get_credentials(**creds)
+ else:
+ primary_credential = auth.get_default_credentials('user')
self.isolated_creds['primary'] = primary_credential
return primary_credential
def get_alt_creds(self):
if self.isolated_creds.get('alt'):
return self.isolated_creds.get('alt')
- creds = self.get_creds(1)
- alt_credential = auth.get_credentials(**creds)
+ if not self.use_default_creds:
+ creds = self.get_creds(1)
+ alt_credential = auth.get_credentials(**creds)
+ else:
+ alt_credential = auth.get_default_credentials('alt_user')
self.isolated_creds['alt'] = alt_credential
return alt_credential
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index c4f1214..52568cb 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -131,3 +131,31 @@
if caller:
message = '(%s) %s' % (caller, message)
raise exceptions.TimeoutException(message)
+
+
+def wait_for_bm_node_status(client, node_id, attr, status):
+ """Waits for a baremetal node attribute to reach given status.
+
+ The client should have a show_node(node_uuid) method to get the node.
+ """
+ _, node = client.show_node(node_id)
+ start = int(time.time())
+
+ while node[attr] != status:
+ time.sleep(client.build_interval)
+ _, node = client.show_node(node_id)
+ if node[attr] == status:
+ return
+
+ if int(time.time()) - start >= client.build_timeout:
+ message = ('Node %(node_id)s failed to reach %(attr)s=%(status)s '
+ 'within the required time (%(timeout)s s).' %
+ {'node_id': node_id,
+ 'attr': attr,
+ 'status': status,
+ 'timeout': client.build_timeout})
+ message += ' Current state of %s: %s.' % (attr, node[attr])
+ caller = misc_utils.find_test_caller()
+ if caller:
+ message = '(%s) %s' % (caller, message)
+ raise exceptions.TimeoutException(message)
diff --git a/tempest/manager.py b/tempest/manager.py
index fb2842f..75aee96 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -51,17 +51,17 @@
self.client_attr_names = []
@classmethod
- def get_auth_provider_class(cls, auth_version):
- if auth_version == 'v2':
- return auth.KeystoneV2AuthProvider
- else:
+ def get_auth_provider_class(cls, credentials):
+ if isinstance(credentials, auth.KeystoneV3Credentials):
return auth.KeystoneV3AuthProvider
+ else:
+ return auth.KeystoneV2AuthProvider
def get_auth_provider(self, credentials):
if credentials is None:
raise exceptions.InvalidCredentials(
'Credentials must be specified')
- auth_provider_class = self.get_auth_provider_class(self.auth_version)
+ auth_provider_class = self.get_auth_provider_class(credentials)
return auth_provider_class(
client_type=getattr(self, 'client_type', None),
interface=getattr(self, 'interface', None),
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 66043d3..aa2d686 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -16,13 +16,10 @@
import logging
import os
-import re
import subprocess
-import time
from cinderclient import exceptions as cinder_exceptions
import glanceclient
-from heatclient import exc as heat_exceptions
import netaddr
from neutronclient.common import exceptions as exc
from novaclient import exceptions as nova_exceptions
@@ -38,7 +35,6 @@
from tempest import config
from tempest import exceptions
from tempest.openstack.common import log
-from tempest.openstack.common import timeutils
from tempest.services.network import resources as net_resources
import tempest.test
@@ -92,13 +88,8 @@
cls.interface_client = cls.manager.interfaces_client
# Neutron network client
cls.network_client = cls.manager.network_client
-
- @classmethod
- def tearDownClass(cls):
- # Isolated creds also manages network resources, which should
- # be cleaned up at the end of the test case
- cls.isolated_creds.clear_isolated_creds()
- super(ScenarioTest, cls).tearDownClass()
+ # Heat client
+ cls.orchestration_client = cls.manager.orchestration_client
@classmethod
def _get_credentials(cls, get_creds, ctype):
@@ -222,26 +213,6 @@
if create_kwargs is None:
create_kwargs = {}
- fixed_network_name = CONF.compute.fixed_network_name
- if 'nics' not in create_kwargs and fixed_network_name:
- _, networks = self.networks_client.list_networks()
- # If several networks found, set the NetID on which to connect the
- # server to avoid the following error "Multiple possible networks
- # found, use a Network ID to be more specific."
- # See Tempest #1250866
- if len(networks) > 1:
- for network in networks:
- if network['label'] == fixed_network_name:
- create_kwargs['nics'] = [{'net-id': network['id']}]
- break
- # If we didn't find the network we were looking for :
- else:
- msg = ("The network on which the NIC of the server must "
- "be connected can not be found : "
- "fixed_network_name=%s. Starting instance without "
- "specifying a network.") % fixed_network_name
- LOG.info(msg)
-
LOG.debug("Creating a server (name: %s, image: %s, flavor: %s)",
name, image, flavor)
_, server = self.servers_client.create_server(name, image, flavor,
@@ -1015,11 +986,6 @@
cls.ceilometer_client = cls.manager.ceilometer_client
@classmethod
- def tearDownClass(cls):
- cls.isolated_creds.clear_isolated_creds()
- super(OfficialClientTest, cls).tearDownClass()
-
- @classmethod
def _get_credentials(cls, get_creds, ctype):
if CONF.compute.allow_tenant_isolation:
creds = get_creds()
@@ -2253,7 +2219,7 @@
return network, subnet, router
-class OrchestrationScenarioTest(OfficialClientTest):
+class OrchestrationScenarioTest(ScenarioTest):
"""
Base class for orchestration scenario tests
"""
@@ -2283,15 +2249,15 @@
@classmethod
def _get_default_network(cls):
- networks = cls.network_client.list_networks()
- for net in networks['networks']:
- if net['name'] == CONF.compute.fixed_network_name:
+ _, networks = cls.networks_client.list_networks()
+ for net in networks:
+ if net['label'] == CONF.compute.fixed_network_name:
return net
@staticmethod
def _stack_output(stack, output_key):
"""Return a stack output value for a given key."""
- return next((o['output_value'] for o in stack.outputs
+ return next((o['output_value'] for o in stack['outputs']
if o['output_key'] == output_key), None)
def _ping_ip_address(self, ip_address, should_succeed=True):
@@ -2307,82 +2273,6 @@
return tempest.test.call_until_true(
ping, CONF.orchestration.build_timeout, 1)
- def _wait_for_resource_status(self, stack_identifier, resource_name,
- status, failure_pattern='^.*_FAILED$'):
- """Waits for a Resource to reach a given status."""
- fail_regexp = re.compile(failure_pattern)
- build_timeout = CONF.orchestration.build_timeout
- build_interval = CONF.orchestration.build_interval
-
- start = timeutils.utcnow()
- while timeutils.delta_seconds(start,
- timeutils.utcnow()) < build_timeout:
- try:
- res = self.client.resources.get(
- stack_identifier, resource_name)
- except heat_exceptions.HTTPNotFound:
- # ignore this, as the resource may not have
- # been created yet
- pass
- else:
- if res.resource_status == status:
- return
- if fail_regexp.search(res.resource_status):
- raise exceptions.StackResourceBuildErrorException(
- resource_name=res.resource_name,
- stack_identifier=stack_identifier,
- resource_status=res.resource_status,
- resource_status_reason=res.resource_status_reason)
- time.sleep(build_interval)
-
- message = ('Resource %s failed to reach %s status within '
- 'the required time (%s s).' %
- (res.resource_name, status, build_timeout))
- raise exceptions.TimeoutException(message)
-
- def _wait_for_stack_status(self, stack_identifier, status,
- failure_pattern='^.*_FAILED$'):
- """
- Waits for a Stack to reach a given status.
-
- Note this compares the full $action_$status, e.g
- CREATE_COMPLETE, not just COMPLETE which is exposed
- via the status property of Stack in heatclient
- """
- fail_regexp = re.compile(failure_pattern)
- build_timeout = CONF.orchestration.build_timeout
- build_interval = CONF.orchestration.build_interval
-
- start = timeutils.utcnow()
- while timeutils.delta_seconds(start,
- timeutils.utcnow()) < build_timeout:
- try:
- stack = self.client.stacks.get(stack_identifier)
- except heat_exceptions.HTTPNotFound:
- # ignore this, as the stackource may not have
- # been created yet
- pass
- else:
- if stack.stack_status == status:
- return
- if fail_regexp.search(stack.stack_status):
- raise exceptions.StackBuildErrorException(
- stack_identifier=stack_identifier,
- stack_status=stack.stack_status,
- stack_status_reason=stack.stack_status_reason)
- time.sleep(build_interval)
-
- message = ('Stack %s failed to reach %s status within '
- 'the required time (%s s).' %
- (stack.stack_name, status, build_timeout))
- raise exceptions.TimeoutException(message)
-
- def _stack_delete(self, stack_identifier):
- try:
- self.client.stacks.delete(stack_identifier)
- except heat_exceptions.HTTPNotFound:
- pass
-
class SwiftScenarioTest(ScenarioTest):
"""
diff --git a/tempest/scenario/orchestration/test_server_cfn_init.py b/tempest/scenario/orchestration/test_server_cfn_init.py
index 36e6126..4e85429 100644
--- a/tempest/scenario/orchestration/test_server_cfn_init.py
+++ b/tempest/scenario/orchestration/test_server_cfn_init.py
@@ -38,7 +38,7 @@
self.keypair_name = CONF.orchestration.keypair_name
else:
self.keypair = self.create_keypair()
- self.keypair_name = self.keypair.id
+ self.keypair_name = self.keypair['name']
def launch_stack(self):
net = self._get_default_network()
@@ -52,32 +52,36 @@
# create the stack
self.template = self._load_template(__file__, self.template_name)
- self.client.stacks.create(
- stack_name=self.stack_name,
+ _, stack = self.client.create_stack(
+ name=self.stack_name,
template=self.template,
parameters=self.parameters)
+ stack = stack['stack']
- self.stack = self.client.stacks.get(self.stack_name)
- self.stack_identifier = '%s/%s' % (self.stack_name, self.stack.id)
- self.addCleanup(self._stack_delete, self.stack_identifier)
+ _, self.stack = self.client.get_stack(stack['id'])
+ self.stack_identifier = '%s/%s' % (self.stack_name, self.stack['id'])
+ self.addCleanup(self.delete_wrapper,
+ self.orchestration_client.delete_stack,
+ self.stack_identifier)
def check_stack(self):
sid = self.stack_identifier
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'WaitHandle', 'CREATE_COMPLETE')
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'SmokeSecurityGroup', 'CREATE_COMPLETE')
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'SmokeKeys', 'CREATE_COMPLETE')
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'CfnUser', 'CREATE_COMPLETE')
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'SmokeServer', 'CREATE_COMPLETE')
- server_resource = self.client.resources.get(sid, 'SmokeServer')
- server_id = server_resource.physical_resource_id
- server = self.compute_client.servers.get(server_id)
- server_ip = server.networks[CONF.compute.network_for_ssh][0]
+ _, server_resource = self.client.get_resource(sid, 'SmokeServer')
+ server_id = server_resource['physical_resource_id']
+ _, server = self.servers_client.get_server(server_id)
+ server_ip =\
+ server['addresses'][CONF.compute.network_for_ssh][0]['addr']
if not self._ping_ip_address(server_ip):
self._log_console_output(servers=[server])
@@ -85,7 +89,7 @@
"Timed out waiting for %s to become reachable" % server_ip)
try:
- self._wait_for_resource_status(
+ self.client.wait_for_resource_status(
sid, 'WaitCondition', 'CREATE_COMPLETE')
except (exceptions.StackResourceBuildErrorException,
exceptions.TimeoutException) as e:
@@ -96,9 +100,9 @@
# logs to be compared
self._log_console_output(servers=[server])
- self._wait_for_stack_status(sid, 'CREATE_COMPLETE')
+ self.client.wait_for_stack_status(sid, 'CREATE_COMPLETE')
- stack = self.client.stacks.get(sid)
+ _, stack = self.client.get_stack(sid)
# This is an assert of great significance, as it means the following
# has happened:
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index c145551..84e1048 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -61,8 +61,8 @@
network, subnet, router = self.create_networks()
public_network_id = CONF.network.public_network_id
create_kwargs = {
- 'nics': [
- {'net-id': network.id},
+ 'networks': [
+ {'uuid': network.id},
],
'key_name': self.keypair['name'],
'security_groups': [security_group],
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index e8dba6a..10dfb66 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -147,8 +147,8 @@
self.keypairs[keypair['name']] = keypair
security_groups = [self.security_group]
create_kwargs = {
- 'nics': [
- {'net-id': network.id},
+ 'networks': [
+ {'uuid': network.id},
],
'key_name': keypair['name'],
'security_groups': security_groups,
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 520c232..20505eb 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -234,8 +234,8 @@
if security_groups is None:
security_groups = [tenant.security_groups['default']]
create_kwargs = {
- 'nics': [
- {'net-id': tenant.network.id},
+ 'networks': [
+ {'uuid': tenant.network.id},
],
'key_name': tenant.keypair['name'],
'security_groups': security_groups,
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 0b97f74..4933300 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -95,9 +95,13 @@
for ch in get_change(value, path + '%s/' % name):
yield ch
else:
- yield {'path': path + name,
- 'value': value,
- 'op': 'replace'}
+ if value is None:
+ yield {'path': path + name,
+ 'op': 'remove'}
+ else:
+ yield {'path': path + name,
+ 'value': value,
+ 'op': 'replace'}
patch = [ch for ch in get_change(kw)
if ch['path'].lstrip('/') in allowed_attributes]
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 032e1da..9359808 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -27,9 +27,9 @@
self.uri_prefix = 'v%s' % self.version
@base.handle_errors
- def list_nodes(self):
+ def list_nodes(self, **kwargs):
"""List all existing nodes."""
- return self._list_request('nodes')
+ return self._list_request('nodes', **kwargs)
@base.handle_errors
def list_chassis(self):
@@ -37,11 +37,21 @@
return self._list_request('chassis')
@base.handle_errors
+ def list_chassis_nodes(self, chassis_uuid):
+ """List all nodes associated with a chassis."""
+ return self._list_request('/chassis/%s/nodes' % chassis_uuid)
+
+ @base.handle_errors
def list_ports(self, **kwargs):
"""List all existing ports."""
return self._list_request('ports', **kwargs)
@base.handle_errors
+ def list_node_ports(self, uuid):
+ """List all ports associated with the node."""
+ return self._list_request('/nodes/%s/ports' % uuid)
+
+ @base.handle_errors
def list_nodestates(self, uuid):
"""List all existing states."""
return self._list_request('/nodes/%s/states' % uuid)
@@ -68,6 +78,21 @@
return self._show_request('nodes', uuid)
@base.handle_errors
+ def show_node_by_instance_uuid(self, instance_uuid):
+ """
+ Gets a node associated with given instance uuid.
+
+ :param uuid: Unique identifier of the node in UUID format.
+ :return: Serialized node as a dictionary.
+
+ """
+ uri = '/nodes/detail?instance_uuid=%s' % instance_uuid
+
+ return self._show_request('nodes',
+ uuid=None,
+ uri=uri)
+
+ @base.handle_errors
def show_chassis(self, uuid):
"""
Gets a specific chassis.
@@ -203,7 +228,8 @@
'properties/cpu_num',
'properties/storage',
'properties/memory',
- 'driver')
+ 'driver',
+ 'instance_uuid')
patch = self._make_patch(node_attributes, **kwargs)
diff --git a/tempest/test.py b/tempest/test.py
index d2b32d4..4a22b1b 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -69,6 +69,9 @@
def safe_setup(f):
"""A decorator used to wrap the setUpClass for cleaning up resources
when setUpClass failed.
+
+ Deprecated, see:
+ http://specs.openstack.org/openstack/qa-specs/specs/resource-cleanup.html
"""
@functools.wraps(f)
def decorator(cls):
@@ -279,15 +282,51 @@
@classmethod
def setUpClass(cls):
+ # It should never be overridden by descendants
if hasattr(super(BaseTestCase, cls), 'setUpClass'):
super(BaseTestCase, cls).setUpClass()
cls.setUpClassCalled = True
+ # No test resource is allocated until here
+ try:
+ # TODO(andreaf) Split-up resource_setup in stages:
+ # skip checks, pre-hook, credentials, clients, resources, post-hook
+ cls.resource_setup()
+ except Exception:
+ etype, value, trace = sys.exc_info()
+ LOG.info("%s in resource setup. Invoking tearDownClass." % etype)
+ # Catch any exception in tearDown so we can re-raise the original
+ # exception at the end
+ try:
+ cls.tearDownClass()
+ except Exception as te:
+ LOG.exception("tearDownClass failed: %s" % te)
+ try:
+ raise etype(value), None, trace
+ finally:
+ del trace # for avoiding circular refs
@classmethod
def tearDownClass(cls):
at_exit_set.discard(cls)
+ # It should never be overridden by descendants
if hasattr(super(BaseTestCase, cls), 'tearDownClass'):
super(BaseTestCase, cls).tearDownClass()
+ try:
+ cls.resource_cleanup()
+ finally:
+ cls.clear_isolated_creds()
+
+ @classmethod
+ def resource_setup(cls):
+ """Class level setup steps for test cases.
+ Recommended order: skip checks, credentials, clients, resources.
+ """
+ pass
+
+ @classmethod
+ def resource_cleanup(cls):
+ """Class level resource cleanup for test cases. """
+ pass
def setUp(self):
super(BaseTestCase, self).setUp()
@@ -355,7 +394,7 @@
"""
Clears isolated creds if set
"""
- if getattr(cls, 'isolated_creds'):
+ if hasattr(cls, 'isolated_creds'):
cls.isolated_creds.clear_isolated_creds()
@classmethod
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index a0b3496..cf7ce65 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -57,6 +57,7 @@
'tempest.common.accounts.read_accounts_yaml',
return_value=self.test_accounts))
cfg.CONF.set_default('test_accounts_file', '', group='auth')
+ self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def _get_hash_list(self, accounts_list):
hash_list = []
@@ -220,6 +221,7 @@
'tempest.common.accounts.read_accounts_yaml',
return_value=self.test_accounts))
cfg.CONF.set_default('test_accounts_file', '', group='auth')
+ self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def test_get_creds(self):
test_accounts_class = accounts.NotLockingAccounts('test_name')
@@ -229,4 +231,4 @@
self.assertIsNotNone(creds, msg)
self.assertRaises(exceptions.InvalidConfiguration,
test_accounts_class.get_creds,
- id=len(self.test_accounts))
\ No newline at end of file
+ id=len(self.test_accounts))
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 4bf71f3..f94d880 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -108,8 +108,8 @@
CODE_RE = '.*' # regexp makes sense in group match
def match(self, exc):
- """:returns: Retruns with an error string if not matches,
- returns with None when matches.
+ """:returns: Returns with an error string if it does not match,
+ returns with None when it matches.
"""
if not isinstance(exc, exception.BotoServerError):
return "%r not an BotoServerError instance" % exc
@@ -485,7 +485,7 @@
@classmethod
def destroy_volume_wait(cls, volume):
- """Delete volume, tryies to detach first.
+ """Delete volume, tries to detach first.
Use just for teardown!
"""
exc_num = 0
@@ -518,7 +518,7 @@
@classmethod
def destroy_snapshot_wait(cls, snapshot):
- """delete snaphot, wait until not exists."""
+ """delete snapshot, wait until it ceases to exist."""
snapshot.delete()
def _update():
diff --git a/tools/check_logs.py b/tools/check_logs.py
index 917aaaf..7cf9d85 100755
--- a/tools/check_logs.py
+++ b/tools/check_logs.py
@@ -80,7 +80,6 @@
def scan_content(name, content, regexp, whitelist):
had_errors = False
- print_log_name = True
for line in content:
if not line.startswith("Stderr:") and regexp.match(line):
whitelisted = False
@@ -91,13 +90,8 @@
whitelisted = True
break
if not whitelisted or dump_all_errors:
- if print_log_name:
- print("\nLog File Has Errors: %s" % name)
- print_log_name = False
if not whitelisted:
had_errors = True
- print("*** Not Whitelisted ***"),
- print(line.rstrip())
return had_errors
@@ -151,17 +145,21 @@
whitelists = loaded
logs_with_errors = process_files(files_to_process, urls_to_process,
whitelists)
- if logs_with_errors:
- print("Logs have errors")
- if is_grenade:
- print("Currently not failing grenade runs with errors")
- return 0
+
failed = False
- for log in logs_with_errors:
- if log not in allowed_dirty:
- print("Log: %s not allowed to have ERRORS or TRACES" % log)
- failed = True
+ if logs_with_errors:
+ log_files = set(logs_with_errors)
+ for log in log_files:
+ msg = '%s log file has errors' % log
+ if log not in allowed_dirty:
+ msg += ' and is not allowed to have them'
+ failed = True
+ print(msg)
+ print("\nPlease check the respective log files to see the errors")
if failed:
+ if is_grenade:
+ print("Currently not failing grenade runs with errors")
+ return 0
return 1
print("ok")
return 0
diff --git a/tox.ini b/tox.ini
index 6ec0b2c..492c4f6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,28 +6,23 @@
[testenv]
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./tempest/test_discover
- PYTHONHASHSEED=0
usedevelop = True
install_command = pip install -U {opts} {packages}
[testenv:py26]
setenv = OS_TEST_PATH=./tempest/tests
- PYTHONHASHSEED=0
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
[testenv:py33]
setenv = OS_TEST_PATH=./tempest/tests
- PYTHONHASHSEED=0
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
[testenv:py27]
setenv = OS_TEST_PATH=./tempest/tests
- PYTHONHASHSEED=0
commands = python setup.py test --slowest --testr-arg='tempest\.tests {posargs}'
[testenv:cover]
setenv = OS_TEST_PATH=./tempest/tests
- PYTHONHASHSEED=0
commands = python setup.py testr --coverage --testr-arg='tempest\.tests {posargs}'
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
@@ -96,6 +91,7 @@
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
+setenv = PYTHONHASHSEED=0
commands =
flake8 {posargs}
{toxinidir}/tools/config/check_uptodate.sh