testing: Use blockdev instead of partprobe to load partitions

This avoids a dependency on parted as blockdev is in util-linux on
Debian/Ubuntu, which is installed by default.  And it might work more
reliably.
This commit is contained in:
Tobias Brunner
2025-04-10 08:31:09 +02:00
parent 353d5c130b
commit d7305a556f
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ running_any $STRONGSWANHOSTS && die "Please stop test environment before running
SRCUID=${SUDO_UID:-$(id -u)}
SRCGID=${SUDO_GID:-$(id -g)}
check_commands partprobe qemu-img qemu-nbd bindfs
check_commands blockdev qemu-img qemu-nbd bindfs
load_qemu_nbd
@@ -22,7 +22,7 @@ mkdir -p $IMGDIR
log_action "Connecting root image to NBD device $NBDEV"
execute "qemu-nbd -c $NBDEV $ROOTIMG"
do_on_exit qemu-nbd -d $NBDEV
partprobe $NBDEV
blockdev --rereadpt $NBDEV
log_action "Mounting $NBDPARTITION to $LOOPDIR"
execute "mount $NBDPARTITION $LOOPDIR"