Fixed tempest test bug
has_audit_succeeded was not implemented so I added it back. Change-Id: Ic567ff56ea6d513c32fbe7ad08cca96b5dfb15e8 Closes-Bug: #1537144
This commit is contained in:
parent
83fdbf7366
commit
982410dd3e
|
@ -142,6 +142,10 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
|
|||
resp, _ = self.client.delete_audit(audit_uuid)
|
||||
return resp
|
||||
|
||||
def has_audit_succeeded(self, audit_uuid):
|
||||
_, audit = self.client.show_audit(audit_uuid)
|
||||
return audit.get('state') == 'SUCCEEDED'
|
||||
|
||||
# ### ACTION PLANS ### #
|
||||
|
||||
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)
|
||||
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'}]
|
||||
)
|
||||
|
||||
def has_finished(action_plan_uuid):
|
||||
return self.has_action_plan_finished(action_plan_uuid)
|
||||
|
||||
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,
|
||||
sleep_for=.5
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue