diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-06-28 07:23:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-06-28 07:23:59 +0000 |
commit | 07107afe36c49a43f21c29899a5084e42392864f (patch) | |
tree | 9cb676e7b2629cf6f82f1dee951def39626a509a /yardstick/tests | |
parent | e497db05d20ca19eeea41887362493eefa60d641 (diff) | |
parent | cfccf4a09a8c692702f44763b7597d4c236116f3 (diff) |
Merge "Replace cinder get_volume_id with shade client." into stable/fraser
Diffstat (limited to 'yardstick/tests')
-rw-r--r-- | yardstick/tests/unit/common/test_openstack_utils.py | 22 |
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 81bcd8c33..bfd73de72 100644 --- a/yardstick/tests/unit/common/test_openstack_utils.py +++ b/yardstick/tests/unit/common/test_openstack_utils.py @@ -511,3 +511,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) |