tests: force reloading partition table after setting partitioned loop dev

Apparently "losetup -P" doesn't always properly read partition table.
Force reload using blockdev --rereadpt.
This commit is contained in:
Marek Marczykowski-Górecki 2016-05-17 23:39:01 +02:00
parent 405fd40aaa
commit 6311eec6fd
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -234,6 +234,7 @@ class TC_00_List(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
"echo ,,L | sfdisk {path};"
"loopdev=`losetup -f`; "
"losetup -P $loopdev {path}; "
"blockdev --rereadpt $loopdev; "
"udevadm settle".format(path=self.img_path), user="root")
dev_list = qubes.qubesutils.block_list_vm(self.vm)
@ -260,6 +261,7 @@ class TC_00_List(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
"echo ,,L | sfdisk {path};"
"loopdev=`losetup -f`; "
"losetup -P $loopdev {path}; "
"blockdev --rereadpt $loopdev; "
"mkfs.ext4 -q -F ${{loopdev}}p1; "
"mkdir -p {mntdir}; "
"mount ${{loopdev}}p1 {mntdir}; "