Add heat list_stack_and_events scenario
This scenario covers list heat stack events Change-Id: I5e90a373bfa8efbeecc883c9dc0863c24087d8bb
This commit is contained in:
parent
1cc98bcb49
commit
f3f45a8a89
@ -1525,3 +1525,20 @@
|
|||||||
sla:
|
sla:
|
||||||
failure_rate:
|
failure_rate:
|
||||||
max: 0
|
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
|
||||||
|
@ -149,3 +149,15 @@ class HeatStacks(utils.HeatScenario):
|
|||||||
self._suspend_stack(s)
|
self._suspend_stack(s)
|
||||||
self._resume_stack(s)
|
self._resume_stack(s)
|
||||||
self._delete_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)
|
||||||
|
21
samples/tasks/scenarios/heat/list-stack-and-event.json
Normal file
21
samples/tasks/scenarios/heat/list-stack-and-event.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
14
samples/tasks/scenarios/heat/list-stack-and-event.yaml
Normal file
14
samples/tasks/scenarios/heat/list-stack-and-event.yaml
Normal 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
|
@ -48,6 +48,17 @@ class HeatStacksTestCase(test.TestCase):
|
|||||||
self._test_atomic_action_timer(
|
self._test_atomic_action_timer(
|
||||||
heat_scenario.atomic_actions(), "heat.list_resources_of_1_stacks")
|
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 + "._generate_random_name")
|
||||||
@mock.patch(HEAT_STACKS + "._list_stacks")
|
@mock.patch(HEAT_STACKS + "._list_stacks")
|
||||||
@mock.patch(HEAT_STACKS + "._create_stack")
|
@mock.patch(HEAT_STACKS + "._create_stack")
|
||||||
|
Loading…
Reference in New Issue
Block a user