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
@@ -9,7 +9,7 @@ running_any $STRONGSWANHOSTS && die "Please stop test environment before running
[ -n "$1" ] || die "$0 <image to mount: base|root|<guest>>"
check_commands partprobe qemu-nbd
check_commands blockdev qemu-nbd
load_qemu_nbd
@@ -42,7 +42,7 @@ root)
esac
do_on_exit qemu-nbd -d $NBDEV
partprobe $NBDEV
blockdev --rereadpt $NBDEV
log_action "Mounting $NBDPARTITION to $LOOPDIR"
execute "mount $NBDPARTITION $LOOPDIR"