Added Actuator Strategy
This strategy now allow us to create action plans with an explicit set of actions. Co-Authored-By: Mikhail Kizilov <kizilov.mikhail@gmail.com> Change-Id: I7b04b9936ce5f3b5b38f319da7f8737e0f3eea88 Closes-Bug: #1659243
This commit is contained in:
committed by
Mikhail Kizilov
parent
529b0d34ee
commit
0b31828a01
@@ -70,42 +70,6 @@ class TestCreateDeleteExecuteActionPlan(base.BaseInfraOptimTest):
|
||||
self.assertRaises(exceptions.NotFound, self.client.show_action_plan,
|
||||
action_plan['uuid'])
|
||||
|
||||
@decorators.attr(type='smoke')
|
||||
def test_execute_dummy_action_plan(self):
|
||||
_, goal = self.client.show_goal("dummy")
|
||||
_, audit_template = self.create_audit_template(goal['uuid'])
|
||||
_, audit = self.create_audit(audit_template['uuid'])
|
||||
|
||||
self.assertTrue(test_utils.call_until_true(
|
||||
func=functools.partial(self.has_audit_finished, audit['uuid']),
|
||||
duration=30,
|
||||
sleep_for=.5
|
||||
))
|
||||
_, action_plans = self.client.list_action_plans(
|
||||
audit_uuid=audit['uuid'])
|
||||
action_plan = action_plans['action_plans'][0]
|
||||
|
||||
_, action_plan = self.client.show_action_plan(action_plan['uuid'])
|
||||
|
||||
if action_plan['state'] in ['SUPERSEDED', 'SUCCEEDED']:
|
||||
# This means the action plan is superseded so we cannot trigger it,
|
||||
# or it is empty.
|
||||
return
|
||||
|
||||
# Execute the action by changing its state to PENDING
|
||||
_, updated_ap = self.client.start_action_plan(action_plan['uuid'])
|
||||
|
||||
self.assertTrue(test_utils.call_until_true(
|
||||
func=functools.partial(
|
||||
self.has_action_plan_finished, action_plan['uuid']),
|
||||
duration=30,
|
||||
sleep_for=.5
|
||||
))
|
||||
_, finished_ap = self.client.show_action_plan(action_plan['uuid'])
|
||||
|
||||
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
||||
self.assertIn(finished_ap['state'], ('SUCCEEDED', 'SUPERSEDED'))
|
||||
|
||||
|
||||
class TestShowListActionPlan(base.BaseInfraOptimTest):
|
||||
"""Tests for action_plan."""
|
||||
|
||||
Reference in New Issue
Block a user