Add keystone create_and_list_services scenario

This scenario covers create keystone service and then list all services

Change-Id: I4e8cff9dfb6c522abd7d136f6e37b442ee44a4d9
This commit is contained in:
Pradeep K Surisetty 2015-04-06 20:31:47 +05:30
parent 81fd132ebd
commit 4982d1b2ae
5 changed files with 66 additions and 0 deletions

View File

@ -108,6 +108,16 @@
failure_rate:
max: 0
KeystoneBasic.create_and_list_services:
-
runner:
type: "constant"
times: 10
concurrency: 5
sla:
failure_rate:
max: 0
CeilometerAlarms.create_alarm:
-
args:

View File

@ -124,3 +124,16 @@ class KeystoneBasic(kutils.KeystoneScenario):
"""
service = self._service_create(name, service_type, description)
self._delete_service(service.id)
@validation.required_openstack(admin=True)
@base.scenario(context={"admin_cleanup": ["keystone"]})
def create_and_list_services(self, name=None, service_type=None,
description=None):
"""Create and list services.
:param name: name of the service
:param service_type: type of the service
:param description: description of the service
"""
self._service_create(name, service_type, description)
self._list_services()

View File

@ -0,0 +1,16 @@
{
"KeystoneBasic.create_and_list_services": [
{
"args": {
"name": "Rally_test_service",
"service_type": "Really_test_type",
"description": "test_description"
},
"runner": {
"type": "constant",
"times": 100,
"concurrency": 10
}
}
]
}

View File

@ -0,0 +1,11 @@
---
KeystoneBasic.create_and_list_services:
-
args:
name: "Rally_test_service"
service_type: "Really_test_type"
description: "test_description"
runner:
type: "constant"
times: 100
concurrency: 10

View File

@ -140,3 +140,19 @@ class KeystoneBasicTestCase(test.TestCase):
service_type,
description)
scenario._delete_service.assert_called_once_with(fake_service.id)
def test_create_and_list_services(self):
scenario = basic.KeystoneBasic()
name = "Rally_test_service"
service_type = "rally_test_type"
description = "test_description"
fake_service = mock.MagicMock()
scenario._service_create = mock.MagicMock(return_value=fake_service)
scenario._list_services = mock.MagicMock()
scenario.create_and_list_services(name=name,
service_type=service_type,
description=description)
scenario._service_create.assert_called_once_with(name,
service_type,
description)
scenario._list_services.assert_called_once_with()