Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/kola/root-reprovision/luks/soft-reboot/config.ign
1 change: 1 addition & 0 deletions tests/kola/root-reprovision/luks/soft-reboot/data
41 changes: 41 additions & 0 deletions tests/kola/root-reprovision/luks/soft-reboot/test.sh
Original file line number Diff line number Diff line change
@@ -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
Comment thread
prestist marked this conversation as resolved.