Remove incorrect compute min_microversions
Many compute tests assume that the min_microversion
is 2.10; however, this assumption is incorrect [0].
This patch removes these incorrect min_microversions.
[0] https://review.openstack.org/#/c/462996/
Change-Id: Idb030b8c63949bd16af93e402971ce8855e41938
Closes-Bug: #1692174
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
index d44dbac..7b35525 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
@@ -28,7 +28,6 @@
# Tests will fail with a 404 starting from microversion 2.36:
# See the following link for details:
# https://developer.openstack.org/api-ref/compute/#floating-ip-pools-os-floating-ip-pools-deprecated
- min_microversion = '2.10'
max_microversion = '2.35'
@classmethod
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
index 7adc161..cceccd4 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
@@ -28,7 +28,6 @@
# Tests will fail with a 404 starting from microversion 2.36:
# See the following link for details:
# https://developer.openstack.org/api-ref/compute/#floating-ips-bulk-os-floating-ips-bulk-deprecated
- min_microversion = '2.10'
max_microversion = '2.35'
@classmethod
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
index e6de908..764d165 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
@@ -28,7 +28,6 @@
# Tests will fail with a 404 starting from microversion 2.36:
# See the following link for details:
# https://developer.openstack.org/api-ref/compute/#floating-ips-os-floating-ips-deprecated
- min_microversion = '2.10'
max_microversion = '2.35'
@classmethod
diff --git a/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
index 39a87ed..3d66f2e 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
@@ -17,6 +17,7 @@
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
+from tempest.lib import exceptions as lib_exc
from patrole_tempest_plugin import rbac_rule_validation
from patrole_tempest_plugin.tests.api.compute import rbac_base
@@ -24,7 +25,7 @@
CONF = config.CONF
-class ImagesV235RbacTest(rbac_base.BaseV2ComputeRbacTest):
+class ImagesRbacTest(rbac_base.BaseV2ComputeRbacTest):
"""RBAC tests for the Nova images client.
These APIs are proxy calls to the Image service. Consequently, no nova
@@ -34,31 +35,39 @@
"""
# These tests will fail with a 404 starting from microversion 2.36.
- min_microversion = '2.10'
+ # See the following link for details:
+ # https://developer.openstack.org/api-ref/compute/#images-deprecated
max_microversion = '2.35'
@classmethod
def skip_checks(cls):
- super(ImagesV235RbacTest, cls).skip_checks()
+ super(ImagesRbacTest, cls).skip_checks()
if not CONF.service_available.glance:
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
raise cls.skipException(skip_msg)
@classmethod
def setup_clients(cls):
- super(ImagesV235RbacTest, cls).setup_clients()
- cls.glance_image_client = cls.os_primary.image_client_v2
+ super(ImagesRbacTest, cls).setup_clients()
+ if CONF.image_feature_enabled.api_v1:
+ cls.glance_image_client = cls.os_primary.image_client
+ elif CONF.image_feature_enabled.api_v2:
+ cls.glance_image_client = cls.os_primary.image_client_v2
+ else:
+ raise lib_exc.InvalidConfiguration(
+ 'Either api_v1 or api_v2 must be True in '
+ '[image-feature-enabled].')
@classmethod
def resource_setup(cls):
- super(ImagesV235RbacTest, cls).resource_setup()
+ super(ImagesRbacTest, cls).resource_setup()
cls.image = cls.glance_image_client.create_image(
name=data_utils.rand_name(cls.__name__ + '-image'))
@classmethod
def resource_cleanup(cls):
cls.glance_image_client.delete_image(cls.image['id'])
- super(ImagesV235RbacTest, cls).resource_cleanup()
+ super(ImagesRbacTest, cls).resource_cleanup()
@decorators.idempotent_id('b861f302-b72b-4055-81db-c62ff30b136d')
@rbac_rule_validation.action(
diff --git a/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
index ca0ee26..e409269 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
@@ -22,14 +22,11 @@
CONF = config.CONF
-class MultinicV210RbacTest(rbac_base.BaseV2ComputeRbacTest):
-
- min_microversion = '2.10'
- max_microversion = '2.36'
+class MultinicRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
def skip_checks(cls):
- super(MultinicV210RbacTest, cls).skip_checks()
+ super(MultinicRbacTest, cls).skip_checks()
if not CONF.service_available.neutron:
raise cls.skipException("Neutron is required")
if not CONF.compute_feature_enabled.interface_attach:
@@ -39,11 +36,11 @@
def setup_credentials(cls):
# This test class requires network and subnet
cls.set_network_resources(network=True, subnet=True)
- super(MultinicV210RbacTest, cls).setup_credentials()
+ super(MultinicRbacTest, cls).setup_credentials()
@classmethod
def resource_setup(cls):
- super(MultinicV210RbacTest, cls).resource_setup()
+ super(MultinicRbacTest, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
@rbac_rule_validation.action(