From 71dccfaeffce97e8a53cfc4a4ae38ffefa89f271 Mon Sep 17 00:00:00 2001 From: chenhb-zte Date: Tue, 27 Dec 2016 19:53:37 +0800 Subject: [PATCH] Switch admin_cleanup to usercleanup Scenarios of ec2 credentials use regular users to create, list and delete, but use admin_cleanup to clean resources. Now we switch admin_cleanup to usercleanup for ec2 credentials. Change-Id: I5b37ab5deb4ad8bc48a8da8fb73f43e1c6c40702 --- rally/plugins/openstack/scenarios/keystone/basic.py | 4 ++-- tests/ci/osresources.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) mode change 100644 => 100755 rally/plugins/openstack/scenarios/keystone/basic.py diff --git a/rally/plugins/openstack/scenarios/keystone/basic.py b/rally/plugins/openstack/scenarios/keystone/basic.py old mode 100644 new mode 100755 index 431e550a..7587b4cb --- a/rally/plugins/openstack/scenarios/keystone/basic.py +++ b/rally/plugins/openstack/scenarios/keystone/basic.py @@ -326,7 +326,7 @@ class CreateAndListServices(KeystoneBasic): @validation.required_openstack(users=True) -@scenario.configure(context={"admin_cleanup": ["keystone"]}, +@scenario.configure(context={"cleanup": ["keystone"]}, name="KeystoneBasic.create_and_list_ec2credentials") class CreateAndListEc2Credentials(KeystoneBasic): @@ -339,7 +339,7 @@ class CreateAndListEc2Credentials(KeystoneBasic): @validation.required_openstack(users=True) -@scenario.configure(context={"admin_cleanup": ["keystone"]}, +@scenario.configure(context={"cleanup": ["keystone"]}, name="KeystoneBasic.create_and_delete_ec2credential") class CreateAndDeleteEc2Credential(KeystoneBasic): diff --git a/tests/ci/osresources.py b/tests/ci/osresources.py index c4715de1..8846fd79 100755 --- a/tests/ci/osresources.py +++ b/tests/ci/osresources.py @@ -33,7 +33,8 @@ from rally import osclients class ResourceManager(object): REQUIRED_SERVICE = None - REPR_KEYS = ("id", "name", "tenant_id", "zone", "zoneName", "pool") + REPR_KEYS = ("id", "name", "tenant_id", "zone", "zoneName", "pool", + "blob") def __init__(self, clients): self.clients = clients @@ -93,6 +94,14 @@ class Keystone(ResourceManager): def list_roles(self): return self.client.roles.list() + def list_ec2credentials(self): + users = self.list_users() + ec2_list = [] + for user in users: + ec2_list.extend( + self.client.ec2.list(user.id)) + return ec2_list + class Magnum(ResourceManager):