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
This commit is contained in:
chenhb-zte 2016-12-27 19:53:37 +08:00
parent c8ab7472ec
commit 71dccfaeff
2 changed files with 12 additions and 3 deletions

4
rally/plugins/openstack/scenarios/keystone/basic.py Normal file → Executable file
View File

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

View File

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