Skip to contentSkip to conversation

mdadm: regression tests fix

PATCH New Xiao Ni 1 participant 5 messages Mar 11, 2025 MD RAID

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

cover mdadm: regression tests fix

This patch set is used to make regression tests pass without errors. It needs to use --skip-broken to skip tests which are marked as failure.

The PR is https://github.com/md-raid-utilities/mdadm/pull/153

Xiao Ni (4):
mdadm/tests: Mark 07revert-inplace broken
mdadm/tests: Mark 20raid5journal fail
mdadm/tests: ddf template fix
mdadm/tests: Remove 10ddf-create.broken and
10ddf-fail-two-spares.broken

 tests/07revert-inplace.broken      |  8 ++++++++
 tests/10ddf-create.broken          |  5 -----
 tests/10ddf-fail-two-spares.broken |  5 -----
 tests/20raid5journal.broken        | 17 +++++++++++++++++
 tests/env-ddf-template             |  3 +--
 util.c                             |  2 +-
 6 files changed, 27 insertions(+), 13 deletions(-)
 create mode 100644 tests/07revert-inplace.broken
 delete mode 100644 tests/10ddf-create.broken
 delete mode 100644 tests/10ddf-fail-two-spares.broken
 create mode 100644 tests/20raid5journal.broken
Signature · 1 line
2.32.0 (Apple Git-132)
author
#1 lore raw

PATCH 1/4 mdadm/tests: Mark 07revert-inplace broken

07revert-inplace can't run successfullly.

---
 tests/07revert-inplace.broken | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 tests/07revert-inplace.broken
tests/07revert-inplace.broken new file +8 -0
new file mode 100644
index 000000000000..73d98a0425b4
@@ -0,0 +1,8 @@
+always fails
+
+Fails with errors:
+	++ /usr/sbin/mdadm -A /dev/md0 --update=revert-reshape /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 --backup-file=/tmp/md-backup
+++ rv=1
+++ case $* in
+++ cat /var/tmp/stderr
+mdadm: failed to RUN_ARRAY /dev/md0: Invalid argument
Signature · 1 line
2.32.0 (Apple Git-132)
author
#2 lore raw

PATCH 2/4 mdadm/tests: Mark 20raid5journal fail

In reply to Xiao Ni

20raid5journal can't run successfully

---
 tests/20raid5journal.broken | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 tests/20raid5journal.broken
tests/20raid5journal.broken new file +17 -0
new file mode 100644
index 000000000000..c7b214af5f9f
@@ -0,0 +1,17 @@
+always fail
+
+++ /usr/sbin/mdadm -I /dev/loop4
+++ rv=0
+++ case $* in
+++ cat /var/tmp/stderr
+mdadm: /dev/loop4 attached to /dev/md/0_0, which has been started.
+++ return 0
+++ check raid5
+++ case $1 in
+++ grep -sq 'active raid5 ' /proc/mdstat
+++ die 'active raid5 not found'
+++ echo -e '\n\tERROR: active raid5 not found \n'
+
+        ERROR: active raid5 not found
+
+++ save_log fail
Signature · 1 line
2.32.0 (Apple Git-132)
author
#3 lore raw

PATCH 3/4 mdadm/tests: ddf template fix

In reply to Xiao Ni

If it's a device mapper device, bd is null. So use the result from /proc/mounts directly.

For example:
grep ' / ' /proc/mounts | awk '{print }' -> /dev/mapper/rhel_storageqe--104-root
lsblk -no PKNAME /dev/mapper/rhel_storageqe--104-root -> null

---
 tests/env-ddf-template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tests/env-ddf-template +1 -2
index 4f4ad0f32c0c..ebc0ebf3ab1e 100644
@@ -3,8 +3,7 @@ sha1_sum() {
 }
 
 get_rootdev() {
-    local part=$(grep ' / ' /proc/mounts | awk '{print $1}')
-    local bd=/dev/$(lsblk -no PKNAME $part)
+    local bd=$(grep ' / ' /proc/mounts | awk '{print $1}')
     [ -b $bd ] || exit 1
     echo $bd
 }
Signature · 1 line
2.32.0 (Apple Git-132)
author
#4 lore raw

PATCH 4/4 mdadm/tests: Remove 10ddf-create.broken and 10ddf-fail-two-spares.broken

In reply to Xiao Ni

In env-ddf-template, it uses MDADM_NO_SYSTEMCTL=1. But in continue_via_systemd it returns MDADM_STATUS_SUCCESS, so mdadm doesn't start mdmon itself.

---
 tests/10ddf-create.broken          | 5 -----
 tests/10ddf-fail-two-spares.broken | 5 -----
 util.c                             | 2 +-
 3 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 tests/10ddf-create.broken
 delete mode 100644 tests/10ddf-fail-two-spares.broken
tests/10ddf-create.broken deleted +0 -5
deleted file mode 100644
index 0f7d25e5b120..000000000000
@@ -1,5 +0,0 @@
-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
tests/10ddf-fail-two-spares.broken deleted +0 -5
deleted file mode 100644
index eeea56d989ff..000000000000
@@ -1,5 +0,0 @@
-fails infrequently
-
-Fails roughly 1 in 3 with error:
-
-   ERROR: /dev/md/vol1 should be optimal in meta data
util.c +1 -1
index 8c45f0e1feaf..9fe2d2276712 100644
@@ -2310,7 +2310,7 @@ mdadm_status_t continue_via_systemd(char *devnm, char *service_name, char *prefi
 	dprintf("Start %s service\n", service_name);
 	/* Simply return that service cannot be started */
 	if (check_env("MDADM_NO_SYSTEMCTL"))
-		return MDADM_STATUS_SUCCESS;
+		return MDADM_STATUS_ERROR;
 
 	/* Fork in attempt to start services */
 	switch (fork()) {
Signature · 1 line
2.32.0 (Apple Git-132)