diff options
author | PMR <pmr@pmr-lander> | 2021-04-14 09:35:44 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2021-04-14 09:35:44 +0000 |
commit | 39633f7c06b87f10ce6d7b689528747563d05aaf (patch) | |
tree | d664a440db6eed3f0c1d199bdd8cb4eb7cca779b | |
parent | 7ba7e8cfd5885a31dfda4d73342e5beaef35d8ef (diff) | |
parent | 78d3c267a839e6b97aba1c0f57a57afb2237e961 (diff) |
Merge #401067 from ~kissiel/plainbox-provider-checkbox:no-storage-tests-on-unknown-fs
-rwxr-xr-x | bin/storage_test.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/storage_test.py b/bin/storage_test.py index 9efe41f..22110b2 100755 --- a/bin/storage_test.py +++ b/bin/storage_test.py @@ -25,15 +25,18 @@ def mountpoint(device): def find_largest_partition(device): - BlkDev = namedtuple('BlkDev', ['name', 'size', 'type']) - cmd = 'lsblk -b -l -n -o NAME,SIZE,TYPE {}'.format(device) + BlkDev = namedtuple( + 'BlkDev', ['name', 'size', 'type', 'fstype'], + defaults=[None, None, None, None]) + cmd = 'lsblk -b -l -n -o NAME,SIZE,TYPE,FSTYPE {}'.format(device) out = sp.check_output(cmd, shell=True) blk_devs = [BlkDev(*p.strip().split()) for p in out.decode(sys.stdout.encoding).splitlines()] - blk_devs[:] = [bd for bd in blk_devs if bd.type in ('part', 'md')] + blk_devs[:] = [bd for bd in blk_devs if ( + bd.type in ('part', 'md') and bd.fstype is not None)] if not blk_devs: raise SystemExit( - 'ERROR: No partitions found on device {}'.format(device)) + 'ERROR: No suitable partitions found on device {}'.format(device)) blk_devs.sort(key=lambda bd: int(bd.size)) return blk_devs[-1].name |