diff --git a/rally-jobs/rally.yaml b/rally-jobs/rally.yaml index 003e39d3b7..723cef856c 100755 --- a/rally-jobs/rally.yaml +++ b/rally-jobs/rally.yaml @@ -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: diff --git a/rally/benchmark/scenarios/keystone/basic.py b/rally/benchmark/scenarios/keystone/basic.py index 00b8d29e7e..b5a57b3a5d 100644 --- a/rally/benchmark/scenarios/keystone/basic.py +++ b/rally/benchmark/scenarios/keystone/basic.py @@ -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() diff --git a/samples/tasks/scenarios/keystone/create-and-list-services.json b/samples/tasks/scenarios/keystone/create-and-list-services.json new file mode 100644 index 0000000000..b32abfc92b --- /dev/null +++ b/samples/tasks/scenarios/keystone/create-and-list-services.json @@ -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 + } + } + ] +} diff --git a/samples/tasks/scenarios/keystone/create-and-list-services.yaml b/samples/tasks/scenarios/keystone/create-and-list-services.yaml new file mode 100644 index 0000000000..b7d9514a08 --- /dev/null +++ b/samples/tasks/scenarios/keystone/create-and-list-services.yaml @@ -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 diff --git a/tests/unit/benchmark/scenarios/keystone/test_basic.py b/tests/unit/benchmark/scenarios/keystone/test_basic.py index 91cf3ab458..8c3a3c1a6c 100644 --- a/tests/unit/benchmark/scenarios/keystone/test_basic.py +++ b/tests/unit/benchmark/scenarios/keystone/test_basic.py @@ -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()