diff --git a/rally-jobs/rally.yaml b/rally-jobs/rally.yaml index 723cef856c..713413f6a7 100755 --- a/rally-jobs/rally.yaml +++ b/rally-jobs/rally.yaml @@ -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 diff --git a/rally/benchmark/scenarios/heat/stacks.py b/rally/benchmark/scenarios/heat/stacks.py index 9cebdde081..468868656e 100644 --- a/rally/benchmark/scenarios/heat/stacks.py +++ b/rally/benchmark/scenarios/heat/stacks.py @@ -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) diff --git a/samples/tasks/scenarios/heat/list-stack-and-event.json b/samples/tasks/scenarios/heat/list-stack-and-event.json new file mode 100644 index 0000000000..2e33ec29bf --- /dev/null +++ b/samples/tasks/scenarios/heat/list-stack-and-event.json @@ -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 + } + } + } + ] +} diff --git a/samples/tasks/scenarios/heat/list-stack-and-event.yaml b/samples/tasks/scenarios/heat/list-stack-and-event.yaml new file mode 100644 index 0000000000..3f4b3d0662 --- /dev/null +++ b/samples/tasks/scenarios/heat/list-stack-and-event.yaml @@ -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 diff --git a/tests/unit/benchmark/scenarios/heat/test_stacks.py b/tests/unit/benchmark/scenarios/heat/test_stacks.py index 5a0718ab14..2abb6ebc12 100644 --- a/tests/unit/benchmark/scenarios/heat/test_stacks.py +++ b/tests/unit/benchmark/scenarios/heat/test_stacks.py @@ -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") @@ -120,4 +131,4 @@ class HeatStacksTestCase(test.TestCase): mock_resume.assert_called_once_with( "fake_stack_create_suspend_resume_delete") mock_delete.assert_called_once_with( - "fake_stack_create_suspend_resume_delete") \ No newline at end of file + "fake_stack_create_suspend_resume_delete")