mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 15:39:08 +00:00
test: Check that the network is not configured
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
parent
febab1cc76
commit
f9dbdc628f
1
debian/tests/qemu-ata-only
vendored
1
debian/tests/qemu-ata-only
vendored
@ -21,3 +21,4 @@ build_initramfs
|
||||
build_rootfs_ext2
|
||||
|
||||
run_qemu
|
||||
check_no_network_configuration
|
||||
|
||||
1
debian/tests/qemu-busybox
vendored
1
debian/tests/qemu-busybox
vendored
@ -15,6 +15,7 @@ lsinitramfs "${INITRAMFS}" | grep -qw busybox
|
||||
build_rootfs_ext2
|
||||
|
||||
run_qemu
|
||||
check_no_network_configuration
|
||||
|
||||
# Check that fsck ran
|
||||
grep -q "^/dev/${ROOTDISK_LINUX_NAME}: clean," "${OUTPUT}"
|
||||
|
||||
1
debian/tests/qemu-klibc
vendored
1
debian/tests/qemu-klibc
vendored
@ -15,6 +15,7 @@ build_initramfs
|
||||
build_rootfs_ext2
|
||||
|
||||
run_qemu
|
||||
check_no_network_configuration
|
||||
|
||||
# Check that fsck ran
|
||||
grep -q "^/dev/${ROOTDISK_LINUX_NAME}: clean," "${OUTPUT}"
|
||||
|
||||
3
debian/tests/qemu-panic-shell
vendored
3
debian/tests/qemu-panic-shell
vendored
@ -20,13 +20,16 @@ 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}"
|
||||
|
||||
1
debian/tests/qemu-separate-usr
vendored
1
debian/tests/qemu-separate-usr
vendored
@ -30,6 +30,7 @@ build_rootfs_ext2
|
||||
build_fs_ext2 "${USRDIR}" "${USRDISK}"
|
||||
|
||||
run_qemu
|
||||
check_no_network_configuration
|
||||
|
||||
# Check that fsck ran on both devices
|
||||
grep -q "^/dev/${ROOTDISK_LINUX_NAME}: clean," "${OUTPUT}"
|
||||
|
||||
1
debian/tests/qemu-virtio-only
vendored
1
debian/tests/qemu-virtio-only
vendored
@ -20,3 +20,4 @@ build_initramfs
|
||||
build_rootfs_ext2
|
||||
|
||||
run_qemu
|
||||
check_no_network_configuration
|
||||
|
||||
12
debian/tests/test-common
vendored
12
debian/tests/test-common
vendored
@ -162,3 +162,15 @@ run_qemu() {
|
||||
_run_qemu "panic=-1"
|
||||
grep -qF "${INIT_MESSAGE}" "${OUTPUT}"
|
||||
}
|
||||
|
||||
check_no_output() {
|
||||
local msg="$1"
|
||||
if grep -qF "${msg}" "${OUTPUT}"; then
|
||||
echo >&2 "E: Message '${msg}' found in log output '${OUTPUT}."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_no_network_configuration() {
|
||||
check_no_output "Waiting up to 180 secs for"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user