Remove remaining usage of cinder v1 API call from Tempest
Cinder v1 API tests have been removed from Tempest
- I04de2d90fe11f8ec4acbfa983bc0ad3aa979f45b
There are few other tests like compute, scenario which makes
call to Cinder v1 API based on api_v1 is configured.
We should cleanup those to go with v2 directly and later
those will be directed to make v2/v3 APIs.
Change-Id: I0685a74a80ff845bd0d787bc43fac1c608ee4710
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index ef13eef..1736463 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -94,10 +94,7 @@
cls.os.security_group_default_rules_client)
cls.versions_client = cls.os.compute_versions_client
- if CONF.volume_feature_enabled.api_v1:
- cls.volumes_client = cls.os.volumes_client
- else:
- cls.volumes_client = cls.os.volumes_v2_client
+ cls.volumes_client = cls.os.volumes_v2_client
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 4e17c3d..8d3d344 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -47,13 +47,8 @@
cls.servers_client = cls.os.servers_client
cls.keypairs_client = cls.os.keypairs_client
cls.networks_client = cls.os.networks_client
- cls.volumes_client = cls.os.volumes_client
cls.images_v2_client = cls.os.image_client_v2
-
- if CONF.volume_feature_enabled.api_v2:
- cls.volumes_client = cls.os.volumes_v2_client
- else:
- cls.volumes_client = cls.os.volumes_client
+ cls.volumes_client = cls.os.volumes_v2_client
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index 86323e1..7ddf7af 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -35,18 +35,10 @@
self.assertEqual('available', volume.get('status'))
self.assertEqual(CONF.volume.volume_size, volume.get('size'))
- # Some volume properties have been renamed with Cinder v2
- if CONF.volume_feature_enabled.api_v2:
- description_field = 'description'
- name_field = 'name'
- else:
- description_field = 'display_description'
- name_field = 'display_name'
-
self.assertEqual(template['resources']['volume']['properties'][
- 'description'], volume.get(description_field))
+ 'description'], volume.get('description'))
self.assertEqual(template['resources']['volume']['properties'][
- 'name'], volume.get(name_field))
+ 'name'], volume.get('name'))
def _outputs_verify(self, stack_identifier, template):
self.assertEqual('available',
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index b2667e5..dcf0de9 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -132,11 +132,7 @@
if volume_backed:
volume_name = data_utils.rand_name(__name__ + '-volume')
volumes_client = clients.volumes_v2_client
- name_field = 'name'
- if not CONF.volume_feature_enabled.api_v2:
- volumes_client = clients.volumes_client
- name_field = 'display_name'
- params = {name_field: volume_name,
+ params = {'name': volume_name,
'imageRef': image_id,
'size': CONF.volume.volume_size}
volume = volumes_client.create_volume(**params)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index d4f0e13..c69010d 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1241,14 +1241,9 @@
@classmethod
def setup_clients(cls):
super(EncryptionScenarioTest, cls).setup_clients()
- if CONF.volume_feature_enabled.api_v2:
- cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
- cls.admin_encryption_types_client =\
- cls.os_adm.encryption_types_v2_client
- else:
- cls.admin_volume_types_client = cls.os_adm.volume_types_client
- cls.admin_encryption_types_client =\
- cls.os_adm.encryption_types_client
+ cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
+ cls.admin_encryption_types_client =\
+ cls.os_adm.encryption_types_v2_client
def create_encryption_type(self, client=None, type_id=None, provider=None,
key_size=None, cipher=None,
diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py
index f580ea6..f04947c 100644
--- a/tempest/scenario/test_volume_migrate_attached.py
+++ b/tempest/scenario/test_volume_migrate_attached.py
@@ -40,10 +40,7 @@
@classmethod
def setup_clients(cls):
super(TestVolumeMigrateRetypeAttached, cls).setup_clients()
- if CONF.volume_feature_enabled.api_v1:
- cls.admin_volume_types_client = cls.os_adm.volume_types_client
- else:
- cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
+ cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
@classmethod
def skip_checks(cls):