diff --git a/heat_integrationtests/common/test.py b/heat_integrationtests/common/test.py index 2868d0faf8..a7aa039543 100644 --- a/heat_integrationtests/common/test.py +++ b/heat_integrationtests/common/test.py @@ -352,7 +352,8 @@ class HeatIntegrationTest(testscenarios.WithScenarios, def stack_create(self, stack_name=None, template=None, files=None, parameters=None, environment=None, - expected_status='CREATE_COMPLETE', disable_rollback=True): + expected_status='CREATE_COMPLETE', disable_rollback=True, + enable_cleanup=True): name = stack_name or self._stack_rand_name() templ = template or self.template templ_files = files or {} @@ -366,7 +367,7 @@ class HeatIntegrationTest(testscenarios.WithScenarios, parameters=params, environment=env ) - if expected_status not in ['ROLLBACK_COMPLETE']: + if expected_status not in ['ROLLBACK_COMPLETE'] and enable_cleanup: self.addCleanup(self.client.stacks.delete, name) stack = self.client.stacks.get(name) diff --git a/heat_integrationtests/functional/test_autoscaling.py b/heat_integrationtests/functional/test_autoscaling.py index 489ae63eaa..301981fa81 100644 --- a/heat_integrationtests/functional/test_autoscaling.py +++ b/heat_integrationtests/functional/test_autoscaling.py @@ -183,7 +183,6 @@ class AutoscalingGroupBasicTest(AutoscalingGroupTest): 'flavor': self.conf.instance_type}} self.update_stack(stack_identifier, self.template, environment=env2, files=files) - self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE') stack = self.client.stacks.get(stack_identifier) self.assert_instance_count(stack, 5) @@ -374,7 +373,6 @@ class AutoscalingGroupUpdatePolicyTest(AutoscalingGroupTest): # test stack update self.update_stack(stack_identifier, updt_template, environment=env, files=files) - self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE') updt_stack = self.client.stacks.get(stack_identifier) # test that the launch configuration is replaced diff --git a/heat_integrationtests/functional/test_default_parameters.py b/heat_integrationtests/functional/test_default_parameters.py index 138a13ed02..00000fd905 100644 --- a/heat_integrationtests/functional/test_default_parameters.py +++ b/heat_integrationtests/functional/test_default_parameters.py @@ -68,8 +68,6 @@ outputs: self.client = self.orchestration_client def test_defaults(self): - stack_name = self._stack_rand_name() - env = {'parameters': {}, 'parameter_defaults': {}} if self.param: env['parameters'] = {'length': self.param} @@ -84,22 +82,13 @@ outputs: else: nested_template = self.nested_template - self.client.stacks.create( - stack_name=stack_name, + stack_identifier = self.stack_create( template=self.template, files={'nested_random.yaml': nested_template}, - disable_rollback=True, - parameters={}, environment=env ) - self.addCleanup(self.client.stacks.delete, stack_name) - stack = self.client.stacks.get(stack_name) - stack_identifier = '%s/%s' % (stack_name, stack.id) - - self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') - - stack = self.client.stacks.get(stack_name) + stack = self.client.stacks.get(stack_identifier) for out in stack.outputs: if out['output_key'] == 'random1': self.assertEqual(self.expect1, len(out['output_value'])) diff --git a/heat_integrationtests/functional/test_heat_autoscaling.py b/heat_integrationtests/functional/test_heat_autoscaling.py index 0e6e0cb6e1..dbe3e8fb8c 100644 --- a/heat_integrationtests/functional/test_heat_autoscaling.py +++ b/heat_integrationtests/functional/test_heat_autoscaling.py @@ -132,4 +132,3 @@ resources: 'scaling_adjustment: 2') self.update_stack(stack_identifier, template=new_template) - self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE') diff --git a/heat_integrationtests/functional/test_instance_group.py b/heat_integrationtests/functional/test_instance_group.py index 5c88bedf37..1455d0b283 100644 --- a/heat_integrationtests/functional/test_instance_group.py +++ b/heat_integrationtests/functional/test_instance_group.py @@ -174,7 +174,6 @@ class InstanceGroupBasicTest(InstanceGroupTest): 'flavor': self.conf.instance_type}} self.update_stack(stack_identifier, self.template, environment=env2, files=files) - self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE') stack = self.client.stacks.get(stack_identifier) self.assert_instance_count(stack, 5) @@ -345,7 +344,6 @@ class InstanceGroupUpdatePolicyTest(InstanceGroupTest): # test stack update self.update_stack(stack_identifier, updt_template, environment=env, files=files) - self._wait_for_stack_status(stack_identifier, 'UPDATE_COMPLETE') updt_stack = self.client.stacks.get(stack_identifier) # test that the launch configuration is replaced diff --git a/heat_integrationtests/functional/test_notifications.py b/heat_integrationtests/functional/test_notifications.py index a9b6cf18db..a4c419c244 100644 --- a/heat_integrationtests/functional/test_notifications.py +++ b/heat_integrationtests/functional/test_notifications.py @@ -141,17 +141,9 @@ outputs: return len(handler.notifications) == count def test_basic_notifications(self): - stack_identifier = self._stack_rand_name() - # do this manually so we can call _stack_delete() directly. - self.client.stacks.create( - stack_name=stack_identifier, - template=self.basic_template, - files={}, - disable_rollback=True, - parameters={}, - environment={} - ) - self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') + # disable cleanup so we can call _stack_delete() directly. + stack_identifier = self.stack_create(template=self.basic_template, + enable_cleanup=False) self.update_stack(stack_identifier, template=self.update_basic_template) self.stack_suspend(stack_identifier) diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py index 392bdddd1b..356fc2abd3 100644 --- a/heat_integrationtests/functional/test_template_resource.py +++ b/heat_integrationtests/functional/test_template_resource.py @@ -102,17 +102,12 @@ resource_registry: This tests that if you manually delete a nested stack, the parent stack is still deletable. """ - name = self._stack_rand_name() - # do this manually so we can call _stack_delete() directly. - self.client.stacks.create( - stack_name=name, + # disable cleanup so we can call _stack_delete() directly. + stack_identifier = self.stack_create( template=self.template, files={'nested.yaml': self.nested_templ}, environment=self.env_templ, - disable_rollback=True) - stack = self.client.stacks.get(name) - stack_identifier = '%s/%s' % (name, stack.id) - self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') + enable_cleanup=False) nested_ident = self.assert_resource_is_a_stack(stack_identifier, 'secret1') @@ -445,16 +440,11 @@ Outputs: return yaml.load(yaml_templ) def test_abandon(self): - stack_name = self._stack_rand_name() - self.client.stacks.create( - stack_name=stack_name, + stack_identifier = self.stack_create( template=self.main_template, files={'the.yaml': self.nested_templ}, - disable_rollback=True, + enable_cleanup=False ) - stack = self.client.stacks.get(stack_name) - stack_identifier = '%s/%s' % (stack_name, stack.id) - self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') info = self.stack_abandon(stack_id=stack_identifier) self.assertEqual(self._yaml_to_json(self.main_template), @@ -527,16 +517,10 @@ Outputs: self.client = self.orchestration_client def test_check(self): - stack_name = self._stack_rand_name() - self.client.stacks.create( - stack_name=stack_name, + stack_identifier = self.stack_create( template=self.main_template, - files={'the.yaml': self.nested_templ}, - disable_rollback=True, + files={'the.yaml': self.nested_templ} ) - stack = self.client.stacks.get(stack_name) - stack_identifier = '%s/%s' % (stack_name, stack.id) - self._wait_for_stack_status(stack_identifier, 'CREATE_COMPLETE') self.client.actions.check(stack_id=stack_identifier) self._wait_for_stack_status(stack_identifier, 'CHECK_COMPLETE') diff --git a/heat_integrationtests/scenario/test_server_cfn_init.py b/heat_integrationtests/scenario/test_server_cfn_init.py index a49606c95e..81347133d8 100644 --- a/heat_integrationtests/scenario/test_server_cfn_init.py +++ b/heat_integrationtests/scenario/test_server_cfn_init.py @@ -47,9 +47,6 @@ class CfnInitIntegrationTest(scenario_base.ScenarioTestsBase): # logs to be compared self._log_console_output(servers=[server]) - # Check stack status - self._wait_for_stack_status(sid, 'CREATE_COMPLETE') - stack = self.client.stacks.get(sid) # This is an assert of great significance, as it means the following diff --git a/heat_integrationtests/scenario/test_server_software_config.py b/heat_integrationtests/scenario/test_server_software_config.py index 8b614c1d88..19fd1a8613 100644 --- a/heat_integrationtests/scenario/test_server_software_config.py +++ b/heat_integrationtests/scenario/test_server_software_config.py @@ -84,9 +84,6 @@ class SoftwareConfigIntegrationTest(scenario_base.ScenarioTestsBase): # logs to be compared self._log_console_output(servers=[server]) - # Check that stack was fully created - self._wait_for_stack_status(sid, 'CREATE_COMPLETE') - complete_server_metadata = self.client.resources.metadata( sid, 'server') diff --git a/heat_integrationtests/scenario/test_volumes.py b/heat_integrationtests/scenario/test_volumes.py index 79d49314a6..7562304e98 100644 --- a/heat_integrationtests/scenario/test_volumes.py +++ b/heat_integrationtests/scenario/test_volumes.py @@ -61,8 +61,7 @@ class VolumeBackupRestoreIntegrationTest(scenario_base.ScenarioTestsBase): # Delete the stack and ensure a backup is created for volume_id # but the volume itself is gone - self.client.stacks.delete(stack_id) - self._wait_for_stack_status(stack_id, 'DELETE_COMPLETE') + self._stack_delete(stack_id) self.assertRaises(cinder_exceptions.NotFound, self.volume_client.volumes.get, volume_id) @@ -97,8 +96,7 @@ class VolumeBackupRestoreIntegrationTest(scenario_base.ScenarioTestsBase): testfile_data) # Delete the stack and ensure the volume is gone - self.client.stacks.delete(stack_identifier2) - self._wait_for_stack_status(stack_identifier2, 'DELETE_COMPLETE') + self._stack_delete(stack_identifier2) self.assertRaises(cinder_exceptions.NotFound, self.volume_client.volumes.get, volume_id2)