summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Kusiak <mateusz.kusiak@intel.com>2024-12-03 10:17:23 +0100
committerMariusz Tkaczyk <mtkaczyk@kernel.org>2024-12-13 10:08:10 +0100
commit49bbc804a8225f21c8e06cbc4f6300bb260c4d25 (patch)
tree11df8d5933a85aa172968a54b1a780a3e4d352c3
parenttests: fix 24raid10deadlock (diff)
downloadmdadm-49bbc804a8225f21c8e06cbc4f6300bb260c4d25.tar.xz
mdadm-49bbc804a8225f21c8e06cbc4f6300bb260c4d25.zip
tests: fix 10ddf-create
There are two issues with 10ddf-create: - get_rootdev() failed if test was run in VM. Simplify and refactor the function. - tests fails at assemble due to segfault. Mark test as broken to clear the CI. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
-rw-r--r--tests/10ddf-create.broken5
-rw-r--r--tests/env-ddf-template6
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/10ddf-create.broken b/tests/10ddf-create.broken
new file mode 100644
index 00000000..0f7d25e5
--- /dev/null
+++ b/tests/10ddf-create.broken
@@ -0,0 +1,5 @@
+Fails due to segmentation fault at assemble.
+
+Too much effort to diagnose this now, marking as broken to make CI clear.
+ ++ /usr/sbin/mdadm -A /dev/md/ddf0 /dev/loop8 /dev/loop9 /dev/loop10 /dev/loop11 /dev/loop12
+ ./test: line 76: 101955 Segmentation fault (core dumped) $mdadm "$@" 2> $targetdir/stderr
diff --git a/tests/env-ddf-template b/tests/env-ddf-template
index 90d7272f..4f4ad0f3 100644
--- a/tests/env-ddf-template
+++ b/tests/env-ddf-template
@@ -3,10 +3,8 @@ sha1_sum() {
}
get_rootdev() {
- local dev=$(stat -c %D /)
- local maj=$(expr $dev : '\(..*\)..')
- local min=${dev#$maj}
- local bd=/dev/$(basename $(readlink /sys/dev/block/$((0x$maj)):$((0x$min))))
+ local part=$(grep ' / ' /proc/mounts | awk '{print $1}')
+ local bd=/dev/$(lsblk -no PKNAME $part)
[ -b $bd ] || exit 1
echo $bd
}