summaryrefslogtreecommitdiffstats
path: root/debian/tests/amd64-separate-usr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:29:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 10:29:49 +0000
commit67c56c3a28638e52dcb16c58f910682579367093 (patch)
tree4e18c10d4dc8f987a1ea77be8aebf2075ac4930c /debian/tests/amd64-separate-usr
parentAdding upstream version 0.140. (diff)
downloadinitramfs-tools-debian.tar.xz
initramfs-tools-debian.zip
Adding debian version 0.140.debian/0.140debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/amd64-separate-usr')
-rwxr-xr-xdebian/tests/amd64-separate-usr36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/tests/amd64-separate-usr b/debian/tests/amd64-separate-usr
new file mode 100755
index 0000000..1a30152
--- /dev/null
+++ b/debian/tests/amd64-separate-usr
@@ -0,0 +1,36 @@
+#!/bin/sh -e
+
+SUPPORTED_FLAVOURS='amd64 generic'
+ROOTDISK_QEMU_IF=virtio
+ROOTDISK_LINUX_NAME=vda
+USRDISK="$(mktemp)"
+USRDISK_QEMU_IF=virtio
+USRDISK_LINUX_NAME=vdb
+. 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
+
+# Set up /usr filesystem and fstab entry for it
+mkdir -p "${ROOTDIR}/etc"
+echo > "${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}"