From 30a0f6195589717bf1800779b92e41aeadab617e Mon Sep 17 00:00:00 2001 From: illiliti Date: Thu, 5 Aug 2021 08:56:22 +0300 Subject: [PATCH] test/*: fix rare race issue due to qemu-nbd non-blocking mode --- test/bare.test | 4 ++++ test/luks.test | 4 ++++ test/lvm.test | 4 ++++ test/zfs.test | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/test/bare.test b/test/bare.test index ae513d4..1ab6b72 100755 --- a/test/bare.test +++ b/test/bare.test @@ -28,6 +28,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)" qemu-img create -f qcow2 "$image" 1G qemu-nbd -c "$nbd" "$image" +sleep 1 + # o: Create MBR table. # n: Add new partition to table. # p: Primary partition. @@ -104,6 +106,8 @@ fi qemu-nbd -c "$nbd" "$image" +sleep 1 + # Re-read partition table. fdisk "$nbd" << EOF w diff --git a/test/luks.test b/test/luks.test index 1b82838..98f9935 100755 --- a/test/luks.test +++ b/test/luks.test @@ -32,6 +32,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)" qemu-img create -f qcow2 "$image" 1G qemu-nbd -c "$nbd" "$image" +sleep 1 + # o: Create MBR table. # n: Add new partition to table. # p: Primary partition. @@ -116,6 +118,8 @@ fi qemu-nbd -c "$nbd" "$image" +sleep 1 + # Re-read partition table. fdisk "$nbd" << EOF w diff --git a/test/lvm.test b/test/lvm.test index d37b441..9cb407a 100755 --- a/test/lvm.test +++ b/test/lvm.test @@ -33,6 +33,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)" qemu-img create -f qcow2 "$image" 1G qemu-nbd -c "$nbd" "$image" +sleep 1 + # o: Create MBR table. # n: Add new partition to table. # p: Primary partition. @@ -116,6 +118,8 @@ fi qemu-nbd -c "$nbd" "$image" +sleep 1 + # Re-read partition table. fdisk "$nbd" << EOF w diff --git a/test/zfs.test b/test/zfs.test index ffb199c..821d204 100755 --- a/test/zfs.test +++ b/test/zfs.test @@ -31,6 +31,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)" qemu-img create -f qcow2 "$image" 1G qemu-nbd -c "$nbd" "$image" +sleep 1 + # o: Create MBR table. # n: Add new partition to table. # p: Primary partition. @@ -122,6 +124,8 @@ fi qemu-nbd -c "$nbd" "$image" +sleep 1 + # Re-read partition table. fdisk "$nbd" << EOF w