Make os-quota-class-sets test not break quotas
Ib0cde08dfaa0f6a5e180d247864fb59d76eca903 added a test for nova's
os-quota-class-sets API. To test if the default quota is successfully
changed by bumping all quotas with a by a value of 1, and adding locks
around all quota specific API tests to prevent race conditions.
If the quota is unlimited, -1, then the test sets the quota to 0
(-1+1), causing any concurrent attempt to boot an instance (by a
parallel test) to raise the error 'FixedIpLimitExceeded'.
To address the first issue, +100 instead of +1 to the current quotas.
This addresses the immediate gate issue by preventing us from hitting
any quota limits.
Because this is an admin only test, we expect that the blueprint to
run without admin will just skip this in the production cloud case.
Co-Authored-By: Joe Gordon <joe.gordon0@gmail.com>
Change-Id: I7660037eee2e5b04e5dd1dfa779d15cb361cc939
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index 9263396..d27d78b 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -169,7 +169,10 @@
'default', **original_defaults)
self.assertEqual(200, resp.status)
- @test.attr(type='gate')
+ # NOTE(sdague): this test is problematic as it changes
+ # global state, and possibly needs to be part of a set of
+ # tests that get run all by themselves at the end under a
+ # 'danger' flag.
def test_update_default_quotas(self):
LOG.debug("get the current 'default' quota class values")
resp, body = self.adm_client.get_quota_class_set('default')
@@ -180,7 +183,10 @@
self.addCleanup(self._restore_default_quotas, body.copy())
# increment all of the values for updating the default quota class
for quota, default in six.iteritems(body):
- body[quota] = default + 1
+ # NOTE(sdague): we need to increment a lot, otherwise
+ # there is a real chance that we go from -1 (unlimitted)
+ # to a very small number which causes issues.
+ body[quota] = default + 100
LOG.debug("update limits for the default quota class set")
resp, update_body = self.adm_client.update_quota_class_set('default',
**body)