Allow new quota types
On Nova commit Ib281e43eabfbd176454bde7f0622d46fb04fcb79, we are adding
two new new quota values for server groups.
However, current Tempest rejects unexpected quota values on its own tests,
and we cannot add the new quota without Tempest changes.
This patch changes quota tests for checking mandatory quota existence
and allowing new quota types. It also avoids truing to restore the
new quota values for now, until we have client support for them.
Tempest commit I4409a7240dc0a3fa1e11c64c5f5a56ca656b70a4 has already made
the same change for the non admin tests
Change-Id: I618137ea3e8d3d1259c31a2d579c6b752db321e9
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index d27d78b..93ed7ae 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -57,9 +57,9 @@
resp, quota_set = self.adm_client.get_default_quota_set(
self.demo_tenant_id)
self.assertEqual(200, resp.status)
- self.assertEqual(sorted(expected_quota_set),
- sorted(quota_set.keys()))
self.assertEqual(quota_set['id'], self.demo_tenant_id)
+ for quota in expected_quota_set:
+ self.assertIn(quota, quota_set.keys())
@test.attr(type='gate')
def test_update_all_quota_resources_for_tenant(self):
@@ -79,10 +79,18 @@
**new_quota_set)
default_quota_set.pop('id')
+ # NOTE(PhilDay) The following is safe as we're not updating these
+ # two quota values yet. Once the Nova change to add these is merged
+ # and the client updated to support them this can be removed
+ if 'server_groups' in default_quota_set:
+ default_quota_set.pop('server_groups')
+ if 'server_group_members' in default_quota_set:
+ default_quota_set.pop('server_group_members')
self.addCleanup(self.adm_client.update_quota_set,
self.demo_tenant_id, **default_quota_set)
self.assertEqual(200, resp.status)
- self.assertEqual(new_quota_set, quota_set)
+ for quota in new_quota_set:
+ self.assertIn(quota, quota_set.keys())
# TODO(afazekas): merge these test cases
@test.attr(type='gate')