Merge "Add keystone.CreateAndGetRole scenario"
This commit is contained in:
commit
78ca50bd60
@ -120,6 +120,21 @@
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
KeystoneBasic.create_and_get_role:
|
||||
-
|
||||
args: {}
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 5
|
||||
context:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
KeystoneBasic.create_add_and_list_user_roles:
|
||||
-
|
||||
runner:
|
||||
|
@ -109,6 +109,21 @@
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
KeystoneBasic.create_and_get_role:
|
||||
-
|
||||
args: {}
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 5
|
||||
context:
|
||||
users:
|
||||
tenants: 2
|
||||
users_per_tenant: 2
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
#KeystoneBasic.create_add_and_list_user_roles:
|
||||
#-
|
||||
#runner:
|
||||
|
@ -332,3 +332,17 @@ class CreateAndDeleteEc2Credential(kutils.KeystoneScenario):
|
||||
creds = self._create_ec2credentials(self.context["user"]["id"],
|
||||
self.context["tenant"]["id"])
|
||||
self._delete_ec2credential(self.context["user"]["id"], creds.access)
|
||||
|
||||
|
||||
@validation.required_openstack(admin=True)
|
||||
@scenario.configure(context={"admin_cleanup": ["keystone"]},
|
||||
name="KeystoneBasic.create_and_get_role")
|
||||
class CreateAndGetRole(kutils.KeystoneScenario):
|
||||
|
||||
def run(self, **kwargs):
|
||||
"""Create a user role and get it detailed information.
|
||||
|
||||
:param kwargs: Optional additional arguments for roles creation
|
||||
"""
|
||||
role = self._role_create(**kwargs)
|
||||
self._get_role(role.id)
|
||||
|
23
samples/tasks/scenarios/keystone/create-and-get-role.json
Normal file
23
samples/tasks/scenarios/keystone/create-and-get-role.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"KeystoneBasic.create_and_get_role": [
|
||||
{
|
||||
"args": {},
|
||||
"runner": {
|
||||
"type": "constant",
|
||||
"times": 10,
|
||||
"concurrency": 2
|
||||
},
|
||||
"context": {
|
||||
"users": {
|
||||
"tenants": 3,
|
||||
"users_per_tenant": 2
|
||||
}
|
||||
},
|
||||
"sla": {
|
||||
"failure_rate": {
|
||||
"max": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
15
samples/tasks/scenarios/keystone/create-and-get-role.yaml
Normal file
15
samples/tasks/scenarios/keystone/create-and-get-role.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
KeystoneBasic.create_and_get_role:
|
||||
-
|
||||
args: {}
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 10
|
||||
concurrency: 2
|
||||
context:
|
||||
users:
|
||||
tenants: 3
|
||||
users_per_tenant: 2
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
@ -148,6 +148,15 @@ class KeystoneBasicTestCase(test.ScenarioTestCase):
|
||||
scenario._role_create.assert_called_once_with()
|
||||
scenario._role_delete.assert_called_once_with(fake_role.id)
|
||||
|
||||
def test_create_and_get_role(self):
|
||||
scenario = basic.CreateAndGetRole(self.context)
|
||||
fake_role = mock.MagicMock()
|
||||
scenario._role_create = mock.MagicMock(return_value=fake_role)
|
||||
scenario._get_role = mock.MagicMock()
|
||||
scenario.run()
|
||||
scenario._role_create.assert_called_once_with()
|
||||
scenario._get_role.assert_called_once_with(fake_role.id)
|
||||
|
||||
def test_create_and_list_user_roles(self):
|
||||
context = self._get_context()
|
||||
scenario = basic.CreateAddAndListUserRoles(context)
|
||||
|
Loading…
Reference in New Issue
Block a user