tests: fix removing LVM volumes

VM volumes have 'vm-' name prefix now.
This is continuation of fd5386c storage/lvm: prefix VM LVM volumes with 'vm-'
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-25 05:42:39 +02:00
parent 75394a1348
commit a8e2f3111d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -756,11 +756,11 @@ class SystemTestCase(QubesTestCase):
volumes = subprocess.check_output( volumes = subprocess.check_output(
['sudo', 'lvs', '--noheadings', '-o', 'vg_name,name', ['sudo', 'lvs', '--noheadings', '-o', 'vg_name,name',
'--separator', '/']).decode() '--separator', '/']).decode()
if ('/' + prefix) not in volumes: if ('/vm-' + prefix) not in volumes:
return return
subprocess.check_call(['sudo', 'lvremove', '-f'] + subprocess.check_call(['sudo', 'lvremove', '-f'] +
[vol.strip() for vol in volumes.splitlines() [vol.strip() for vol in volumes.splitlines()
if ('/' + prefix) in vol], if ('/vm-' + prefix) in vol],
stdout=subprocess.DEVNULL) stdout=subprocess.DEVNULL)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
pass pass