diff --git a/rally-jobs/cinder.yaml b/rally-jobs/cinder.yaml index be62ea7f..d9467685 100755 --- a/rally-jobs/cinder.yaml +++ b/rally-jobs/cinder.yaml @@ -902,3 +902,17 @@ sla: failure_rate: max: 0 + + Quotas.cinder_get: + - + runner: + type: "constant" + times: 10 + concurrency: 2 + context: + users: + tenants: 2 + users_per_tenant: 2 + sla: + failure_rate: + max: 0 diff --git a/rally/plugins/openstack/scenarios/quotas/quotas.py b/rally/plugins/openstack/scenarios/quotas/quotas.py index 531ab37c..2c33d6d1 100644 --- a/rally/plugins/openstack/scenarios/quotas/quotas.py +++ b/rally/plugins/openstack/scenarios/quotas/quotas.py @@ -70,6 +70,21 @@ class CinderUpdate(utils.QuotasScenario): max_quota) +@validation.required_services(consts.Service.CINDER) +@validation.required_openstack(admin=True, users=True) +@scenario.configure(context={"admin_cleanup": ["cinder.quotas"]}, + name="Quotas.cinder_get") +class CinderGet(utils.QuotasScenario): + + def run(self): + """Get quotas for Cinder. + + Measure the "cinder quota-show" command performance + + """ + self._get_quotas("cinder", self.context["tenant"]["id"]) + + @validation.required_services(consts.Service.CINDER) @validation.required_openstack(admin=True, users=True) @scenario.configure(context={"admin_cleanup": ["cinder.quotas"]}, diff --git a/samples/tasks/scenarios/quotas/cinder-get.json b/samples/tasks/scenarios/quotas/cinder-get.json new file mode 100644 index 00000000..627a0aa4 --- /dev/null +++ b/samples/tasks/scenarios/quotas/cinder-get.json @@ -0,0 +1,23 @@ +{ + "Quotas.cinder_get": [ + { + "runner": { + "type": "constant", + "times": 10, + "concurrency": 2 + }, + "context": { + "users": { + "tenants": 2, + "users_per_tenant": 2 + } + }, + "sla": { + "failure_rate": { + "max": 0 + } + } + + } + ] +} diff --git a/samples/tasks/scenarios/quotas/cinder-get.yaml b/samples/tasks/scenarios/quotas/cinder-get.yaml new file mode 100644 index 00000000..0c6bcd22 --- /dev/null +++ b/samples/tasks/scenarios/quotas/cinder-get.yaml @@ -0,0 +1,14 @@ +--- + Quotas.cinder_get: + - + runner: + type: "constant" + times: 10 + concurrency: 2 + context: + users: + tenants: 2 + users_per_tenant: 2 + sla: + failure_rate: + max: 0 diff --git a/tests/unit/plugins/openstack/scenarios/quotas/test_quotas.py b/tests/unit/plugins/openstack/scenarios/quotas/test_quotas.py index c4dfef2c..b9c023e4 100644 --- a/tests/unit/plugins/openstack/scenarios/quotas/test_quotas.py +++ b/tests/unit/plugins/openstack/scenarios/quotas/test_quotas.py @@ -37,6 +37,12 @@ class QuotasTestCase(test.ScenarioTestCase): scenario.run() scenario._get_quotas.assert_called_once_with("nova", "fake") + def test_cinder_get(self): + scenario = quotas.CinderGet(self.context) + scenario._get_quotas = mock.MagicMock() + scenario.run() + scenario._get_quotas.assert_called_once_with("cinder", "fake") + def test_nova_update(self): scenario = quotas.NovaUpdate(self.context) scenario._update_quotas = mock.MagicMock()