summaryrefslogtreecommitdiffstats
path: root/debian/tests/amd64-panic-shell
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:45:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:45:08 +0000
commitf866c40aef35932863d4cb9f22859641227c9b60 (patch)
tree916091dcb4e1c863c6e666133f0d32244e2d84eb /debian/tests/amd64-panic-shell
parentAdding upstream version 0.142. (diff)
downloadinitramfs-tools-f866c40aef35932863d4cb9f22859641227c9b60.tar.xz
initramfs-tools-f866c40aef35932863d4cb9f22859641227c9b60.zip
Adding debian version 0.142.debian/0.142debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/amd64-panic-shell')
-rwxr-xr-xdebian/tests/amd64-panic-shell32
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/tests/amd64-panic-shell b/debian/tests/amd64-panic-shell
new file mode 100755
index 0000000..ad42f8f
--- /dev/null
+++ b/debian/tests/amd64-panic-shell
@@ -0,0 +1,32 @@
+#!/bin/sh -e
+
+SUPPORTED_FLAVOURS='amd64 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_amd64
+grep -qF "ALERT! /dev/nonexistent does not exist. Dropping to a shell!" "${OUTPUT}"
+grep -qF "(initramfs) " "${OUTPUT}"
+
+run_qemu_nocheck_amd64 "panic=-1"
+grep -qF "Rebooting automatically due to panic= boot argument" "${OUTPUT}"
+! grep -qF "(initramfs) " "${OUTPUT}"
+
+run_qemu_nocheck_amd64 "panic=0"
+grep -qF "Halting automatically due to panic= boot argument" "${OUTPUT}"
+! grep -qF "(initramfs) " "${OUTPUT}"