Merge "Modify quota set fields according to microversion"
diff --git a/tempest/api/compute/admin/test_quotas.py b/tempest/api/compute/admin/test_quotas.py
index c2bdf7e..df534bc 100644
--- a/tempest/api/compute/admin/test_quotas.py
+++ b/tempest/api/compute/admin/test_quotas.py
@@ -46,13 +46,19 @@
# tenant most of them should be skipped if we can't do that
cls.demo_tenant_id = cls.quotas_client.tenant_id
- cls.default_quota_set = set(('injected_file_content_bytes',
- 'metadata_items', 'injected_files',
- 'ram', 'floating_ips',
- 'fixed_ips', 'key_pairs',
- 'injected_file_path_bytes',
- 'instances', 'security_group_rules',
- 'cores', 'security_groups'))
+ cls.default_quota_set = set(('metadata_items', 'ram', 'key_pairs',
+ 'instances', 'cores',
+ 'server_group_members', 'server_groups'))
+ if cls.is_requested_microversion_compatible('2.35'):
+ cls.default_quota_set = \
+ cls.default_quota_set | set(['fixed_ips', 'floating_ips',
+ 'security_group_rules',
+ 'security_groups'])
+ if cls.is_requested_microversion_compatible('2.56'):
+ cls.default_quota_set = \
+ cls.default_quota_set | set(['injected_file_content_bytes',
+ 'injected_file_path_bytes',
+ 'injected_files'])
@decorators.idempotent_id('3b0a7c8f-cf58-46b8-a60c-715a32a8ba7d')
def test_get_default_quotas(self):
@@ -69,13 +75,19 @@
# Admin can update all the resource quota limits for a tenant
default_quota_set = self.adm_client.show_default_quota_set(
self.demo_tenant_id)['quota_set']
- new_quota_set = {'injected_file_content_bytes': 20480,
- 'metadata_items': 256, 'injected_files': 10,
- 'ram': 10240, 'floating_ips': 20, 'fixed_ips': 10,
- 'key_pairs': 200, 'injected_file_path_bytes': 512,
- 'instances': 20, 'security_group_rules': 20,
- 'cores': 2, 'security_groups': 20,
- 'server_groups': 20, 'server_group_members': 20}
+ new_quota_set = {'metadata_items': 256, 'ram': 10240,
+ 'key_pairs': 200, 'instances': 20,
+ 'server_groups': 20,
+ 'server_group_members': 20, 'cores': 2}
+ if self.is_requested_microversion_compatible('2.35'):
+ new_quota_set.update({'fixed_ips': 10, 'floating_ips': 20,
+ 'security_group_rules': 20,
+ 'security_groups': 20})
+ if self.is_requested_microversion_compatible('2.56'):
+ new_quota_set.update({'injected_file_content_bytes': 20480,
+ 'injected_file_path_bytes': 512,
+ 'injected_files': 10})
+
# Update limits for all quota resources
quota_set = self.adm_client.update_quota_set(
self.demo_tenant_id,
diff --git a/tempest/api/compute/test_quotas.py b/tempest/api/compute/test_quotas.py
index 7cf90ae..a62492d 100644
--- a/tempest/api/compute/test_quotas.py
+++ b/tempest/api/compute/test_quotas.py
@@ -43,14 +43,19 @@
super(QuotasTestJSON, cls).resource_setup()
cls.tenant_id = cls.client.tenant_id
cls.user_id = cls.client.user_id
- cls.default_quota_set = set(('injected_file_content_bytes',
- 'metadata_items', 'injected_files',
- 'ram', 'floating_ips',
- 'fixed_ips', 'key_pairs',
- 'injected_file_path_bytes',
- 'instances', 'security_group_rules',
- 'cores', 'security_groups',
+ cls.default_quota_set = set(('metadata_items', 'ram', 'key_pairs',
+ 'instances', 'cores',
'server_group_members', 'server_groups'))
+ if cls.is_requested_microversion_compatible('2.35'):
+ cls.default_quota_set = \
+ cls.default_quota_set | set(['fixed_ips', 'floating_ips',
+ 'security_group_rules',
+ 'security_groups'])
+ if cls.is_requested_microversion_compatible('2.56'):
+ cls.default_quota_set = \
+ cls.default_quota_set | set(['injected_file_content_bytes',
+ 'injected_file_path_bytes',
+ 'injected_files'])
@decorators.idempotent_id('f1ef0a97-dbbb-4cca-adc5-c9fbc4f76107')
def test_get_quotas(self):