Fix Ceilometer scenarios against Keystone API v3

Enable Ceilometer scenarios in gate job against API v3
Enable Keystone scenarios suitable for v3 API

Change-Id: I16d2b3c28260964a8cd298b43ca69386aeced2eb
This commit is contained in:
Illia Khudoshyn 2016-02-03 11:58:11 +00:00
parent aa2fdbfc8d
commit 4010d9d624
3 changed files with 289 additions and 277 deletions

View File

@ -1,26 +1,26 @@
{%- set cirros_image_url = "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img" %}
---
#KeystoneBasic.create_user:
#-
#args: {}
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_user:
-
args: {}
runner:
type: "constant"
times: 10
concurrency: 10
sla:
failure_rate:
max: 0
#KeystoneBasic.create_delete_user:
#-
#args: {}
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_delete_user:
-
args: {}
runner:
type: "constant"
times: 10
concurrency: 10
sla:
failure_rate:
max: 0
#KeystoneBasic.create_user_set_enabled_and_delete:
#-
@ -99,15 +99,15 @@
#failure_rate:
#max: 0
#KeystoneBasic.create_and_delete_role:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 5
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_and_delete_role:
-
runner:
type: "constant"
times: 10
concurrency: 5
sla:
failure_rate:
max: 0
#KeystoneBasic.create_add_and_list_user_roles:
#-
@ -123,16 +123,16 @@
#failure_rate:
#max: 0
#KeystoneBasic.create_and_list_users:
#-
#args: {}
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_and_list_users:
-
args: {}
runner:
type: "constant"
times: 10
concurrency: 10
sla:
failure_rate:
max: 0
#KeystoneBasic.create_tenant:
#-
@ -160,16 +160,16 @@
#failure_rate:
#max: 0
#KeystoneBasic.create_user_update_password:
#-
#args: {}
#runner:
#type: "constant"
#times: 10
#concurrency: 5
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_user_update_password:
-
args: {}
runner:
type: "constant"
times: 10
concurrency: 5
sla:
failure_rate:
max: 0
#KeystoneBasic.create_update_and_delete_tenant:
#-
@ -213,179 +213,179 @@
#failure_rate:
#max: 0
#KeystoneBasic.create_and_list_ec2credentials:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 5
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_and_list_ec2credentials:
-
runner:
type: "constant"
times: 10
concurrency: 5
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#KeystoneBasic.create_and_delete_ec2credential:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 5
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
KeystoneBasic.create_and_delete_ec2credential:
-
runner:
type: "constant"
times: 10
concurrency: 5
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerEvents.create_user_and_get_event:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
CeilometerEvents.create_user_and_get_event:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerEvents.create_user_and_list_event_types:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
CeilometerEvents.create_user_and_list_event_types:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerEvents.create_user_and_list_events:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
CeilometerEvents.create_user_and_list_events:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerTraits.create_user_and_list_trait_descriptions:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
CeilometerTraits.create_user_and_list_trait_descriptions:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerTraits.create_user_and_list_traits:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#sla:
#failure_rate:
#max: 0
CeilometerTraits.create_user_and_list_traits:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 2
users_per_tenant: 2
sla:
failure_rate:
max: 0
#CeilometerMeters.list_meters:
#-
#runner:
#type: constant
#times: 10
#concurrency: 2
#context:
#users:
#tenants: 1
#users_per_tenant: 1
#ceilometer:
#counter_name: "benchmark_meter"
#counter_type: "gauge"
#counter_unit: "%"
#counter_volume: 100
#resources_per_tenant: 1
#samples_per_resource: 1
#timestamp_interval: 1
#sla:
#failure_rate:
#max: 0
CeilometerMeters.list_meters:
-
runner:
type: constant
times: 10
concurrency: 2
context:
users:
tenants: 1
users_per_tenant: 1
ceilometer:
counter_name: "benchmark_meter"
counter_type: "gauge"
counter_unit: "%"
counter_volume: 100
resources_per_tenant: 1
samples_per_resource: 1
timestamp_interval: 1
sla:
failure_rate:
max: 0
#CeilometerResource.list_resources:
#-
#runner:
#type: constant
#times: 10
#concurrency: 2
#context:
#users:
#tenants: 1
#users_per_tenant: 1
#ceilometer:
#counter_name: "benchmark_meter"
#counter_type: "gauge"
#counter_unit: "%"
#counter_volume: 100
#resources_per_tenant: 1
#samples_per_resource: 1
#timestamp_interval: 1
#sla:
#failure_rate:
#max: 0
CeilometerResource.list_resources:
-
runner:
type: constant
times: 10
concurrency: 2
context:
users:
tenants: 1
users_per_tenant: 1
ceilometer:
counter_name: "benchmark_meter"
counter_type: "gauge"
counter_unit: "%"
counter_volume: 100
resources_per_tenant: 1
samples_per_resource: 1
timestamp_interval: 1
sla:
failure_rate:
max: 0
#CeilometerSamples.list_samples:
#-
#runner:
#type: "constant"
#times: 10
#concurrency: 10
#context:
#users:
#tenants: 1
#users_per_tenant: 1
#ceilometer:
#counter_name: "cpu_util"
#counter_type: "gauge"
#counter_unit: "instance"
#counter_volume: 1.0
#resources_per_tenant: 3
#samples_per_resource: 10
#timestamp_interval: 60
#metadata_list:
#- status: "active"
#name: "fake_resource"
#deleted: "False"
#created_at: "2015-09-04T12:34:19.000000"
#- status: "not_active"
#name: "fake_resource_1"
#deleted: "False"
#created_at: "2015-09-10T06:55:12.000000"
#batch_size: 5
#sla:
#failure_rate:
#max: 0
CeilometerSamples.list_samples:
-
runner:
type: "constant"
times: 10
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1
ceilometer:
counter_name: "cpu_util"
counter_type: "gauge"
counter_unit: "instance"
counter_volume: 1.0
resources_per_tenant: 3
samples_per_resource: 10
timestamp_interval: 60
metadata_list:
- status: "active"
name: "fake_resource"
deleted: "False"
created_at: "2015-09-04T12:34:19.000000"
- status: "not_active"
name: "fake_resource_1"
deleted: "False"
created_at: "2015-09-10T06:55:12.000000"
batch_size: 5
sla:
failure_rate:
max: 0
Dummy.dummy:
-
@ -628,68 +628,68 @@
failure_rate:
max: 0
#CeilometerStats.get_stats:
#-
#runner:
#type: constant
#times: 10
#concurrency: 2
#context:
#users:
#tenants: 2
#users_per_tenant: 2
#ceilometer:
#counter_name: "benchmark_meter"
#counter_type: "gauge"
#counter_unit: "%"
#counter_volume: 100
#resources_per_tenant: 100
#samples_per_resource: 100
#timestamp_interval: 10
#metadata_list:
#-
#status: "active"
#name: "rally benchmark on"
#deleted: "false"
#-
#status: "terminated"
#name: "rally benchmark off"
#deleted: "true"
#args:
#meter_name: "benchmark_meter"
#filter_by_user_id: true
#filter_by_project_id: true
#filter_by_resource_id: true
#metadata_query:
#status: "terminated"
#period: 300
#groupby: "resource_id"
#sla:
#failure_rate:
#max: 0
CeilometerStats.get_stats:
-
runner:
type: constant
times: 10
concurrency: 2
context:
users:
tenants: 2
users_per_tenant: 2
ceilometer:
counter_name: "benchmark_meter"
counter_type: "gauge"
counter_unit: "%"
counter_volume: 100
resources_per_tenant: 100
samples_per_resource: 100
timestamp_interval: 10
metadata_list:
-
status: "active"
name: "rally benchmark on"
deleted: "false"
-
status: "terminated"
name: "rally benchmark off"
deleted: "true"
args:
meter_name: "benchmark_meter"
filter_by_user_id: true
filter_by_project_id: true
filter_by_resource_id: true
metadata_query:
status: "terminated"
period: 300
groupby: "resource_id"
sla:
failure_rate:
max: 0
#CeilometerQueries.create_and_query_samples:
#-
#args:
#filter: {"=": {"counter_unit": "instance"}}
#orderby: !!null
#limit: 10
#counter_name: "cpu_util"
#counter_type: "gauge"
#counter_unit: "instance"
#counter_volume: "1.0"
#resource_id: "resource_id"
#runner:
#type: "constant"
#times: 20
#concurrency: 10
#context:
#users:
#tenants: 1
#users_per_tenant: 1
#sla:
#failure_rate:
#max: 0
CeilometerQueries.create_and_query_samples:
-
args:
filter: {"=": {"counter_unit": "instance"}}
orderby: !!null
limit: 10
counter_name: "cpu_util"
counter_type: "gauge"
counter_unit: "instance"
counter_volume: "1.0"
resource_id: "resource_id"
runner:
type: "constant"
times: 20
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
Authenticate.keystone:
-

