diff options
author | Andrea Frittoli <andrea.frittoli@hp.com> | 2014-09-15 13:14:54 +0100 |
---|---|---|
committer | Andrea Frittoli <andrea.frittoli@hp.com> | 2014-09-26 17:25:41 +0100 |
commit | 556f796b2efa33df19f9ed216a25892f9c706b2c (patch) | |
tree | d1124489a044a436c2afb053b14b82a047ddf5d0 | |
parent | c1f6cd3d3f0fac08bec01e3308ed63e72bbb8942 (diff) | |
download | tempest-556f796b2efa33df19f9ed216a25892f9c706b2c.tar.gz |
Migrate orchestration API tests to resource_* fixtures
Partially-implements bp resource-cleanup
Change-Id: I58b5f9f17d166c762a1091f4ecb2c560bff8e977
9 files changed, 20 insertions, 23 deletions
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py index 0b22de596..5a586fc14 100644 --- a/tempest/api/orchestration/base.py +++ b/tempest/api/orchestration/base.py @@ -30,8 +30,8 @@ class BaseOrchestrationTest(tempest.test.BaseTestCase): """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 @@ class BaseOrchestrationTest(tempest.test.BaseTestCase): 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 ffadb1698..f1a4f85ba 100644 --- a/tempest/api/orchestration/stacks/test_neutron_resources.py +++ b/tempest/api/orchestration/stacks/test_neutron_resources.py @@ -30,9 +30,8 @@ LOG = logging.getLogger(__name__) 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 72ad5f5bc..759cbbec6 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 @@ LOG = logging.getLogger(__name__) 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 2f5861178..1da340ca8 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 @@ class NovaKeyPairResourcesYAMLTest(base.BaseOrchestrationTest): _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 8023f2c6b..d7fbd6539 100644 --- a/tempest/api/orchestration/stacks/test_stacks.py +++ b/tempest/api/orchestration/stacks/test_stacks.py @@ -23,8 +23,8 @@ class StacksTestJSON(base.BaseOrchestrationTest): 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 d7c2a0daa..307468e75 100644 --- a/tempest/api/orchestration/stacks/test_swift_resources.py +++ b/tempest/api/orchestration/stacks/test_swift_resources.py @@ -26,9 +26,8 @@ CONF = config.CONF 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 0d6060d2c..262c57645 100644 --- a/tempest/api/orchestration/stacks/test_templates.py +++ b/tempest/api/orchestration/stacks/test_templates.py @@ -26,9 +26,8 @@ Resources: """ @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 b325104ad..908210732 100644 --- a/tempest/api/orchestration/stacks/test_templates_negative.py +++ b/tempest/api/orchestration/stacks/test_templates_negative.py @@ -30,8 +30,8 @@ Resources: 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 f371370a3..f47078c7c 100644 --- a/tempest/api/orchestration/stacks/test_volumes.py +++ b/tempest/api/orchestration/stacks/test_volumes.py @@ -26,8 +26,8 @@ LOG = logging.getLogger(__name__) 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') |