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/common/test.py b/common/test.py
index 386ed59..1039625 100644
--- a/common/test.py
+++ b/common/test.py
@@ -426,7 +426,7 @@
tags=tags
)
if expected_status not in ['ROLLBACK_COMPLETE'] and enable_cleanup:
- self.addCleanup(self.client.stacks.delete, name)
+ self.addCleanup(self._stack_delete, name)
stack = self.client.stacks.get(name)
stack_identifier = '%s/%s' % (name, stack.id)
@@ -458,7 +458,7 @@
environment=env,
adopt_stack_data=adopt_data,
)
- self.addCleanup(self.client.stacks.delete, name)
+ self.addCleanup(self._stack_delete, name)
stack = self.client.stacks.get(name)
stack_identifier = '%s/%s' % (name, stack.id)
@@ -468,7 +468,7 @@
def stack_abandon(self, stack_id):
if (self.conf.skip_test_stack_action_list and
'ABANDON' in self.conf.skip_test_stack_action_list):
- self.addCleanup(self.client.stacks.delete, stack_id)
+ self.addCleanup(self._stack_delete, stack_id)
self.skipTest('Testing Stack abandon disabled in conf, skipping')
info = self.client.stacks.abandon(stack_id=stack_id)
return info
@@ -476,7 +476,7 @@
def stack_suspend(self, stack_identifier):
if (self.conf.skip_test_stack_action_list and
'SUSPEND' in self.conf.skip_test_stack_action_list):
- self.addCleanup(self.client.stacks.delete, stack_identifier)
+ self.addCleanup(self._stack_delete, stack_identifier)
self.skipTest('Testing Stack suspend disabled in conf, skipping')
stack_name = stack_identifier.split('/')[0]
self.client.actions.suspend(stack_name)
@@ -488,7 +488,7 @@
def stack_resume(self, stack_identifier):
if (self.conf.skip_test_stack_action_list and
'RESUME' in self.conf.skip_test_stack_action_list):
- self.addCleanup(self.client.stacks.delete, stack_identifier)
+ self.addCleanup(self._stack_delete, stack_identifier)
self.skipTest('Testing Stack resume disabled in conf, skipping')
stack_name = stack_identifier.split('/')[0]
self.client.actions.resume(stack_name)