Skip to content

Commit

Permalink
tests/kola: test spec 3.4.0 LUKS discard and openOptions fields
Browse files Browse the repository at this point in the history
Rather than adding a dedicated test for relatively obscure options,
change the rootfs test to enable them, check that it does so, and check
that the existing LUKS /var/log test doesn't do so.  In each case, check
both the first and second boots.

The rootfs is the important case, since its mount flow doesn't read
/etc/crypttab.
  • Loading branch information
bgilbert authored and HuijingHei committed Oct 10, 2023
1 parent 7ec821c commit e424c2d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/kola/root-reprovision/luks/config.ign
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ignition": {
"version": "3.2.0"
"version": "3.4.0"
},
"storage": {
"luks": [
Expand All @@ -10,6 +10,8 @@
"clevis": {
"tpm2": true
},
"discard": true,
"openOptions": ["--perf-no_read_workqueue"],
"label": "root",
"wipeVolume": true
}
Expand Down
9 changes: 9 additions & 0 deletions tests/kola/root-reprovision/luks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ if ! grep prjquota <<< "${rootflags}"; then
fi
ok "root mounted with prjquota"

table=$(dmsetup table myluksdev)
if ! grep -q allow_discards <<< "${table}"; then
fatal "missing allow_discards in root DM table: ${table}"
fi
if ! grep -q no_read_workqueue <<< "${table}"; then
fatal "missing no_read_workqueue in root DM table: ${table}"
fi
ok "discard and custom option enabled for root LUKS"

# while we're here, sanity-check that boot is mounted by UUID
if ! systemctl cat boot.mount | grep -q What=/dev/disk/by-uuid; then
systemctl cat boot.mount
Expand Down
9 changes: 9 additions & 0 deletions tests/kola/var-mount/luks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ blktype=$(lsblk -o TYPE "${src}" --noheadings)
fstype=$(findmnt -nvr /var/log -o FSTYPE)
[[ $fstype == ext4 ]]

table=$(dmsetup table varlog)
if grep -q allow_discards <<< "${table}"; then
fatal "found allow_discards in /var/log DM table: ${table}"
fi
if grep -q no_read_workqueue <<< "${table}"; then
fatal "found no_read_workqueue in /var/log DM table: ${table}"
fi
ok "discard and custom option not enabled for /var/log"

case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
ok "mounted on first boot"
Expand Down

0 comments on commit e424c2d

Please sign in to comment.