Assert DELETE_COMPLETE on all stack delete cleanup
Currently stacks are deleted on integration test cleanup but no
polling is done for DELETE_COMPLETE, so the test will pass even though
the stack may be in a DELETE_FAILED state.
This change uses _stack_delete for all cleanup stack deleting, which
polls for complete.
Change-Id: Ic44b27130596cf3fa8616608a091b683ea131e0b
Closes-Bug: #1486303
diff --git a/functional/test_autoscaling.py b/functional/test_autoscaling.py
index 0beefcb..1b9fe99 100644
--- a/functional/test_autoscaling.py
+++ b/functional/test_autoscaling.py
@@ -235,7 +235,7 @@
parameters={},
environment=env
)
- self.addCleanup(self.client.stacks.delete, stack_name)
+ self.addCleanup(self._stack_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_FAILED')
diff --git a/functional/test_conditional_exposure.py b/functional/test_conditional_exposure.py
index 2ab297e..99e76ee 100644
--- a/functional/test_conditional_exposure.py
+++ b/functional/test_conditional_exposure.py
@@ -16,19 +16,7 @@
from heat_integrationtests.functional import functional_base
-class ConditionalExposureTestBase(functional_base.FunctionalTestsBase):
- def setUp(self):
- super(ConditionalExposureTestBase, self).setUp()
-
- def _delete(self, stack_name):
- stacks = self.client.stacks.list()
- for s in stacks:
- if s.stack_name == stack_name:
- self._stack_delete(s.identifier)
- break
-
-
-class ServiceBasedExposureTest(ConditionalExposureTestBase):
+class ServiceBasedExposureTest(functional_base.FunctionalTestsBase):
# NOTE(pas-ha) if we ever decide to install Sahara on Heat
# functional gate, this must be changed to other not-installed
# but in principle supported service
@@ -72,7 +60,6 @@
def test_unavailable_resources_not_created(self):
stack_name = self._stack_rand_name()
- self.addCleanup(self._delete, stack_name)
ex = self.assertRaises(exc.HTTPBadRequest,
self.client.stacks.create,
stack_name=stack_name,
diff --git a/functional/test_instance_group.py b/functional/test_instance_group.py
index a8494c2..b8bcc3d 100644
--- a/functional/test_instance_group.py
+++ b/functional/test_instance_group.py
@@ -225,7 +225,7 @@
parameters={},
environment=env
)
- self.addCleanup(self.client.stacks.delete, stack_name)
+ self.addCleanup(self._stack_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_FAILED')