quota testcases use tenant_name should use tenant_id
Test case related to quota usage (test_show_quota_usage, test_cinder_quota_defaults and test_cinder_quota_show) uses tenant name, ideally it should use tenant id as quota requires UUID of tenant and not tenant name. Cinder quota-show ideally requires tenant_id to show quota. As there is bug in cinder (BUG: 1307475) , that if we give non-existent tenant_id still cinder show the quota and returns 200 (OK). Hence, these testcases should use tenant_id and not tenant_name. Change-Id: Icab25afd482b34290bc74be2ba420f6b016dde18 Closes-Bug: #1321617
This commit is contained in:
parent
31a91ee725
commit
7519a52761
|
@ -72,7 +72,7 @@ class VolumeQuotasAdminTestJSON(base.BaseVolumeV1AdminTest):
|
|||
@test.attr(type='gate')
|
||||
def test_show_quota_usage(self):
|
||||
_, quota_usage = self.quotas_client.get_quota_usage(
|
||||
self.os_adm.credentials.tenant_name)
|
||||
self.os_adm.credentials.tenant_id)
|
||||
for key in QUOTA_KEYS:
|
||||
self.assertIn(key, quota_usage)
|
||||
for usage_key in QUOTA_USAGE_KEYS:
|
||||
|
|
|
@ -20,6 +20,7 @@ from tempest_lib import exceptions
|
|||
import testtools
|
||||
|
||||
from tempest import cli
|
||||
from tempest import clients
|
||||
from tempest import config
|
||||
|
||||
|
||||
|
@ -41,6 +42,9 @@ class SimpleReadOnlyCinderClientTest(cli.ClientTestBase):
|
|||
msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
raise cls.skipException(msg)
|
||||
super(SimpleReadOnlyCinderClientTest, cls).resource_setup()
|
||||
id_cl = clients.AdminManager().identity_client
|
||||
tenant = id_cl.get_tenant_by_name(CONF.identity.admin_tenant_name)
|
||||
cls.admin_tenant_id = tenant['id']
|
||||
|
||||
def cinder(self, *args, **kwargs):
|
||||
return self.clients.cinder(*args,
|
||||
|
@ -87,15 +91,13 @@ class SimpleReadOnlyCinderClientTest(cli.ClientTestBase):
|
|||
def test_cinder_quota_defaults(self):
|
||||
"""This CLI can accept and string as param."""
|
||||
roles = self.parser.listing(self.cinder('quota-defaults',
|
||||
params=CONF.identity.
|
||||
admin_tenant_name))
|
||||
params=self.admin_tenant_id))
|
||||
self.assertTableStruct(roles, ['Property', 'Value'])
|
||||
|
||||
def test_cinder_quota_show(self):
|
||||
"""This CLI can accept and string as param."""
|
||||
roles = self.parser.listing(self.cinder('quota-show',
|
||||
params=CONF.identity.
|
||||
admin_tenant_name))
|
||||
params=self.admin_tenant_id))
|
||||
self.assertTableStruct(roles, ['Property', 'Value'])
|
||||
|
||||
def test_cinder_rate_limits(self):
|
||||
|
|
Loading…
Reference in New Issue