test/*: fix rare race issue due to qemu-nbd non-blocking mode
This commit is contained in:
parent
23c277b059
commit
30a0f61955
@ -28,6 +28,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)"
|
|||||||
qemu-img create -f qcow2 "$image" 1G
|
qemu-img create -f qcow2 "$image" 1G
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# o: Create MBR table.
|
# o: Create MBR table.
|
||||||
# n: Add new partition to table.
|
# n: Add new partition to table.
|
||||||
# p: Primary partition.
|
# p: Primary partition.
|
||||||
@ -104,6 +106,8 @@ fi
|
|||||||
|
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# Re-read partition table.
|
# Re-read partition table.
|
||||||
fdisk "$nbd" << EOF
|
fdisk "$nbd" << EOF
|
||||||
w
|
w
|
||||||
|
@ -32,6 +32,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)"
|
|||||||
qemu-img create -f qcow2 "$image" 1G
|
qemu-img create -f qcow2 "$image" 1G
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# o: Create MBR table.
|
# o: Create MBR table.
|
||||||
# n: Add new partition to table.
|
# n: Add new partition to table.
|
||||||
# p: Primary partition.
|
# p: Primary partition.
|
||||||
@ -116,6 +118,8 @@ fi
|
|||||||
|
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# Re-read partition table.
|
# Re-read partition table.
|
||||||
fdisk "$nbd" << EOF
|
fdisk "$nbd" << EOF
|
||||||
w
|
w
|
||||||
|
@ -33,6 +33,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)"
|
|||||||
qemu-img create -f qcow2 "$image" 1G
|
qemu-img create -f qcow2 "$image" 1G
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# o: Create MBR table.
|
# o: Create MBR table.
|
||||||
# n: Add new partition to table.
|
# n: Add new partition to table.
|
||||||
# p: Primary partition.
|
# p: Primary partition.
|
||||||
@ -116,6 +118,8 @@ fi
|
|||||||
|
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# Re-read partition table.
|
# Re-read partition table.
|
||||||
fdisk "$nbd" << EOF
|
fdisk "$nbd" << EOF
|
||||||
w
|
w
|
||||||
|
@ -31,6 +31,8 @@ initrd="${tmpdir}/initramfs-$(uname -r)"
|
|||||||
qemu-img create -f qcow2 "$image" 1G
|
qemu-img create -f qcow2 "$image" 1G
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# o: Create MBR table.
|
# o: Create MBR table.
|
||||||
# n: Add new partition to table.
|
# n: Add new partition to table.
|
||||||
# p: Primary partition.
|
# p: Primary partition.
|
||||||
@ -122,6 +124,8 @@ fi
|
|||||||
|
|
||||||
qemu-nbd -c "$nbd" "$image"
|
qemu-nbd -c "$nbd" "$image"
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
# Re-read partition table.
|
# Re-read partition table.
|
||||||
fdisk "$nbd" << EOF
|
fdisk "$nbd" << EOF
|
||||||
w
|
w
|
||||||
|
Loading…
Reference in New Issue
Block a user