From fe85b89d4e8d163594e318c25d34b87248f8d691 Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Tue, 2 Jun 2026 09:36:27 -0400 Subject: [PATCH 1/2] tests/kola: add soft-reboot test for LUKS root encryption Validate that soft-reboot works correctly when the root filesystem is on a LUKS device. This exercises the x-initrd.attach crypttab option added in coreos/ignition#2219. --- .../luks/soft-reboot/config.ign | 1 + .../root-reprovision/luks/soft-reboot/data | 1 + .../root-reprovision/luks/soft-reboot/test.sh | 41 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 120000 tests/kola/root-reprovision/luks/soft-reboot/config.ign create mode 120000 tests/kola/root-reprovision/luks/soft-reboot/data create mode 100755 tests/kola/root-reprovision/luks/soft-reboot/test.sh diff --git a/tests/kola/root-reprovision/luks/soft-reboot/config.ign b/tests/kola/root-reprovision/luks/soft-reboot/config.ign new file mode 120000 index 0000000000..f72ce41f73 --- /dev/null +++ b/tests/kola/root-reprovision/luks/soft-reboot/config.ign @@ -0,0 +1 @@ +../config.ign \ No newline at end of file diff --git a/tests/kola/root-reprovision/luks/soft-reboot/data b/tests/kola/root-reprovision/luks/soft-reboot/data new file mode 120000 index 0000000000..4909e06efb --- /dev/null +++ b/tests/kola/root-reprovision/luks/soft-reboot/data @@ -0,0 +1 @@ +../data \ No newline at end of file diff --git a/tests/kola/root-reprovision/luks/soft-reboot/test.sh b/tests/kola/root-reprovision/luks/soft-reboot/test.sh new file mode 100755 index 0000000000..988ef23136 --- /dev/null +++ b/tests/kola/root-reprovision/luks/soft-reboot/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +## kola: +## # This test reprovisions the rootfs. +## tags: "platform-independent reprovision" +## # Root reprovisioning requires at least 4GiB of memory. +## minMemory: 4096 +## # A TPM backend device is not available on s390x to support TPM. +## architectures: "! s390x" +## # This test includes a lot of disk I/O and needs a higher +## # timeout value than the default. +## timeoutMin: 15 +## description: Verify that soft-reboot works with LUKS root encryption. + +set -xeuo pipefail + +# shellcheck disable=SC1091 +. "$KOLA_EXT_DATA/commonlib.sh" + +case "${AUTOPKGTEST_REBOOT_MARK:-}" in + "") + srcdev=$(findmnt -nvr /sysroot -o SOURCE) + [[ ${srcdev} == /dev/mapper/myluksdev ]] + + blktype=$(lsblk -o TYPE "${srcdev}" --noheadings) + [[ ${blktype} == crypt ]] + ok "root is on LUKS device" + + /tmp/autopkgtest-soft-reboot soft-rebooted + ;; + + soft-rebooted) + srcdev=$(findmnt -nvr /sysroot -o SOURCE) + [[ ${srcdev} == /dev/mapper/myluksdev ]] + + blktype=$(lsblk -o TYPE "${srcdev}" --noheadings) + [[ ${blktype} == crypt ]] + ok "soft-reboot successful with LUKS root" + ;; + + *) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";; +esac From 23c74bacd9539bf64f05baf14d45d3143642b82f Mon Sep 17 00:00:00 2001 From: Steven Presti Date: Thu, 11 Jun 2026 16:04:13 -0400 Subject: [PATCH 2/2] tests/kola: temporarily add x-initrd.attach workaround to soft-reboot test Manually add x-initrd.attach to crypttab if not already present so the test can validate the fix against images that don't yet include coreos/ignition#2219. This commit should be reverted once the Ignition fix is in the base image. --- tests/kola/root-reprovision/luks/soft-reboot/test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/kola/root-reprovision/luks/soft-reboot/test.sh b/tests/kola/root-reprovision/luks/soft-reboot/test.sh index 988ef23136..27af9d26ea 100755 --- a/tests/kola/root-reprovision/luks/soft-reboot/test.sh +++ b/tests/kola/root-reprovision/luks/soft-reboot/test.sh @@ -25,6 +25,14 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in [[ ${blktype} == crypt ]] ok "root is on LUKS device" + # Workaround: manually add x-initrd.attach to crypttab if not + # already present. This can be removed once coreos/ignition#2219 + # is included in the base image. + if ! grep -q x-initrd.attach /etc/crypttab; then + sed -i '/^myluksdev /s/$/,x-initrd.attach/' /etc/crypttab + systemctl daemon-reload + fi + /tmp/autopkgtest-soft-reboot soft-rebooted ;;