View File

@ -166,7 +166,10 @@ class OSClient(plugin.Plugin):
def _get_auth_info(self, user_key="username",
password_key="password",
auth_url_key="auth_url",
project_name_key="project_id"
project_name_key="project_id",
domain_name_key="domain_name",
user_domain_name_key="user_domain_name",
project_domain_name_key="project_domain_name"
):
kw = {
user_key: self.credential.username,
@ -175,6 +178,15 @@ class OSClient(plugin.Plugin):
}
if project_name_key:
kw.update({project_name_key: self.credential.tenant_name})
if "v2.0" not in self.credential.auth_url:
kw.update({
domain_name_key: self.credential.domain_name})
kw.update({
user_domain_name_key: self.credential.user_domain_name})
kw.update({
project_domain_name_key: self.credential.project_domain_name})
return kw
@abc.abstractmethod

View File

@ -157,8 +157,8 @@ class OSClientsTestCase(test.TestCase):
def setUp(self):
super(OSClientsTestCase, self).setUp()
self.credential = objects.Credential("http://auth_url", "use", "pass",
"tenant")
self.credential = objects.Credential("http://auth_url/v2.0", "use",
"pass", "tenant")
self.clients = osclients.Clients(self.credential, {})
self.fake_keystone = fakes.FakeKeystoneClient()