[Negative] Create share over quota limit

This test ensures we are denied from creating new shares,
when hitting the quota enforcements.

Change-Id: Ice3acba7daecc5d6b1eeb094f26cbf1cd70aad90
This commit is contained in:
lkuchlan 2019-07-29 16:12:32 +03:00
parent 1a96ed9f70
commit baf81eb07a
1 changed files with 14 additions and 0 deletions

View File

@ -351,3 +351,17 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
share_type=share_type['name'],
force=False,
shares=st_q)
@tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
def test_create_share_over_quota_limit(self):
original_quota = self.shares_v2_client.show_quotas(
self.tenant_id)
self.create_share(share_type_id=self.share_type_id)
self.shares_v2_client.update_quotas(self.tenant_id, shares=1)
self.addCleanup(self.shares_v2_client.update_quotas,
self.tenant_id, shares=original_quota['shares'])
self.shares_v2_client.show_quotas(self.tenant_id)
self.assertRaises(lib_exc.OverLimit,
self.create_share,
share_type_id=self.share_type_id)