Cleanup: unneeded client definition, API override
- do not redefine a few variables for volume(admin and not) and backup clients
when already defined in the base classes;
- define cls.admin_volume_client (same name as in tempest) rather then
admin_volumes_client in the base class for admin volume tests;
- remove any usage and override of _api_version, which is not really used
in the plugin, and it was also removed in tempest (see
I6e05fbe21b29efa128fb59d16bf521d551b00304 )
Even if unused, _api_version still pointed to the deprecated version 2
for consistency group tests.
Change-Id: I3164662932a302b87ae2f346c0005bf7d0ab2927
diff --git a/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py b/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py
index 7dff494..42c78f1 100644
--- a/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py
+++ b/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py
@@ -28,9 +28,7 @@
class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest):
@classmethod
def setup_clients(cls):
- cls._api_version = 2
super(ConsistencyGroupsV2Test, cls).setup_clients()
- cls.admin_volume_client = cls.os_admin.volumes_v2_client
manager = cinder_clients.Manager(cls.os_admin)
cls.consistencygroups_adm_client = manager.consistencygroups_adm_client
diff --git a/cinder_tempest_plugin/api/volume/admin/test_volume_backup.py b/cinder_tempest_plugin/api/volume/admin/test_volume_backup.py
index e5ded52..41cfc91 100644
--- a/cinder_tempest_plugin/api/volume/admin/test_volume_backup.py
+++ b/cinder_tempest_plugin/api/volume/admin/test_volume_backup.py
@@ -24,13 +24,6 @@
class VolumesBackupsTest(base.BaseVolumeAdminTest):
@classmethod
- def setup_clients(cls):
- super(VolumesBackupsTest, cls).setup_clients()
- cls.admin_volume_client = cls.os_admin.volumes_client_latest
- cls.backups_client = cls.os_primary.backups_client_latest
- cls.volumes_client = cls.os_primary.volumes_client_latest
-
- @classmethod
def skip_checks(cls):
super(VolumesBackupsTest, cls).skip_checks()
if not CONF.volume_feature_enabled.backup:
diff --git a/cinder_tempest_plugin/api/volume/base.py b/cinder_tempest_plugin/api/volume/base.py
index 40bfb33..21da190 100644
--- a/cinder_tempest_plugin/api/volume/base.py
+++ b/cinder_tempest_plugin/api/volume/base.py
@@ -165,7 +165,7 @@
cls.admin_volume_types_client = cls.os_admin.volume_types_client_latest
cls.admin_backups_client = cls.os_admin.backups_client_latest
- cls.admin_volumes_client = cls.os_admin.volumes_client_latest
+ cls.admin_volume_client = cls.os_admin.volumes_client_latest
@classmethod
def create_volume_type(cls, name=None, **kwargs):
@@ -188,12 +188,12 @@
type_id = volume_type['id']
type_name = volume_type['name']
- volumes = cls.admin_volumes_client.list_volumes(
+ volumes = cls.admin_volume_client.list_volumes(
detail=True, params={'all_tenants': 1})['volumes']
for volume in [v for v in volumes if v['volume_type'] == type_name]:
test_utils.call_and_ignore_notfound_exc(
- cls.admin_volumes_client.delete_volume, volume['id'])
- cls.admin_volumes_client.wait_for_resource_deletion(volume['id'])
+ cls.admin_volume_client.delete_volume, volume['id'])
+ cls.admin_volume_client.wait_for_resource_deletion(volume['id'])
test_utils.call_and_ignore_notfound_exc(
cls.admin_volume_types_client.delete_volume_type, type_id)
diff --git a/cinder_tempest_plugin/api/volume/test_volume_revert.py b/cinder_tempest_plugin/api/volume/test_volume_revert.py
index bf3d806..2c4d6bd 100644
--- a/cinder_tempest_plugin/api/volume/test_volume_revert.py
+++ b/cinder_tempest_plugin/api/volume/test_volume_revert.py
@@ -35,7 +35,6 @@
@classmethod
def setup_clients(cls):
- cls._api_version = 3
super(VolumeRevertTests, cls).setup_clients()
manager = cinder_clients.Manager(cls.os_primary)