Skip to content

Commit

Permalink
tests/storage-disks-vm: Sleep after hotplugging block dev
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Aug 14, 2024
1 parent 09d91a0 commit 2cdf2c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/storage-disks-vm
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ echo "==> Checking disk device hotplug support"
lxc config device remove v1 block1rw
lxc config device remove v1 block1ro
lxc config device add v1 block1 disk source="${testRoot}/allowed1/lxd-block-test" readonly=true
sleep 1
# shellcheck disable=SC2016
DISK_DEV="$(basename "$(lxc exec v1 -- readlink -f /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_block1)")"
lxc exec v1 -- sh -c "for i in \$(seq 10); do test -e /sys/block/${DISK_DEV}/ro && break; echo \"Waiting for sys file to appear (\${i}s)\"; sleep 1; done"
Expand Down

0 comments on commit 2cdf2c4

Please sign in to comment.