diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py index ea3bb5a1e2..107ff57527 100644 --- a/tempest/api/volume/base.py +++ b/tempest/api/volume/base.py @@ -31,6 +31,11 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest, """Base test case class for all Cinder API tests.""" _api_version = 2 + # if api_v2 is not enabled while api_v3 is enabled, the volume v2 classes + # should be transferred to volume v3 classes. + if (not CONF.volume_feature_enabled.api_v2 and + CONF.volume_feature_enabled.api_v3): + _api_version = 3 credentials = ['primary'] @classmethod diff --git a/tempest/clients.py b/tempest/clients.py index ca205c8dec..b06eafbe08 100644 --- a/tempest/clients.py +++ b/tempest/clients.py @@ -234,7 +234,9 @@ class Manager(clients.ServiceClients): self.volumes_client = self.volume_v1.VolumesClient() self.volumes_extension_client = self.volume_v1.ExtensionsClient() - if CONF.volume_feature_enabled.api_v2: + # if only api_v3 is enabled, all these clients should be available + if (CONF.volume_feature_enabled.api_v2 or + CONF.volume_feature_enabled.api_v3): self.backups_v2_client = self.volume_v2.BackupsClient() self.encryption_types_v2_client = \ self.volume_v2.EncryptionTypesClient()