test/*: fix rare race issue due to qemu-nbd non-blocking mode

This commit is contained in:
illiliti 2021-08-05 08:56:22 +03:00
parent 23c277b059
commit 30a0f61955
4 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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