tests: fix race condition between mkfs and udev

Just after LVM volume is created, udev tries to analyze it. This
prevents mkfs from creating filesystem there.
This commit is contained in:
Marek Marczykowski-Górecki 2019-02-21 01:23:09 +01:00
parent 50a89aac3f
commit e69bd3c572
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1009,6 +1009,7 @@ class TC_02_StorageHelpers(ThinPoolBase):
'test-file-pool'], stdout=subprocess.DEVNULL)
self.thin_dev = '/dev/{}/test-file-pool'.format(
DEFAULT_LVM_POOL.split('/')[0])
subprocess.check_call(['udevadm', 'settle'])
subprocess.check_call(
['sudo', 'mkfs.ext4', '-q', self.thin_dev])
subprocess.check_call(['sudo', 'mount', self.thin_dev,