Add heat list_stack_and_events scenario

This scenario covers list heat stack events

Change-Id: I5e90a373bfa8efbeecc883c9dc0863c24087d8bb
This commit is contained in:
Pradeep K Surisetty 2015-04-07 08:47:10 +05:30
parent 1cc98bcb49
commit f3f45a8a89
5 changed files with 76 additions and 1 deletions

View File

@ -1525,3 +1525,20 @@
sla:
failure_rate:
max: 0
HeatStacks.list_stacks_and_events:
-
runner:
type: "constant"
times: 6
concurrency: 3
context:
users:
tenants: 2
users_per_tenant: 3
stacks:
stacks_per_tenant: 2
resources_per_stack: 10
sla:
failure_rate:
max: 0

View File

@ -149,3 +149,15 @@ class HeatStacks(utils.HeatScenario):
self._suspend_stack(s)
self._resume_stack(s)
self._delete_stack(s)
@validation.required_services(consts.Service.HEAT)
@validation.required_openstack(users=True)
@base.scenario()
def list_stacks_and_events(self):
"""List events from tenant stacks."""
stacks = self._list_stacks()
with base.AtomicAction(
self, "heat.list_events_of_%s_stacks" % len(stacks)):
for stack in stacks:
self.clients("heat").events.list(stack.id)

View File

@ -0,0 +1,21 @@
{
"HeatStacks.list_stacks_and_events": [
{
"runner": {
"type": "constant",
"times": 10,
"concurrency": 1
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
},
"stacks": {
"stacks_per_tenant": 2,
"resources_per_stack": 10
}
}
}
]
}

View File

@ -0,0 +1,14 @@
---
HeatStacks.list_stacks_and_events:
-
runner:
type: "constant"
times: 10
concurrency: 1
context:
users:
tenants: 1
users_per_tenant: 1
stacks:
stacks_per_tenant: 2
resources_per_stack: 10

View File

@ -48,6 +48,17 @@ class HeatStacksTestCase(test.TestCase):
self._test_atomic_action_timer(
heat_scenario.atomic_actions(), "heat.list_resources_of_1_stacks")
@mock.patch(HEAT_STACKS + ".clients")
@mock.patch(HEAT_STACKS + "._list_stacks")
def test_list_stack_and_events(self, mock_list_stack, mock_clients):
stack = mock.Mock()
mock_list_stack.return_value = [stack]
heat_scenario = stacks.HeatStacks()
heat_scenario.list_stacks_and_events()
mock_clients("heat").events.list.assert_called_once_with(stack.id)
self._test_atomic_action_timer(
heat_scenario.atomic_actions(), "heat.list_events_of_1_stacks")
@mock.patch(HEAT_STACKS + "._generate_random_name")
@mock.patch(HEAT_STACKS + "._list_stacks")
@mock.patch(HEAT_STACKS + "._create_stack")