Merge "Add action plan SUPERSEDED state"
This commit is contained in:
@@ -28,7 +28,7 @@ class BaseInfraOptimTest(test.BaseTestCase):
|
|||||||
# States where the object is waiting for some event to perform a transition
|
# States where the object is waiting for some event to perform a transition
|
||||||
IDLE_STATES = ('RECOMMENDED', 'FAILED', 'SUCCEEDED', 'CANCELLED')
|
IDLE_STATES = ('RECOMMENDED', 'FAILED', 'SUCCEEDED', 'CANCELLED')
|
||||||
# States where the object can only be DELETED (end of its life-cycle)
|
# States where the object can only be DELETED (end of its life-cycle)
|
||||||
FINISHED_STATES = ('FAILED', 'SUCCEEDED', 'CANCELLED')
|
FINISHED_STATES = ('FAILED', 'SUCCEEDED', 'CANCELLED', 'SUPERSEDED')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_credentials(cls):
|
def setup_credentials(cls):
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class TestCreateDeleteExecuteActionPlan(base.BaseInfraOptimTest):
|
|||||||
_, finished_ap = self.client.show_action_plan(action_plan['uuid'])
|
_, finished_ap = self.client.show_action_plan(action_plan['uuid'])
|
||||||
|
|
||||||
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
||||||
self.assertEqual('SUCCEEDED', finished_ap['state'])
|
self.assertIn(finished_ap['state'], ('SUCCEEDED', 'SUPERSEDED'))
|
||||||
|
|
||||||
|
|
||||||
class TestShowListActionPlan(base.BaseInfraOptimTest):
|
class TestShowListActionPlan(base.BaseInfraOptimTest):
|
||||||
|
|||||||
@@ -155,4 +155,5 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
|
|||||||
|
|
||||||
def has_action_plan_finished(self, action_plan_uuid):
|
def has_action_plan_finished(self, action_plan_uuid):
|
||||||
_, action_plan = self.client.show_action_plan(action_plan_uuid)
|
_, action_plan = self.client.show_action_plan(action_plan_uuid)
|
||||||
return action_plan.get('state') in ('FAILED', 'SUCCEEDED', 'CANCELLED')
|
return action_plan.get('state') in ('FAILED', 'SUCCEEDED', 'CANCELLED',
|
||||||
|
'SUPERSEDED')
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class TestExecuteBasicStrategy(base.BaseInfraOptimScenarioTest):
|
|||||||
action_plan_uuid=finished_ap["uuid"])
|
action_plan_uuid=finished_ap["uuid"])
|
||||||
|
|
||||||
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
||||||
self.assertEqual('SUCCEEDED', finished_ap['state'])
|
self.assertIn(finished_ap['state'], ('SUCCEEDED', 'SUPERSEDED'))
|
||||||
|
|
||||||
for action in action_list['actions']:
|
for action in action_list['actions']:
|
||||||
self.assertEqual('SUCCEEDED', action.get('state'))
|
self.assertEqual('SUCCEEDED', action.get('state'))
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class TestExecuteDummyStrategy(base.BaseInfraOptimScenarioTest):
|
|||||||
act['action_type'] for act in action_list['actions'])
|
act['action_type'] for act in action_list['actions'])
|
||||||
|
|
||||||
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
||||||
self.assertEqual('SUCCEEDED', finished_ap['state'])
|
self.assertIn(finished_ap['state'], ('SUCCEEDED', 'SUPERSEDED'))
|
||||||
|
|
||||||
# A dummy strategy generates 2 "nop" actions and 1 "sleep" action
|
# A dummy strategy generates 2 "nop" actions and 1 "sleep" action
|
||||||
self.assertEqual(3, len(action_list['actions']))
|
self.assertEqual(3, len(action_list['actions']))
|
||||||
|
|||||||
Reference in New Issue
Block a user