From 4b20d449fff58ca62ee1c94ab491a0d7e53b6851 Mon Sep 17 00:00:00 2001 From: Vida Haririan Date: Tue, 2 Feb 2021 14:16:04 -0500 Subject: [PATCH] Added test test_create_snapshot_over_quota_limit This test case validates the case of creating a share from napshot with quota over limit. Change-Id: Ib5f20982155029e9a3c0183eae218ae6d1b88e49 --- .../tests/api/admin/test_quotas_negative.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py index 7dd12e19..20e359a0 100644 --- a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py +++ b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py @@ -426,6 +426,25 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest): self.create_share, share_type_id=self.share_type_id) + @decorators.idempotent_id('a2267f4d-63ef-4631-a01d-3723707e5516') + @testtools.skipUnless( + CONF.share.run_snapshot_tests, 'Snapshot tests are disabled.') + @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND) + def test_create_snapshot_over_quota_limit(self): + extra_specs = {'snapshot_support': True} + share_type = self.create_share_type(extra_specs=extra_specs) + share = self.create_share(share_type_id=share_type['id']) + + # Update snapshot quota + self.update_quotas(self.tenant_id, snapshots=1) + + # Create share from updated snapshot, wait for status 'available' + self.create_snapshot_wait_for_active(share['id']) + + self.assertRaises(lib_exc.OverLimit, + self.create_snapshot_wait_for_active, + share['id']) + @ddt.ddt class ReplicaQuotasNegativeTest(rep_neg_test.ReplicationNegativeBase):