| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
SUPPORTED_FLAVOURS='amd64 arm64 armmp powerpc64le s390x generic' |
| 5 |
ROOTDISK_QEMU_IF=virtio |
| 6 |
ROOTDISK_LINUX_NAME="/dev/nonexistent" |
| 7 |
. debian/tests/test-common |
| 8 |
|
| 9 |
cat >>"${CONFDIR}/initramfs.conf" <<EOF |
| 10 |
MODULES=list |
| 11 |
BUSYBOX=n |
| 12 |
FSTYPE=ext2 |
| 13 |
EOF |
| 14 |
cat >"${CONFDIR}/modules" <<EOF |
| 15 |
ext2 |
| 16 |
virtio_pci |
| 17 |
virtio_blk |
| 18 |
EOF |
| 19 |
build_initramfs |
| 20 |
|
| 21 |
build_rootfs_ext2 |
| 22 |
|
| 23 |
run_qemu_nocheck |
| 24 |
check_no_network_configuration |
| 25 |
grep -qF "ALERT! /dev/nonexistent does not exist. Dropping to a shell!" "${OUTPUT}" |
| 26 |
grep -qF "(initramfs) " "${OUTPUT}" |
| 27 |
|
| 28 |
run_qemu_nocheck "panic=-1" |
| 29 |
check_no_network_configuration |
| 30 |
grep -qF "Rebooting automatically due to panic= boot argument" "${OUTPUT}" |
| 31 |
! grep -qF "(initramfs) " "${OUTPUT}" || { echo "Error: '(initramfs) ' found in output log!" >&2; exit 1; } |
| 32 |
|
| 33 |
run_qemu_nocheck "panic=0" |
| 34 |
check_no_network_configuration |
| 35 |
grep -qF "Halting automatically due to panic= boot argument" "${OUTPUT}" |
| 36 |
! grep -qF "(initramfs) " "${OUTPUT}" || { echo "Error: '(initramfs) ' found in output log!" >&2; exit 1; } |