Skip to content

Commit 67b6c23

Browse files
Adding the external kola test for luks + multipath case
Signed-off-by: Poorna Gottimukkula <[email protected]>
1 parent 82541dc commit 67b6c23

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

tests/kola/root-reprovision/luks/data/luks-test.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ if ! grep -q no_read_workqueue <<< "${table}"; then
2929
fi
3030
ok "discard and custom option enabled for root LUKS"
3131

32-
# while we're here, sanity-check that boot is mounted by UUID
33-
if ! systemctl cat boot.mount | grep -q What=/dev/disk/by-uuid; then
32+
# while we're here, sanity-check that boot is mounted by UUID or by multipath label
33+
if grep -q "rd.multipath=default" /proc/cmdline; then
34+
expected_what=/dev/disk/by-label/dm-mpath-boot
35+
else
36+
expected_what=/dev/disk/by-uuid
37+
fi
38+
if ! systemctl cat boot.mount | grep -q What="${expected_what}"; then
3439
systemctl cat boot.mount
35-
fatal "boot mounted not by UUID"
40+
fatal "boot mounted not by ${expected_what}"
3641
fi
37-
ok "boot mounted by UUID"
42+
ok "boot mounted by ${expected_what}"
3843

3944
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
4045
"")
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
## kola:
3+
## # This test reprovisions the rootfs.
4+
## tags: "reprovision"
5+
## # This uses appendKernelArgs and multipath, which is QEMU only
6+
## platforms: qemu
7+
## # Root reprovisioning requires at least 4GiB of memory.
8+
## minMemory: 4096
9+
## # A TPM backend device is not available on s390x to suport TPM.
10+
## architectures: "! s390x"
11+
## # This test includes a lot of disk I/O and needs a higher
12+
## # timeout value than the default.
13+
## timeoutMin: 15
14+
## description: Verify that LUKS on a mpath disks works.
15+
## primaryDisk: ":mpath"
16+
## appendKernelArgs: "rd.multipath=default"
17+
18+
set -xeuo pipefail
19+
20+
# shellcheck disable=SC1091
21+
. "$KOLA_EXT_DATA/commonlib.sh"
22+
23+
# Check if the child device is part of the parent device
24+
srcdev=$(findmnt -nvr /sysroot -o SOURCE)
25+
parent_device="/dev/mapper/mpatha"
26+
27+
if ! lsblk -pno NAME "$parent_device" | grep -qw "$srcdev"; then
28+
fatal "$srcdev is NOT a child of $parent_device."
29+
fi
30+
ok "$srcdev device is part of the parent $parent_device device"
31+
32+
# run the rest of the tests
33+
. $KOLA_EXT_DATA/luks-test.sh

0 commit comments

Comments
 (0)