Add quotas.CinderGet scenario

Get quotas for Cinder.

Measure the "cinder quota-show" command performance

Change-Id: I95e403c75ae500f19f2d20854062cbdfd9c06283
This commit is contained in:
zhangzhang 2017-01-18 08:19:22 -05:00
parent b028723cfc
commit 58ebb68d21
5 changed files with 72 additions and 0 deletions

View File

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

View File

@ -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"]},

View File

@ -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
}
}
}
]
}

View File

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

View File

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