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
@@ -8,7 +8,7 @@ DIR=$(dirname `readlink -f $0`)
[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found"
running_any $STRONGSWANHOSTS && die "Please stop test environment before running $0"
check_commands partprobe qemu-img qemu-nbd
check_commands blockdev qemu-img qemu-nbd
load_qemu_nbd
@@ -115,7 +115,7 @@ case "$GUEST" in
esac
do_on_exit qemu-nbd -d $NBDEV
partprobe $NBDEV
blockdev --rereadpt $NBDEV
log_action "Mounting $NBDPARTITION to $LOOPDIR"
execute "mount $NBDPARTITION $LOOPDIR"