aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/common/test_openstack_utils.py
diff options
context:
space:
mode:
authorShobhi Jain <shobhi.jain@intel.com>2018-04-06 11:41:54 +0100
committerShobhi Jain <shobhi.jain@intel.com>2018-05-08 08:21:01 +0000
commitbe197a6197e803b6334f2ccf72f561245ef7aac7 (patch)
tree1c270f9a8e3f00c270ed643c64b4e4d7ae08aa4a /yardstick/tests/unit/common/test_openstack_utils.py
parent5c57c5a51f9a492cdb05207ba37a765b425db40f (diff)
Replace cinder get_volume_id with shade client.
Function get_volume_id now uses shade client. JIRA: YARDSTICK-891 Change-Id: I45ae40982a64f677dbbdeb6c9510a0ec9ac973f1 Signed-off-by: Shobhi Jain <shobhi.jain@intel.com>
Diffstat (limited to 'yardstick/tests/unit/common/test_openstack_utils.py')
-rw-r--r--yardstick/tests/unit/common/test_openstack_utils.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/yardstick/tests/unit/common/test_openstack_utils.py b/yardstick/tests/unit/common/test_openstack_utils.py
index 67ca826a5..cc19d98b4 100644
--- a/yardstick/tests/unit/common/test_openstack_utils.py
+++ b/yardstick/tests/unit/common/test_openstack_utils.py
@@ -536,3 +536,25 @@ class GetFlavorTestCase(unittest.TestCase):
'flavor_name_or_id')
mock_logger.error.assert_called_once()
self.assertIsNone(output)
+
+# *********************************************
+# CINDER
+# *********************************************
+
+
+class GetVolumeIDTestCase(unittest.TestCase):
+
+ def test_get_volume_id(self):
+ self.mock_shade_client = mock.Mock()
+ _uuid = uuidutils.generate_uuid()
+ self.mock_shade_client.get_volume_id.return_value = _uuid
+ output = openstack_utils.get_volume_id(self.mock_shade_client,
+ 'volume_name')
+ self.assertEqual(_uuid, output)
+
+ def test_get_volume_id_None(self):
+ self.mock_shade_client = mock.Mock()
+ self.mock_shade_client.get_volume_id.return_value = None
+ output = openstack_utils.get_volume_id(self.mock_shade_client,
+ 'volume_name')
+ self.assertIsNone(output)