Skip to content

Commit fe85b89

Browse files
committed
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.
1 parent 0e65992 commit fe85b89

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../config.ign
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../data
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
## kola:
3+
## # This test reprovisions the rootfs.
4+
## tags: "platform-independent reprovision"
5+
## # Root reprovisioning requires at least 4GiB of memory.
6+
## minMemory: 4096
7+
## # A TPM backend device is not available on s390x to support TPM.
8+
## architectures: "! s390x"
9+
## # This test includes a lot of disk I/O and needs a higher
10+
## # timeout value than the default.
11+
## timeoutMin: 15
12+
## description: Verify that soft-reboot works with LUKS root encryption.
13+
14+
set -xeuo pipefail
15+
16+
# shellcheck disable=SC1091
17+
. "$KOLA_EXT_DATA/commonlib.sh"
18+
19+
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
20+
"")
21+
srcdev=$(findmnt -nvr /sysroot -o SOURCE)
22+
[[ ${srcdev} == /dev/mapper/myluksdev ]]
23+
24+
blktype=$(lsblk -o TYPE "${srcdev}" --noheadings)
25+
[[ ${blktype} == crypt ]]
26+
ok "root is on LUKS device"
27+
28+
/tmp/autopkgtest-soft-reboot soft-rebooted
29+
;;
30+
31+
soft-rebooted)
32+
srcdev=$(findmnt -nvr /sysroot -o SOURCE)
33+
[[ ${srcdev} == /dev/mapper/myluksdev ]]
34+
35+
blktype=$(lsblk -o TYPE "${srcdev}" --noheadings)
36+
[[ ${blktype} == crypt ]]
37+
ok "soft-reboot successful with LUKS root"
38+
;;
39+
40+
*) fatal "unexpected mark: ${AUTOPKGTEST_REBOOT_MARK}";;
41+
esac

0 commit comments

Comments
 (0)