Add action plan SUPERSEDED state
An action plan can be now go to SUPERSEDED state if another action plan is on going for instance. It could be the case with tempest test, because we can have several scenario tests running at the same time. Change-Id: I5449e545676463f0ea601e67993e9dffa67929a7 Closes-bug: #1657031
This commit is contained in:
parent
fc9eb6e995
commit
a48a16596f
@ -28,7 +28,7 @@ class BaseInfraOptimTest(test.BaseTestCase):
|
||||
# States where the object is waiting for some event to perform a transition
|
||||
IDLE_STATES = ('RECOMMENDED', 'FAILED', 'SUCCEEDED', 'CANCELLED')
|
||||
# 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
|
||||
def setup_credentials(cls):
|
||||
|
@ -101,7 +101,7 @@ class TestCreateDeleteExecuteActionPlan(base.BaseInfraOptimTest):
|
||||
_, finished_ap = self.client.show_action_plan(action_plan['uuid'])
|
||||
|
||||
self.assertIn(updated_ap['state'], ('PENDING', 'ONGOING'))
|
||||
self.assertEqual('SUCCEEDED', finished_ap['state'])
|
||||
self.assertIn(finished_ap['state'], ('SUCCEEDED', 'SUPERSEDED'))
|
||||
|
||||
|
||||
class TestShowListActionPlan(base.BaseInfraOptimTest):
|
||||
|
@ -155,4 +155,5 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
|
||||
|
||||
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')
|
||||
return action_plan.get('state') in ('FAILED', 'SUCCEEDED', 'CANCELLED',
|
||||
'SUPERSEDED')
|
||||
|
@ -175,7 +175,7 @@ class TestExecuteBasicStrategy(base.BaseInfraOptimScenarioTest):
|
||||
action_plan_uuid=finished_ap["uuid"])
|
||||
|
||||
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']:
|
||||
self.assertEqual('SUCCEEDED', action.get('state'))
|
||||
|
@ -72,7 +72,7 @@ class TestExecuteDummyStrategy(base.BaseInfraOptimScenarioTest):
|
||||
act['action_type'] for act in action_list['actions'])
|
||||
|
||||
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
|
||||
self.assertEqual(3, len(action_list['actions']))
|
||||
|
Loading…
Reference in New Issue
Block a user