Skip to content

Commit

Permalink
testing/mdadm: Add guess test
Browse files Browse the repository at this point in the history
The test checks that guess only adds mdadm and does not add multipath,
luks, lvm. In the testcase the /sys/../dm/uuid is empty, which previously
broke the logic.

Signed-off-by: Alexey Gladkov <[email protected]>
  • Loading branch information
legionus committed Aug 6, 2024
1 parent cf60c9f commit 0834246
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
30 changes: 30 additions & 0 deletions features/mdadm/tests/ts0001-guess-ignore-multipath/expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
mi-bug-report: WARNING: There are no modules in the directory: /lib/modules/6.6.41-un-def-alt0.p11.1/kernel
RUN: guess/root/action
TRACE function: source=features/mdadm/guess/device: main guess_variable: MDADM_EXTRA_PROGS mdmon
TRACE function: source=features/mdadm/guess/device: main guess_modalias: md-raid0
TRACE function: source=features/mdadm/guess/device: main guess_modalias: efivarfs
TRACE function: source=features/mdadm/guess/device: main guess_feature: mdadm
TRACE function: source=features/mdadm/guess/device: main guess_variable: GENERATE_UDEV_RULES_FOR_MD_DEVICE 9:126
TRACE function: source=features/devmapper/guess/device: main guess_feature: devmapper
TRACE function: source=features/rootfs/guess/fstype: main guess_modalias: fs-ext4
RUN: guess-config
GENERATE_UDEV_RULES_FOR_MD_DEVICE = \
9:126
MDADM_EXTRA_PROGS = \
mdmon
MOUNTPOINTS = \
/

MODULES_ADD += \
efivarfs fs-ext4 md-raid0 \
pci:v00002646d00005017sv00002646sd00005017bc01sc08i02 \
pci:v00002646d0000501Dsv00002646sd0000501Dbc01sc08i02 \
pci:v00008086d0000464Dsv00000000sd00000000bc06sc04i00 \
pci:v00008086d0000467Fsv00008086sd00000000bc01sc04i00 \
pci:v00008086d00007AC4sv00000000sd00000000bc06sc04i00 \
pci:v00008086d00007AC8sv00000000sd00000000bc06sc04i00

FEATURES += \
add-modules add-udev-rules devmapper mdadm rootfs

rc=0
Binary file not shown.
21 changes: 21 additions & 0 deletions features/mdadm/tests/ts0001-guess-ignore-multipath/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -eu

[ -z "${IGNORE_UNPRIV_USERNS_TESTS-}" ] ||
exit 127

cwd="${0%/*}"

export GUESS_SUFFIX=add:guess-root
export TEST_GUESS_ACTIONS="guess/root/action guess-config"

export RESOLVE_MODALIAS=
export KERNEL_CONFIG=/dev/null

export MAKE_INITRD_TRACE=1
export MAKE_INITRD_TRACE_PIDS=
export MAKE_INITRD_TRACE_EXECUTE_PATTERNS='guess/root/action'
export MAKE_INITRD_TRACE_SRC_PATTERNS='features/*/guess/* features/rootfs/guess/fstype'
export MAKE_INITRD_TRACE_RUN_PATTERNS='*'

utils/mi-bug-report "$cwd/rootfs.tar.xz" -- \
.build/dest/usr/sbin/make-initrd --no-depmod -k '6.6.41-un-def-alt0.p11.1' test-guess

0 comments on commit 0834246

Please sign in to comment.