Merge "Skip Stack Adopt/Abandon integration tests when Stack Adopt is disabled"

This commit is contained in:
Jenkins 2015-02-13 08:40:18 +00:00 committed by Gerrit Code Review
commit aceae591a8
4 changed files with 22 additions and 1 deletions

View File

@ -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"),
]

View File

@ -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

View File

@ -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),

View File

@ -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