Add max_microversion for compute volumes_extensions_client tests
The ``volumes_extensions_client`` [0] uses a deprecated nova
API, which starts throwing a 404 from microversion 2.36+ [1].
This patch adds max_microversion = '2.35' to compute tests that use the
``volumes_extensions_client`` and the ``snapshots_extensions_client``.
This can be tested by running:
curl -g -i -X GET http://127.0.0.1:8774/v2.1/os-volumes \
-H "OpenStack-API-Version: compute 2.35" \
-H "User-Agent: python-novaclient" \
-H "Accept: application/json" \
-H "X-OpenStack-Nova-API-Version: 2.35" \
-H "X-Auth-Token: $TOKEN"
which passes -- whereas replacing "2.35" with "2.36" above throws
a 404, in accordance with the documentation [1].
This patch also replaces ``volumes_extensions_client`` from
the base compute delete_volume classmethod with the ``volumes_client``.
This is because the functionality is identical: the former client
simply does a proxy call to Cinder, so we should use the non-deprecated
``volumes_client`` instead.
[0] https://github.com/openstack/tempest/blob/master/tempest/clients.py#L174
[1] https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
Change-Id: I4a1737aa4456580d8c8cb2df8d1c28792f774104
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index a5ee716..68e59eb 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -370,7 +370,7 @@
@classmethod
def delete_volume(cls, volume_id):
"""Deletes the given volume and waits for it to be gone."""
- cls._delete_volume(cls.volumes_extensions_client, volume_id)
+ cls._delete_volume(cls.volumes_client, volume_id)
@classmethod
def get_server_ip(cls, server):
diff --git a/tempest/api/compute/volumes/test_volume_snapshots.py b/tempest/api/compute/volumes/test_volume_snapshots.py
index 2f3a06e..0f436eb 100644
--- a/tempest/api/compute/volumes/test_volume_snapshots.py
+++ b/tempest/api/compute/volumes/test_volume_snapshots.py
@@ -27,6 +27,11 @@
class VolumesSnapshotsTestJSON(base.BaseV2ComputeTest):
+ # These tests will fail with a 404 starting from microversion 2.36. For
+ # more information, see:
+ # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+ max_microversion = '2.35'
+
@classmethod
def skip_checks(cls):
super(VolumesSnapshotsTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 43c837a..d9ee5b1 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -27,6 +27,11 @@
class VolumesGetTestJSON(base.BaseV2ComputeTest):
+ # These tests will fail with a 404 starting from microversion 2.36. For
+ # more information, see:
+ # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+ max_microversion = '2.35'
+
@classmethod
def skip_checks(cls):
super(VolumesGetTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index 0d8214f..b2aebe7 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -27,6 +27,11 @@
# If you are running a Devstack environment, ensure that the
# VOLUME_BACKING_FILE_SIZE is at least 4G in your localrc
+ # These tests will fail with a 404 starting from microversion 2.36. For
+ # more information, see:
+ # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+ max_microversion = '2.35'
+
@classmethod
def skip_checks(cls):
super(VolumesTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
index 80db1be..87f7d8a 100644
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -24,6 +24,11 @@
class VolumesNegativeTest(base.BaseV2ComputeTest):
+ # These tests will fail with a 404 starting from microversion 2.36. For
+ # more information, see:
+ # https://developer.openstack.org/api-ref/compute/#volume-extension-os-volumes-os-snapshots-deprecated
+ max_microversion = '2.35'
+
@classmethod
def skip_checks(cls):
super(VolumesNegativeTest, cls).skip_checks()