From aba03a50258dca2ce489457d7f6803835a77e7d3 Mon Sep 17 00:00:00 2001 From: Serhii Vasheka Date: Wed, 25 Mar 2015 17:54:14 +0200 Subject: [PATCH] Add keystone create_update_and_delete_tenant scenario API covered tenants.create, tenants.update, tenants.delete Change-Id: Icd245d3c95ac1c8fef96665321ac5d8dc0813f17 --- rally-jobs/rally.yaml | 12 ++++++++++++ .../keystone/create-update-and-delete-tenant.json | 14 ++++++++++++++ .../keystone/create-update-and-delete-tenant.yaml | 9 +++++++++ tests/unit/fakes.py | 8 ++++++++ 4 files changed, 43 insertions(+) create mode 100644 samples/tasks/scenarios/keystone/create-update-and-delete-tenant.json create mode 100644 samples/tasks/scenarios/keystone/create-update-and-delete-tenant.yaml diff --git a/rally-jobs/rally.yaml b/rally-jobs/rally.yaml index 723cef85..7879d5b0 100755 --- a/rally-jobs/rally.yaml +++ b/rally-jobs/rally.yaml @@ -86,6 +86,18 @@ failure_rate: max: 0 + KeystoneBasic.create_update_and_delete_tenant: + - + args: + name_length: 10 + runner: + type: "constant" + times: 10 + concurrency: 5 + sla: + failure_rate: + max: 0 + KeystoneBasic.create_delete_user: - args: diff --git a/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.json b/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.json new file mode 100644 index 00000000..a2b36f28 --- /dev/null +++ b/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.json @@ -0,0 +1,14 @@ +{ + "KeystoneBasic.create_update_and_delete_tenant": [ + { + "args": { + "name_length": 10 + }, + "runner": { + "type": "constant", + "times": 100, + "concurrency": 10 + } + } + ] +} diff --git a/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.yaml b/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.yaml new file mode 100644 index 00000000..2cb33c83 --- /dev/null +++ b/samples/tasks/scenarios/keystone/create-update-and-delete-tenant.yaml @@ -0,0 +1,9 @@ +--- + KeystoneBasic.create_update_and_delete_tenant: + - + args: + name_length: 10 + runner: + type: "constant" + times: 100 + concurrency: 10 diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index b708a8b0..0782fe69 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -449,6 +449,14 @@ class FakeTenantsManager(FakeManager): def create(self, name): return self._cache(FakeTenant(self, name)) + def update(self, tenant_id, name=None, description=None): + tenant = self.get(tenant_id) + name = name or (tenant.name + "_updated") + desc = description or (tenant.name + "_description_updated") + tenant.name = name + tenant.description = desc + return self._cache(tenant) + class FakeNetworkManager(FakeManager):