tests/lvm: fix checking lvm pool existence

If pool or group name have '-', it will be mangled as '--' in
/dev/mapper. Use /dev/VG_NAME/LV_NAME symlink instead.

Related QubesOS/qubes-issues#4332
This commit is contained in:
Marek Marczykowski-Górecki 2018-10-30 01:17:00 +01:00
parent 1ae6abdff5
commit 15cf593bc5
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -42,7 +42,7 @@ else:
def lvm_pool_exists(volume_group, thin_pool):
''' Returns ``True`` if thin pool exists in the volume group. '''
path = "/dev/mapper/{!s}-{!s}".format(volume_group, thin_pool)
path = "/dev/{!s}/{!s}".format(volume_group, thin_pool)
return os.path.exists(path)