Fix gate-tempest-dsvm orchestration.stacks.test_volumes failure
Change api tests to use cinder v2 api with devstack.
Cinder v1 API is depricated and disabled[1] by default
with devstack now.
[1]http://docs.openstack.org/developer/devstack/configuration.html
Co-Authored-By: Sirushti Murugesan <sirushti.murugesan@hp.com>
Change-Id: I5c4485a0f1d89a63548b627502be99ce30c0f00b
Closes-Bug: #1500780
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 5b6b0fa..f450b0c 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -50,9 +50,13 @@
cls.servers_client = cls.os.servers_client
cls.keypairs_client = cls.os.keypairs_client
cls.network_client = cls.os.network_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
+
@classmethod
def resource_setup(cls):
super(BaseOrchestrationTest, cls).resource_setup()
diff --git a/tempest/api/orchestration/stacks/test_volumes.py b/tempest/api/orchestration/stacks/test_volumes.py
index 4ba38ad..ae9a411 100644
--- a/tempest/api/orchestration/stacks/test_volumes.py
+++ b/tempest/api/orchestration/stacks/test_volumes.py
@@ -38,10 +38,19 @@
self.assertEqual('available', volume.get('status'))
self.assertEqual(template['resources']['volume']['properties'][
'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('display_description'))
+ 'description'], volume.get(description_field))
self.assertEqual(template['resources']['volume']['properties'][
- 'name'], volume.get('display_name'))
+ 'name'], volume.get(name_field))
def _outputs_verify(self, stack_identifier, template):
self.assertEqual('available',