1 parent
bfda3e626a
commit
8ad6754328
6 files changed
+301
-47
No files matched your search
Executable → Regular
+7
-6
@@ -137,7 +137,7 @@ EOF
|
||||
}
|
||||
|
||||
test_mount() {
|
||||
echo "=== Testing --mount (9p shares) ==="
|
||||
echo "=== Testing --mount (virtio-fs shares) ==="
|
||||
|
||||
work="$(mktemp -d)"
|
||||
|
||||
@@ -179,12 +179,10 @@ EOF
|
||||
output=$(timeout "$TIMEOUT" "$BOCO_BIN" boot "$img" \
|
||||
--mount "${share_dir}:${guest_dir}" \
|
||||
--mount "${share_dir2}:${guest_dir2}" \
|
||||
--cmd "for f in /sys/bus/virtio/drivers/9pnet_virtio/virtio*/mount_tag; do [ -f \"\$f\" ] && echo \"\$f: \$(tr -d '\\0' < \"\$f\")\"; done; mount -v; cat ${guest_dir}/testfile.txt 2>/dev/null || echo NO_FILE; cat ${guest_dir2}/testfile2.txt 2>/dev/null || echo NO_FILE2; echo MOUNT_VERIFY_DONE; poweroff -f" \
|
||||
--cmd "mount -v; cat ${guest_dir}/testfile.txt 2>/dev/null || echo NO_FILE; cat ${guest_dir2}/testfile2.txt 2>/dev/null || echo NO_FILE2; echo MOUNT_VERIFY_DONE; poweroff -f" \
|
||||
2>&1 || true)
|
||||
|
||||
check_output "$output" "mount_tag: boco0" "--mount 9p share detected"
|
||||
check_output "$output" "mount_tag: boco1" "--mount second 9p share detected"
|
||||
check_output "$output" "type 9p" "--mount 9p filesystem in mount list"
|
||||
check_output "$output" "type virtiofs" "--mount virtiofs filesystem in mount list"
|
||||
check_output "$output" "hello from host" "--mount file accessible at guest path"
|
||||
check_output "$output" "second share" "--mount second file accessible at guest path"
|
||||
check_output "$output" "MOUNT_VERIFY_DONE" "--mount VM ran to completion"
|
||||
@@ -225,11 +223,14 @@ EOF
|
||||
--cmd "mount -v; cat /app/data/relfile.txt 2>/dev/null || echo NO_REL_FILE; echo REL_VERIFY_DONE; poweroff -f" \
|
||||
2>&1 || true)
|
||||
|
||||
check_output "$output" "type 9p" "--mount relative 9p filesystem in mount list"
|
||||
check_output "$output" "type virtiofs" "--mount relative virtiofs filesystem in mount list"
|
||||
check_output "$output" "relative share" "--mount relative file accessible at WORKINGDIR/data"
|
||||
check_output "$output" "REL_VERIFY_DONE" "--mount relative VM ran to completion"
|
||||
|
||||
cleanup "$img" "$img"
|
||||
# Safety net: virtiofsd should exit when QEMU disconnects, but
|
||||
# ensure no daemons linger if a boot failed mid-way.
|
||||
pkill -f virtiofsd 2>/dev/null || true
|
||||
rm -rf "$work"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user