diff --git a/heat_integrationtests/common/config.py b/heat_integrationtests/common/config.py index 31a996b42..0ea626377 100644 --- a/heat_integrationtests/common/config.py +++ b/heat_integrationtests/common/config.py @@ -88,6 +88,12 @@ IntegrationTestGroup = [ cfg.IntOpt('volume_size', default=1, help='Default size in GB for volumes created by volumes tests'), + cfg.BoolOpt('skip_stack_adopt_tests', + default=False, + help="Skip Stack Adopt Integration tests"), + cfg.BoolOpt('skip_stack_abandon_tests', + default=False, + help="Skip Stack Abandon Integration tests"), ] diff --git a/heat_integrationtests/common/test.py b/heat_integrationtests/common/test.py index df4780d4c..b4c3c81b4 100644 --- a/heat_integrationtests/common/test.py +++ b/heat_integrationtests/common/test.py @@ -308,6 +308,8 @@ class HeatIntegrationTest(testscenarios.WithScenarios, def stack_adopt(self, stack_name=None, files=None, parameters=None, environment=None, adopt_data=None, wait_for_status='ADOPT_COMPLETE'): + if self.conf.skip_stack_adopt_tests: + self.skipTest('Testing Stack adopt disabled in conf, skipping') name = stack_name or self._stack_rand_name() templ_files = files or {} params = parameters or {} @@ -326,3 +328,10 @@ class HeatIntegrationTest(testscenarios.WithScenarios, stack_identifier = '%s/%s' % (name, stack.id) self._wait_for_stack_status(stack_identifier, wait_for_status) return stack_identifier + + def stack_abandon(self, stack_id): + if self.conf.skip_stack_abandon_tests: + self.addCleanup(self.client.stacks.delete, stack_id) + self.skipTest('Testing Stack abandon disabled in conf, skipping') + info = self.client.stacks.abandon(stack_id=stack_id) + return info diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py index 80dcdceb7..5df423545 100644 --- a/heat_integrationtests/functional/test_template_resource.py +++ b/heat_integrationtests/functional/test_template_resource.py @@ -437,7 +437,7 @@ Outputs: stack_identifier = '%s/%s' % (stack_name, stack.id) self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') - info = self.client.stacks.abandon(stack_id=stack_identifier) + info = self.stack_abandon(stack_id=stack_identifier) self.assertEqual(self._yaml_to_json(self.main_template), info['template']) self.assertEqual(self._yaml_to_json(self.nested_templ), diff --git a/heat_integrationtests/heat_integrationtests.conf.sample b/heat_integrationtests/heat_integrationtests.conf.sample index b4021898b..0319dab40 100644 --- a/heat_integrationtests/heat_integrationtests.conf.sample +++ b/heat_integrationtests/heat_integrationtests.conf.sample @@ -69,3 +69,9 @@ # Default size in GB for volumes created by volumes tests (integer value) #volume_size = 1 + +# Skip Stack Adopt Integration tests (boolean value) +#skip_stack_adopt_tests = false + +# Skip Stack Abandon Integration tests (boolean value) +#skip_stack_abandon_tests = false