Volume Service Testing: default to v3 endpoints
Volume service has 2 versions of APIs, v2 and v3. v3 base
version 'v3.0' is supposed to be identical to v2 APIs.
Current supported API is v3 and all future development
will be on v3 with microversion.
Base API v3.0 == v2
API versioning v3.0 + microversion (v3.1, v3.2 etc)
In current situation, Tempest tests v2 API mainly and
v3 microversion specific change. As Cinder already made v3 as
current supported APIs which are supposed to be identical to v2,
it's is good to test v3 API as default with ability to configure
to test v2 APIs also.
Tempest should have flexibility to run existing test against any
of the API version. All existing tests which used to run on v2 APIs
should pass on v3.0 without any change.
Idea to achieve that is:
- Use config option ``[volume].catalog_type`` to switch the target API
version for testing. For example-
If it is configured to v3 endpoints, all tests will run against v3 APIs. like
'volumev3' in case of devstack [1].
If it is configured to v2 endpoints, all tests will run against v2 APIs. like
'volumev2' in case of devstack.
Changes required:
Tempest: this commit
1. Change the default value of the config option ``[volume].catalog_type`` to ``volumev3``
so that all gate job test v3 as default.
2. Make all volume service clients version less.
Devstack: I531f3b32e81ac5d282461597ca286c09429cb143
3. Make Devstack to configure the ``[volume].catalog_type`` on tempest for v2 job.
4. If Tempest if configured to tests v2 APIs, configure tempest to skip microversion tests
as no microversion supported in v2 APIs.
v2 API Job: TODO
5. Add new job for v2 APIs testing and set ``[volume].catalog_type`` to ``volumev2``
to run all tests against v2 APIs.
This way we will have:
- default gate testing of v3 APIs.
- separate job testing v2 APIs till it is required.
..1 https://github.com/openstack-dev/devstack/blob/924b1149c8138bf1401aaef709e00f680509c33f/lib/cinder#L361
NOTE: Next patch will make all service clients under v3 dir
and keep v2 service clients available for backward
compatibility.
Change-Id: I0c9193501eb9eaa25eb5f0786bb72eb7855099fb
diff --git a/releasenotes/notes/volume-service-testing-default-to-v3-endpoints-20b86895a590925d.yaml b/releasenotes/notes/volume-service-testing-default-to-v3-endpoints-20b86895a590925d.yaml
new file mode 100644
index 0000000..ea69293
--- /dev/null
+++ b/releasenotes/notes/volume-service-testing-default-to-v3-endpoints-20b86895a590925d.yaml
@@ -0,0 +1,8 @@
+---
+upgrade:
+ - |
+ The volume config option ``catalog_type`` default is changed to
+ ``volumev3`` which is v3 API endpoint configured in devstack.
+ With this change Tempest will be testing v3 API as default.
+ User who want to test v2 API can still test by configuring the
+ ``catalog_type`` to v2 endpoint.
diff --git a/tempest/config.py b/tempest/config.py
index 008c9f6..1fb5c8e 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -752,7 +752,7 @@
help='Timeout in seconds to wait for a volume to become '
'available.'),
cfg.StrOpt('catalog_type',
- default='volume',
+ default='volumev3',
help="Catalog type of the Volume Service"),
cfg.StrOpt('region',
default='',
diff --git a/tempest/lib/services/volume/v2/availability_zone_client.py b/tempest/lib/services/volume/v2/availability_zone_client.py
index bb4a357..147e4c6 100644
--- a/tempest/lib/services/volume/v2/availability_zone_client.py
+++ b/tempest/lib/services/volume/v2/availability_zone_client.py
@@ -19,7 +19,6 @@
class AvailabilityZoneClient(rest_client.RestClient):
- api_version = "v2"
def list_availability_zones(self):
resp, body = self.get('os-availability-zone')
diff --git a/tempest/lib/services/volume/v2/backups_client.py b/tempest/lib/services/volume/v2/backups_client.py
index adfa6a6..3dbb30c 100644
--- a/tempest/lib/services/volume/v2/backups_client.py
+++ b/tempest/lib/services/volume/v2/backups_client.py
@@ -22,8 +22,7 @@
class BackupsClient(base_client.BaseClient):
- """Volume V2 Backups client"""
- api_version = "v2"
+ """Volume Backups client"""
def create_backup(self, **kwargs):
"""Creates a backup of volume.
diff --git a/tempest/lib/services/volume/v2/capabilities_client.py b/tempest/lib/services/volume/v2/capabilities_client.py
index 240be13..7ebcd69 100644
--- a/tempest/lib/services/volume/v2/capabilities_client.py
+++ b/tempest/lib/services/volume/v2/capabilities_client.py
@@ -19,7 +19,6 @@
class CapabilitiesClient(rest_client.RestClient):
- api_version = "v2"
def show_backend_capabilities(self, host):
"""Shows capabilities for a storage back end.
diff --git a/tempest/lib/services/volume/v2/encryption_types_client.py b/tempest/lib/services/volume/v2/encryption_types_client.py
index b99d1fe..5a7ea12 100644
--- a/tempest/lib/services/volume/v2/encryption_types_client.py
+++ b/tempest/lib/services/volume/v2/encryption_types_client.py
@@ -20,7 +20,6 @@
class EncryptionTypesClient(rest_client.RestClient):
- api_version = "v2"
def is_resource_deleted(self, id):
try:
diff --git a/tempest/lib/services/volume/v2/extensions_client.py b/tempest/lib/services/volume/v2/extensions_client.py
index 09279d5..45b7a56 100644
--- a/tempest/lib/services/volume/v2/extensions_client.py
+++ b/tempest/lib/services/volume/v2/extensions_client.py
@@ -19,8 +19,7 @@
class ExtensionsClient(rest_client.RestClient):
- """Volume V2 extensions client."""
- api_version = "v2"
+ """Volume extensions client."""
def list_extensions(self):
url = 'extensions'
diff --git a/tempest/lib/services/volume/v2/hosts_client.py b/tempest/lib/services/volume/v2/hosts_client.py
index f44bda3..c395325 100644
--- a/tempest/lib/services/volume/v2/hosts_client.py
+++ b/tempest/lib/services/volume/v2/hosts_client.py
@@ -20,8 +20,7 @@
class HostsClient(rest_client.RestClient):
- """Client class to send CRUD Volume V2 API requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume API requests"""
def list_hosts(self, **params):
"""Lists all hosts.
diff --git a/tempest/lib/services/volume/v2/limits_client.py b/tempest/lib/services/volume/v2/limits_client.py
index ce9fba9..9500254 100644
--- a/tempest/lib/services/volume/v2/limits_client.py
+++ b/tempest/lib/services/volume/v2/limits_client.py
@@ -19,9 +19,7 @@
class LimitsClient(rest_client.RestClient):
- """Volume V2 limits client."""
-
- api_version = "v2"
+ """Volume limits client."""
def show_limits(self):
"""Returns the details of a volume absolute limits."""
diff --git a/tempest/lib/services/volume/v2/qos_client.py b/tempest/lib/services/volume/v2/qos_client.py
index 47d3914..f8b8c3c 100644
--- a/tempest/lib/services/volume/v2/qos_client.py
+++ b/tempest/lib/services/volume/v2/qos_client.py
@@ -19,13 +19,11 @@
class QosSpecsClient(rest_client.RestClient):
- """Volume V2 QoS client.
+ """Volume QoS client.
Client class to send CRUD QoS API requests
"""
- api_version = "v2"
-
def is_resource_deleted(self, qos_id):
try:
self.show_qos(qos_id)
diff --git a/tempest/lib/services/volume/v2/quota_classes_client.py b/tempest/lib/services/volume/v2/quota_classes_client.py
index 733b1ac..eeeb268 100644
--- a/tempest/lib/services/volume/v2/quota_classes_client.py
+++ b/tempest/lib/services/volume/v2/quota_classes_client.py
@@ -19,9 +19,7 @@
class QuotaClassesClient(rest_client.RestClient):
- """Volume quota class V2 client."""
-
- api_version = "v2"
+ """Volume quota class client."""
def show_quota_class_set(self, quota_class_id):
"""List quotas for a quota class.
diff --git a/tempest/lib/services/volume/v2/quotas_client.py b/tempest/lib/services/volume/v2/quotas_client.py
index e4b2895..8906294 100644
--- a/tempest/lib/services/volume/v2/quotas_client.py
+++ b/tempest/lib/services/volume/v2/quotas_client.py
@@ -20,8 +20,7 @@
class QuotasClient(rest_client.RestClient):
- """Client class to send CRUD Volume Quotas API V2 requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume Quotas API requests"""
def show_default_quota_set(self, tenant_id):
"""List the default volume quota set for a tenant."""
diff --git a/tempest/lib/services/volume/v2/scheduler_stats_client.py b/tempest/lib/services/volume/v2/scheduler_stats_client.py
index 0d04f85..bd5fa6d 100644
--- a/tempest/lib/services/volume/v2/scheduler_stats_client.py
+++ b/tempest/lib/services/volume/v2/scheduler_stats_client.py
@@ -19,7 +19,6 @@
class SchedulerStatsClient(rest_client.RestClient):
- api_version = "v2"
def list_pools(self, detail=False):
"""List all the volumes pools (hosts).
diff --git a/tempest/lib/services/volume/v2/services_client.py b/tempest/lib/services/volume/v2/services_client.py
index bc55469..09036a4 100644
--- a/tempest/lib/services/volume/v2/services_client.py
+++ b/tempest/lib/services/volume/v2/services_client.py
@@ -20,8 +20,7 @@
class ServicesClient(rest_client.RestClient):
- """Client class to send CRUD Volume V2 API requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume API requests"""
def list_services(self, **params):
url = 'os-services'
diff --git a/tempest/lib/services/volume/v2/snapshot_manage_client.py b/tempest/lib/services/volume/v2/snapshot_manage_client.py
index aecd30b..43fd328 100644
--- a/tempest/lib/services/volume/v2/snapshot_manage_client.py
+++ b/tempest/lib/services/volume/v2/snapshot_manage_client.py
@@ -19,9 +19,7 @@
class SnapshotManageClient(rest_client.RestClient):
- """Snapshot manage V2 client."""
-
- api_version = "v2"
+ """Snapshot manage client."""
def manage_snapshot(self, **kwargs):
"""Manage a snapshot."""
diff --git a/tempest/lib/services/volume/v2/snapshots_client.py b/tempest/lib/services/volume/v2/snapshots_client.py
index 4bc2842..1f05180 100644
--- a/tempest/lib/services/volume/v2/snapshots_client.py
+++ b/tempest/lib/services/volume/v2/snapshots_client.py
@@ -18,8 +18,7 @@
class SnapshotsClient(rest_client.RestClient):
- """Client class to send CRUD Volume V2 API requests."""
- api_version = "v2"
+ """Client class to send CRUD Volume API requests."""
create_resp = 202
def list_snapshots(self, detail=False, **params):
diff --git a/tempest/lib/services/volume/v2/transfers_client.py b/tempest/lib/services/volume/v2/transfers_client.py
index 2dfbe7b..291aadf 100644
--- a/tempest/lib/services/volume/v2/transfers_client.py
+++ b/tempest/lib/services/volume/v2/transfers_client.py
@@ -20,8 +20,7 @@
class TransfersClient(rest_client.RestClient):
- """Client class to send CRUD Volume Transfer V2 API requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume Transfer API requests"""
def create_volume_transfer(self, **kwargs):
"""Create a volume transfer.
diff --git a/tempest/lib/services/volume/v2/types_client.py b/tempest/lib/services/volume/v2/types_client.py
index af4fd8c..ef5e434 100644
--- a/tempest/lib/services/volume/v2/types_client.py
+++ b/tempest/lib/services/volume/v2/types_client.py
@@ -21,8 +21,7 @@
class TypesClient(rest_client.RestClient):
- """Client class to send CRUD Volume V2 API requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume API requests"""
def is_resource_deleted(self, id):
try:
diff --git a/tempest/lib/services/volume/v2/volume_manage_client.py b/tempest/lib/services/volume/v2/volume_manage_client.py
index 12f4240..ddae127 100644
--- a/tempest/lib/services/volume/v2/volume_manage_client.py
+++ b/tempest/lib/services/volume/v2/volume_manage_client.py
@@ -19,9 +19,7 @@
class VolumeManageClient(rest_client.RestClient):
- """Volume manage V2 client."""
-
- api_version = "v2"
+ """Volume manage client."""
def manage_volume(self, **kwargs):
"""Manage existing volume.
diff --git a/tempest/lib/services/volume/v2/volumes_client.py b/tempest/lib/services/volume/v2/volumes_client.py
index da3f2b5..dd019f6 100644
--- a/tempest/lib/services/volume/v2/volumes_client.py
+++ b/tempest/lib/services/volume/v2/volumes_client.py
@@ -23,8 +23,7 @@
class VolumesClient(base_client.BaseClient):
- """Client class to send CRUD Volume V2 API requests"""
- api_version = "v2"
+ """Client class to send CRUD Volume API requests"""
def _prepare_params(self, params):
"""Prepares params for use in get or _ext_get methods.