summaryrefslogtreecommitdiffstats
path: root/debian/tests/qemu-panic-shell
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:43:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:43:00 +0000
commit6032561e9b12b99fa51b4b38bdeee7f831adcaee (patch)
tree30d9958682cf814635ba3fcfe6457463fed91383 /debian/tests/qemu-panic-shell
parentAdding upstream version 0.143. (diff)
downloadinitramfs-tools-6032561e9b12b99fa51b4b38bdeee7f831adcaee.tar.xz
initramfs-tools-6032561e9b12b99fa51b4b38bdeee7f831adcaee.zip
Adding debian version 0.143.debian/0.143debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/qemu-panic-shell')
-rwxr-xr-xdebian/tests/qemu-panic-shell35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/tests/qemu-panic-shell b/debian/tests/qemu-panic-shell
new file mode 100755
index 0000000..296010f
--- /dev/null
+++ b/debian/tests/qemu-panic-shell
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+SUPPORTED_FLAVOURS='amd64 arm64 armmp powerpc64 s390x generic'
+ROOTDISK_QEMU_IF=virtio
+ROOTDISK_LINUX_NAME=nonexistent
+. debian/tests/test-common
+
+cat >>"${CONFDIR}/initramfs.conf" <<EOF
+MODULES=list
+BUSYBOX=n
+FSTYPE=ext2
+EOF
+cat >"${CONFDIR}/modules" <<EOF
+ext2
+virtio_pci
+virtio_blk
+EOF
+build_initramfs
+
+build_rootfs_ext2
+
+run_qemu_nocheck
+check_no_network_configuration
+grep -qF "ALERT! /dev/nonexistent does not exist. Dropping to a shell!" "${OUTPUT}"
+grep -qF "(initramfs) " "${OUTPUT}"
+
+run_qemu_nocheck "panic=-1"
+check_no_network_configuration
+grep -qF "Rebooting automatically due to panic= boot argument" "${OUTPUT}"
+! grep -qF "(initramfs) " "${OUTPUT}"
+
+run_qemu_nocheck "panic=0"
+check_no_network_configuration
+grep -qF "Halting automatically due to panic= boot argument" "${OUTPUT}"
+! grep -qF "(initramfs) " "${OUTPUT}"