From f866c40aef35932863d4cb9f22859641227c9b60 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:45:08 +0200 Subject: Adding debian version 0.142. Signed-off-by: Daniel Baumann --- debian/tests/amd64-ata-only | 22 +++++++++ debian/tests/amd64-busybox | 19 ++++++++ debian/tests/amd64-klibc | 19 ++++++++ debian/tests/amd64-panic-shell | 32 +++++++++++++ debian/tests/amd64-separate-usr | 36 +++++++++++++++ debian/tests/amd64-virtio-only | 22 +++++++++ debian/tests/control | 23 +++++++++ debian/tests/test-common | 100 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 273 insertions(+) create mode 100755 debian/tests/amd64-ata-only create mode 100755 debian/tests/amd64-busybox create mode 100755 debian/tests/amd64-klibc create mode 100755 debian/tests/amd64-panic-shell create mode 100755 debian/tests/amd64-separate-usr create mode 100755 debian/tests/amd64-virtio-only create mode 100644 debian/tests/control create mode 100644 debian/tests/test-common (limited to 'debian/tests') diff --git a/debian/tests/amd64-ata-only b/debian/tests/amd64-ata-only new file mode 100755 index 0000000..b91601e --- /dev/null +++ b/debian/tests/amd64-ata-only @@ -0,0 +1,22 @@ +#!/bin/sh -e + +SUPPORTED_FLAVOURS='amd64 generic' +ROOTDISK_QEMU_IF=ide +ROOTDISK_LINUX_NAME=sda +. debian/tests/test-common + +cat >>"${CONFDIR}/initramfs.conf" <"${CONFDIR}/modules" <>"${CONFDIR}/initramfs.conf" <>"${CONFDIR}/initramfs.conf" <>"${CONFDIR}/initramfs.conf" <"${CONFDIR}/modules" <>"${CONFDIR}/initramfs.conf" <"${CONFDIR}/modules" < "${ROOTDIR}/etc/fstab" "/dev/${USRDISK_LINUX_NAME} /usr ext2 defaults 0 2" +USRDIR="$(mktemp -d)" +mv "${ROOTDIR}/usr/"* "${USRDIR}" + +build_rootfs_ext2 +build_fs_ext2 "${USRDIR}" "${USRDISK}" + +run_qemu_amd64 + +# Check that fsck ran on both devices +grep -q "^/dev/${ROOTDISK_LINUX_NAME}: clean," "${OUTPUT}" +grep -q "^/dev/${USRDISK_LINUX_NAME}: clean," "${OUTPUT}" diff --git a/debian/tests/amd64-virtio-only b/debian/tests/amd64-virtio-only new file mode 100755 index 0000000..5cca6da --- /dev/null +++ b/debian/tests/amd64-virtio-only @@ -0,0 +1,22 @@ +#!/bin/sh -e + +SUPPORTED_FLAVOURS='amd64 generic' +ROOTDISK_QEMU_IF=virtio +ROOTDISK_LINUX_NAME=vda +. debian/tests/test-common + +cat >>"${CONFDIR}/initramfs.conf" <"${CONFDIR}/modules" </dev/null | tr ',' '\n' | sed -n 's/^ *linux-image-\([-a-z0-9+.]*\).*/\1/p')" + if [ "$KVER" ]; then + break + fi +done +if [ -z "$KVER" ]; then + echo >&2 "E: Test must set SUPPORTED_FLAVOURS and depend on those flavours" + exit 2 +fi + +if [ -n "${AUTOPKGTEST_TMP}" ]; then + export TMPDIR="${AUTOPKGTEST_TMP}" +fi + +# Skeleton configuration directory +CONFDIR="$(mktemp -d)" +cp conf/initramfs.conf "${CONFDIR}/initramfs.conf" +echo "RESUME=none" >>"${CONFDIR}/initramfs.conf" +touch "${CONFDIR}/modules" +mkdir "${CONFDIR}/scripts" + +# initramfs image file +INITRAMFS="$(mktemp)" + +# root disk image file +ROOTDISK="$(mktemp)" + +# root disk interface type (for qemu) and device name (for Linux) +test -n "${ROOTDISK_QEMU_IF}" || ROOTDISK_QEMU_IF=virtio +test -n "${ROOTDISK_LINUX_NAME}" || ROOTDISK_LINUX_NAME=vda + +# Create a root fs with a trivial userspace +ROOTDIR="$(mktemp -d)" +INIT_MESSAGE='root fs init system started successfully' +for subdir in bin dev lib proc run sbin sys usr usr/bin; do + mkdir "${ROOTDIR}/${subdir}" +done +cat >"${ROOTDIR}/sbin/init" <&1 -b "${blocks}" -N "${inodes}" -U -d "${dir}" "${disk}" +} + +build_rootfs_ext2() { + build_fs_ext2 "${ROOTDIR}" "${ROOTDISK}" +} + +_run_qemu_amd64() { + local extra_params="$*" + + timeout --foreground 60 qemu-system-x86_64 -m 1G -drive "file=${ROOTDISK},if=${ROOTDISK_QEMU_IF},media=disk,format=raw" ${USRDISK:+-drive "file=${USRDISK},if=${USRDISK_QEMU_IF},media=disk,format=raw"} -nographic -no-reboot -kernel "/boot/vmlinuz-${KVER}" -initrd "${INITRAMFS}" -append "root=/dev/${ROOTDISK_LINUX_NAME} ro console=ttyS0,115200 ${extra_params}" | tee "${OUTPUT}" +} + +run_qemu_nocheck_amd64() { + # hide error messages from autopkgtest + _run_qemu_amd64 2>&1 "$@" +} + +run_qemu_amd64() { + _run_qemu_amd64 "panic=-1" + grep -qF "${INIT_MESSAGE}" "${OUTPUT}" +} -- cgit v1.2.3