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 924b1149c8/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
This commit is contained in:
ghanshyam 2017-12-14 07:22:12 +00:00 committed by Ghanshyam Mann
parent e4f4d8bee1
commit 89c213fb35
20 changed files with 23 additions and 38 deletions

View File

@ -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.

View File

@ -752,7 +752,7 @@ VolumeGroup = [
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='',

View File

@ -19,7 +19,6 @@ from tempest.lib.common import rest_client
class AvailabilityZoneClient(rest_client.RestClient):
api_version = "v2"
def list_availability_zones(self):
resp, body = self.get('os-availability-zone')

View File

@ -22,8 +22,7 @@ from tempest.lib.services.volume import base_client
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.

View File

@ -19,7 +19,6 @@ from tempest.lib.common import rest_client
class CapabilitiesClient(rest_client.RestClient):
api_version = "v2"
def show_backend_capabilities(self, host):
"""Shows capabilities for a storage back end.

View File

@ -20,7 +20,6 @@ from tempest.lib import exceptions as lib_exc
class EncryptionTypesClient(rest_client.RestClient):
api_version = "v2"
def is_resource_deleted(self, id):
try:

View File

@ -19,8 +19,7 @@ from tempest.lib.common import rest_client
class ExtensionsClient(rest_client.RestClient):
"""Volume V2 extensions client."""
api_version = "v2"
"""Volume extensions client."""
def list_extensions(self):
url = 'extensions'

View File

@ -20,8 +20,7 @@ from tempest.lib.common import rest_client
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.

View File

@ -19,9 +19,7 @@ from tempest.lib.common import rest_client
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."""

View File

@ -19,13 +19,11 @@ from tempest.lib import exceptions as lib_exc
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)

View File

@ -19,9 +19,7 @@ from tempest.lib.common import rest_client
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.

View File

@ -20,8 +20,7 @@ from tempest.lib.common import rest_client
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."""

View File

@ -19,7 +19,6 @@ from tempest.lib.common import rest_client
class SchedulerStatsClient(rest_client.RestClient):
api_version = "v2"
def list_pools(self, detail=False):
"""List all the volumes pools (hosts).

View File

@ -20,8 +20,7 @@ from tempest.lib.common import rest_client
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'

View File

@ -19,9 +19,7 @@ from tempest.lib.common import rest_client
class SnapshotManageClient(rest_client.RestClient):
"""Snapshot manage V2 client."""
api_version = "v2"
"""Snapshot manage client."""
def manage_snapshot(self, **kwargs):
"""Manage a snapshot."""

View File

@ -18,8 +18,7 @@ from tempest.lib import exceptions as lib_exc
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):

View File

@ -20,8 +20,7 @@ from tempest.lib.common import rest_client
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.

View File

@ -21,8 +21,7 @@ from tempest.lib import exceptions as lib_exc
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:

View File

@ -19,9 +19,7 @@ from tempest.lib.common import rest_client
class VolumeManageClient(rest_client.RestClient):
"""Volume manage V2 client."""
api_version = "v2"
"""Volume manage client."""
def manage_volume(self, **kwargs):
"""Manage existing volume.

View File

@ -23,8 +23,7 @@ from tempest.lib.services.volume import base_client
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.