diff --git a/rally-jobs/rally-keystone-api-v2.yaml b/rally-jobs/rally-keystone-api-v2.yaml index 3adeb10583..ed94e27077 100644 --- a/rally-jobs/rally-keystone-api-v2.yaml +++ b/rally-jobs/rally-keystone-api-v2.yaml @@ -705,6 +705,22 @@ failure_rate: max: 0 + Authenticate.validate_ceilometer: + - + args: + repetitions: 2 + runner: + type: "constant" + times: 10 + concurrency: 5 + context: + users: + tenants: 3 + users_per_tenant: 5 + sla: + failure_rate: + max: 0 + Authenticate.validate_glance: - args: diff --git a/rally/plugins/openstack/scenarios/authenticate/authenticate.py b/rally/plugins/openstack/scenarios/authenticate/authenticate.py index 89632b91bd..65a85b8704 100644 --- a/rally/plugins/openstack/scenarios/authenticate/authenticate.py +++ b/rally/plugins/openstack/scenarios/authenticate/authenticate.py @@ -68,6 +68,24 @@ class Authenticate(scenario.OpenStackScenario): for i in range(repetitions): nova_client.flavors.list() + @validation.number("repetitions", minval=1) + @validation.required_openstack(users=True) + @scenario.configure() + def validate_ceilometer(self, repetitions): + """Check Ceilometer Client to ensure validation of token. + + Creation of the client does not ensure validation of the token. + We have to do some minimal operation to make sure token gets validated. + + :param repetitions: number of times to validate + """ + ceilometer_client = self.clients("ceilometer") + with atomic.ActionTimer(self, + "authenticate.validate_ceilometer_%s_times" + % repetitions): + for i in range(repetitions): + ceilometer_client.meters.list() + @validation.number("repetitions", minval=1) @validation.required_openstack(users=True) @scenario.configure() diff --git a/samples/tasks/scenarios/authenticate/token-validate-ceilometer.json b/samples/tasks/scenarios/authenticate/token-validate-ceilometer.json new file mode 100644 index 0000000000..d915cc1d6d --- /dev/null +++ b/samples/tasks/scenarios/authenticate/token-validate-ceilometer.json @@ -0,0 +1,20 @@ +{ + "Authenticate.validate_ceilometer": [ + { + "args": { + "repetitions": 2 + }, + "runner": { + "type": "constant", + "times": 10, + "concurrency": 5 + }, + "context": { + "users": { + "tenants": 3, + "users_per_tenant": 5 + } + } + } + ] +} diff --git a/samples/tasks/scenarios/authenticate/token-validate-ceilometer.yaml b/samples/tasks/scenarios/authenticate/token-validate-ceilometer.yaml new file mode 100644 index 0000000000..474150e2f3 --- /dev/null +++ b/samples/tasks/scenarios/authenticate/token-validate-ceilometer.yaml @@ -0,0 +1,13 @@ +--- + Authenticate.validate_ceilometer: + - + args: + repetitions: 2 + runner: + type: "constant" + times: 10 + concurrency: 5 + context: + users: + tenants: 3 + users_per_tenant: 5 diff --git a/tests/unit/plugins/openstack/scenarios/authenticate/test_authenticate.py b/tests/unit/plugins/openstack/scenarios/authenticate/test_authenticate.py index aa1f6849cc..5b4256a382 100644 --- a/tests/unit/plugins/openstack/scenarios/authenticate/test_authenticate.py +++ b/tests/unit/plugins/openstack/scenarios/authenticate/test_authenticate.py @@ -56,6 +56,15 @@ class AuthenticateTestCase(test.ScenarioTestCase): self._test_atomic_action_timer(scenario_inst.atomic_actions(), "authenticate.validate_nova_5_times") + def test_validate_ceilometer(self): + scenario_inst = authenticate.Authenticate() + scenario_inst.validate_ceilometer(5) + self.clients("ceilometer").meters.list.assert_has_calls( + [mock.call()] * 5) + self._test_atomic_action_timer( + scenario_inst.atomic_actions(), + "authenticate.validate_ceilometer_5_times") + def test_validate_cinder(self): scenario_inst = authenticate.Authenticate() scenario_inst.validate_cinder(5)