tests: Support older versions of lsblk
Our functional tests use lsblk to get the size of a device, and we were using the JSON output that is available on v2.28.2. With this patch we change how we use lsblk and stop requesting JSON output and read normal output. Making us able to use older version of lsblk. Tested with lsblk version 2.23.2
This commit is contained in:
parent
d60078f21c
commit
6ef8ec9a10
@ -170,10 +170,9 @@ class BaseFunctTestCase(unittest2.TestCase):
|
||||
try:
|
||||
while True:
|
||||
try:
|
||||
result = self._root_execute('lsblk', '-o', 'SIZE', '-J',
|
||||
result = self._root_execute('lsblk', '-o', 'SIZE',
|
||||
'-b', vol.local_attach.path)
|
||||
data = json.loads(result)
|
||||
size_bytes = data['blockdevices'][0]['size']
|
||||
size_bytes = result.split()[1]
|
||||
return float(size_bytes) / 1024.0 / 1024.0 / 1024.0
|
||||
# NOTE(geguileo): We can't catch subprocess.CalledProcessError
|
||||
# because somehow we get an instance from a different
|
||||
|
Loading…
Reference in New Issue
Block a user