diff options
author | Prashanth Pai <ppai@redhat.com> | 2018-01-11 17:53:08 +0530 |
---|---|---|
committer | Prashanth Pai <ppai@redhat.com> | 2018-01-11 17:53:27 +0530 |
commit | b5073b090535744608164e266badba919298f894 (patch) | |
tree | 2a3803cb22c74acabebc2462458cd84bcc49b7d1 /test/functional/libgfapi-python-tests.py | |
parent | b125ff3e83283f231295873118ed7a170f4284d1 (diff) |
Add get_volume_id() API
Change-Id: Ia4c378c5b1657bb4ec23c7057c7cbc49c1b31484
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'test/functional/libgfapi-python-tests.py')
-rw-r--r-- | test/functional/libgfapi-python-tests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/libgfapi-python-tests.py b/test/functional/libgfapi-python-tests.py index c209302..58bda89 100644 --- a/test/functional/libgfapi-python-tests.py +++ b/test/functional/libgfapi-python-tests.py @@ -15,6 +15,7 @@ import types import errno import hashlib import threading +import uuid from test import get_test_config from ConfigParser import NoSectionError, NoOptionError from uuid import uuid4 @@ -1159,3 +1160,17 @@ class TestVolumeInit(unittest.TestCase): self.assertTrue(vol.mounted) vol.umount() self.assertFalse(vol.mounted) + + def test_get_volume_id(self): + vol = Volume(HOST, VOLNAME) + vol.mount() + self.assertTrue(vol.mounted) + self.assertTrue(vol.volid == None) + volid = vol.get_volume_id() + self.assertTrue(volid != None) + try: + volid = uuid.UUID(str(volid)) + except ValueError: + self.fail("Invalid UUID") + self.assertTrue(vol.volid != None) + vol.umount() |