Migrate orchestration API tests to resource_* fixtures
Partially-implements bp resource-cleanup
Change-Id: I58b5f9f17d166c762a1091f4ecb2c560bff8e977
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 0b22de5..5a586fc 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -30,8 +30,8 @@
"""Base test case class for all Orchestration API tests."""
@classmethod
- def setUpClass(cls):
- super(BaseOrchestrationTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(BaseOrchestrationTest, cls).resource_setup()
cls.os = clients.Manager()
if not CONF.service_available.heat:
raise cls.skipException("Heat support is required")
@@ -146,11 +146,11 @@
return yaml.safe_load(f)
@classmethod
- def tearDownClass(cls):
+ def resource_cleanup(cls):
cls._clear_stacks()
cls._clear_keypairs()
cls._clear_images()
- super(BaseOrchestrationTest, cls).tearDownClass()
+ super(BaseOrchestrationTest, cls).resource_cleanup()
@staticmethod
def stack_output(stack, output_key):
diff --git a/tempest/api/orchestration/stacks/test_neutron_resources.py b/tempest/api/orchestration/stacks/test_neutron_resources.py
index ffadb16..f1a4f85 100644
--- a/tempest/api/orchestration/stacks/test_neutron_resources.py
+++ b/tempest/api/orchestration/stacks/test_neutron_resources.py
@@ -30,9 +30,8 @@
class NeutronResourcesTestJSON(base.BaseOrchestrationTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(NeutronResourcesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(NeutronResourcesTestJSON, cls).resource_setup()
if not CONF.orchestration.image_ref:
raise cls.skipException("No image available to test")
os = clients.Manager()
diff --git a/tempest/api/orchestration/stacks/test_non_empty_stack.py b/tempest/api/orchestration/stacks/test_non_empty_stack.py
index 72ad5f5..759cbbe 100644
--- a/tempest/api/orchestration/stacks/test_non_empty_stack.py
+++ b/tempest/api/orchestration/stacks/test_non_empty_stack.py
@@ -25,8 +25,8 @@
class StacksTestJSON(base.BaseOrchestrationTest):
@classmethod
- def setUpClass(cls):
- super(StacksTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(StacksTestJSON, cls).resource_setup()
cls.stack_name = data_utils.rand_name('heat')
template = cls.read_template('non_empty_stack')
image_id = (CONF.orchestration.image_ref or
diff --git a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
index 2f58611..1da340c 100644
--- a/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
+++ b/tempest/api/orchestration/stacks/test_nova_keypair_resources.py
@@ -27,8 +27,8 @@
_type = 'type'
@classmethod
- def setUpClass(cls):
- super(NovaKeyPairResourcesYAMLTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(NovaKeyPairResourcesYAMLTest, cls).resource_setup()
cls.stack_name = data_utils.rand_name('heat')
template = cls.read_template('nova_keypair', ext=cls._tpl_type)
diff --git a/tempest/api/orchestration/stacks/test_stacks.py b/tempest/api/orchestration/stacks/test_stacks.py
index 8023f2c..d7fbd65 100644
--- a/tempest/api/orchestration/stacks/test_stacks.py
+++ b/tempest/api/orchestration/stacks/test_stacks.py
@@ -23,8 +23,8 @@
empty_template = "HeatTemplateFormatVersion: '2012-12-12'\n"
@classmethod
- def setUpClass(cls):
- super(StacksTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(StacksTestJSON, cls).resource_setup()
@test.attr(type='smoke')
def test_stack_list_responds(self):
diff --git a/tempest/api/orchestration/stacks/test_swift_resources.py b/tempest/api/orchestration/stacks/test_swift_resources.py
index d7c2a0d..307468e 100644
--- a/tempest/api/orchestration/stacks/test_swift_resources.py
+++ b/tempest/api/orchestration/stacks/test_swift_resources.py
@@ -26,9 +26,8 @@
class SwiftResourcesTestJSON(base.BaseOrchestrationTest):
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(SwiftResourcesTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(SwiftResourcesTestJSON, cls).resource_setup()
cls.stack_name = data_utils.rand_name('heat')
template = cls.read_template('swift_basic')
os = clients.Manager()
diff --git a/tempest/api/orchestration/stacks/test_templates.py b/tempest/api/orchestration/stacks/test_templates.py
index 0d6060d..262c576 100644
--- a/tempest/api/orchestration/stacks/test_templates.py
+++ b/tempest/api/orchestration/stacks/test_templates.py
@@ -26,9 +26,8 @@
"""
@classmethod
- @test.safe_setup
- def setUpClass(cls):
- super(TemplateYAMLTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(TemplateYAMLTestJSON, cls).resource_setup()
cls.stack_name = data_utils.rand_name('heat')
cls.stack_identifier = cls.create_stack(cls.stack_name, cls.template)
cls.client.wait_for_stack_status(cls.stack_identifier,
diff --git a/tempest/api/orchestration/stacks/test_templates_negative.py b/tempest/api/orchestration/stacks/test_templates_negative.py
index b325104..9082107 100644
--- a/tempest/api/orchestration/stacks/test_templates_negative.py
+++ b/tempest/api/orchestration/stacks/test_templates_negative.py
@@ -30,8 +30,8 @@
invalid_template_url = 'http://www.example.com/template.yaml'
@classmethod
- def setUpClass(cls):
- super(TemplateYAMLNegativeTestJSON, cls).setUpClass()
+ def resource_setup(cls):
+ super(TemplateYAMLNegativeTestJSON, cls).resource_setup()
cls.parameters = {}
@test.attr(type=['gate', 'negative'])
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index f371370..f47078c 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -26,8 +26,8 @@
class CinderResourcesTest(base.BaseOrchestrationTest):
@classmethod
- def setUpClass(cls):
- super(CinderResourcesTest, cls).setUpClass()
+ def resource_setup(cls):
+ super(CinderResourcesTest, cls).resource_setup()
if not CONF.service_available.cinder:
raise cls.skipException('Cinder support is required')