Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
982410dd3e |
@@ -142,6 +142,10 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
|
|||||||
resp, _ = self.client.delete_audit(audit_uuid)
|
resp, _ = self.client.delete_audit(audit_uuid)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
def has_audit_succeeded(self, audit_uuid):
|
||||||
|
_, audit = self.client.show_audit(audit_uuid)
|
||||||
|
return audit.get('state') == 'SUCCEEDED'
|
||||||
|
|
||||||
# ### ACTION PLANS ### #
|
# ### ACTION PLANS ### #
|
||||||
|
|
||||||
def delete_action_plan(self, action_plan_uuid):
|
def delete_action_plan(self, action_plan_uuid):
|
||||||
@@ -152,3 +156,7 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
|
|||||||
"""
|
"""
|
||||||
resp, _ = self.client.delete_action_plan(action_plan_uuid)
|
resp, _ = self.client.delete_action_plan(action_plan_uuid)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
def has_action_plan_finished(self, action_plan_uuid):
|
||||||
|
_, action_plan = self.client.show_action_plan(action_plan_uuid)
|
||||||
|
return action_plan.get('state') in ('FAILED', 'SUCCEEDED', 'CANCELLED')
|
||||||
|
|||||||
@@ -55,11 +55,9 @@ class TestExecuteDummyStrategy(base.BaseInfraOptimScenarioTest):
|
|||||||
patch=[{'path': '/state', 'op': 'replace', 'value': 'TRIGGERED'}]
|
patch=[{'path': '/state', 'op': 'replace', 'value': 'TRIGGERED'}]
|
||||||
)
|
)
|
||||||
|
|
||||||
def has_finished(action_plan_uuid):
|
|
||||||
return self.has_action_plan_finished(action_plan_uuid)
|
|
||||||
|
|
||||||
self.assertTrue(test.call_until_true(
|
self.assertTrue(test.call_until_true(
|
||||||
func=functools.partial(has_finished, action_plan['uuid']),
|
func=functools.partial(
|
||||||
|
self.has_action_plan_finished, action_plan['uuid']),
|
||||||
duration=30,
|
duration=30,
|
||||||
sleep_for=.5
|
sleep_for=.5
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user