Tempest API tests on /actions
Following the blueprint tempest-basic-set-up which implemented a first batch of tests, this one adds a new set of API tests on actions. I also added extra check on actions within the dummy strategy scenario. Change-Id: Ib9bf093d0ed457ecba32e8251c019d2cf5c98128 Closes-Bug: #1538074
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import collections
|
||||
import functools
|
||||
|
||||
from tempest import test
|
||||
@@ -62,6 +63,16 @@ class TestExecuteDummyStrategy(base.BaseInfraOptimScenarioTest):
|
||||
sleep_for=.5
|
||||
))
|
||||
_, finished_ap = self.client.show_action_plan(action_plan['uuid'])
|
||||
_, action_list = self.client.list_actions(
|
||||
action_plan_uuid=finished_ap["uuid"])
|
||||
|
||||
action_counter = collections.Counter(
|
||||
act['action_type'] for act in action_list['actions'])
|
||||
|
||||
self.assertIn(updated_ap['state'], ('TRIGGERED', 'ONGOING'))
|
||||
self.assertEqual(finished_ap['state'], 'SUCCEEDED')
|
||||
|
||||
# A dummy strategy generates 2 "nop" actions and 1 "sleep" action
|
||||
self.assertEqual(len(action_list['actions']), 3)
|
||||
self.assertEqual(action_counter.get("nop"), 2)
|
||||
self.assertEqual(action_counter.get("sleep"), 1)
|
||||
|
||||
Reference in New Issue
Block a user