Add keystone validate token using ceilometer scenario

Change-Id: I2d6220f2ac6149e1177d8fc324f4cfd541d41ae3
This commit is contained in:
Alex Krzos 2016-06-28 18:39:44 -04:00
parent 57ca3f43d1
commit 66e7722138
5 changed files with 76 additions and 0 deletions

View File

@ -705,6 +705,22 @@
failure_rate: failure_rate:
max: 0 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: Authenticate.validate_glance:
- -
args: args:

View File

@ -68,6 +68,24 @@ class Authenticate(scenario.OpenStackScenario):
for i in range(repetitions): for i in range(repetitions):
nova_client.flavors.list() 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.number("repetitions", minval=1)
@validation.required_openstack(users=True) @validation.required_openstack(users=True)
@scenario.configure() @scenario.configure()

View File

@ -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
}
}
}
]
}

View File

@ -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

View File

@ -56,6 +56,15 @@ class AuthenticateTestCase(test.ScenarioTestCase):
self._test_atomic_action_timer(scenario_inst.atomic_actions(), self._test_atomic_action_timer(scenario_inst.atomic_actions(),
"authenticate.validate_nova_5_times") "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): def test_validate_cinder(self):
scenario_inst = authenticate.Authenticate() scenario_inst = authenticate.Authenticate()
scenario_inst.validate_cinder(5) scenario_inst.validate_cinder(5)