Use create_volume classmethod
There is a wrapper utility for volume creation in BaseV2ComputeTest class.
Change-Id: If009b5e28e9e444e4613459515e7c47b754b8bba
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index d9ee5b1..01cfb5f 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -16,7 +16,6 @@
from testtools import matchers
from tempest.api.compute import base
-from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@@ -42,7 +41,7 @@
@classmethod
def setup_clients(cls):
super(VolumesGetTestJSON, cls).setup_clients()
- cls.client = cls.volumes_extensions_client
+ cls.volumes_client = cls.volumes_extensions_client
@decorators.idempotent_id('f10f25eb-9775-4d9d-9cbe-1cf54dae9d5f')
def test_volume_create_get_delete(self):
@@ -50,22 +49,19 @@
v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
# Create volume
- volume = self.client.create_volume(size=CONF.volume.volume_size,
- display_name=v_name,
- metadata=metadata)['volume']
+ volume = self.create_volume(size=CONF.volume.volume_size,
+ display_name=v_name,
+ metadata=metadata)
self.assertIn('id', volume)
- self.addCleanup(self.delete_volume, volume['id'])
self.assertIn('displayName', volume)
self.assertEqual(volume['displayName'], v_name,
"The created volume name is not equal "
"to the requested name")
self.assertIsNotNone(volume['id'],
"Field volume id is empty or not found.")
- # Wait for Volume status to become ACTIVE
- waiters.wait_for_volume_resource_status(self.client, volume['id'],
- 'available')
# GET Volume
- fetched_volume = self.client.show_volume(volume['id'])['volume']
+ fetched_volume = self.volumes_client.show_volume(
+ volume['id'])['volume']
# Verification of details of fetched Volume
self.assertEqual(v_name,
fetched_volume['displayName'],