linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: mariusz.tkaczyk@linux.intel.com
Cc: linux-raid@vger.kernel.org, heinzm@redhat.com, ncroxon@redhat.com
Subject: [PATCH 16/19] mdadm/tests: 07autoassemble
Date: Wed, 22 May 2024 16:50:53 +0800	[thread overview]
Message-ID: <20240522085056.54818-17-xni@redhat.com> (raw)
In-Reply-To: <20240522085056.54818-1-xni@redhat.com>

This test is used to test stacked array auto assemble.

There are two different cases depends on if array is foreign or not.
If the array is foreign, the stacked array (md0 is on md1 and md2)
can't be assembled with name md0. Because udev rule will run when md1
and md2 are assembled and mdadm -I doesn't specify homehost. So it
will treat stacked array (md0) as foreign array and choose md127 as
the device node name (/dev/md127)

Add the case that stacked array is local.

Signed-off-by: Xiao Ni <xni@redhat.com>
---
 test                        |  2 ++
 tests/07autoassemble        | 37 +++++++++++++++++++++++++++++++++++--
 tests/07autoassemble.broken |  8 --------
 3 files changed, 37 insertions(+), 10 deletions(-)
 delete mode 100644 tests/07autoassemble.broken

diff --git a/test b/test
index f09994e78107..4a88de58fdf5 100755
--- a/test
+++ b/test
@@ -39,6 +39,8 @@ md2=/dev/md2
 # if user doesn't specify minor number, mdadm chooses minor number
 # automatically from 127.
 md127=/dev/md127
+md126=/dev/md126
+md125=/dev/md125
 mdp0=/dev/md_d0
 mdp1=/dev/md_d1
 
diff --git a/tests/07autoassemble b/tests/07autoassemble
index e689be7c4a10..9dc781497070 100644
--- a/tests/07autoassemble
+++ b/tests/07autoassemble
@@ -10,7 +10,14 @@ mdadm -Ss
 mdadm -As -c /dev/null --homehost=testing -vvv
 testdev $md1 1 $mdsize1a 64
 testdev $md2 1 $mdsize1a 64
-testdev $md0 2 $mdsize11a 512
+# md1 and md2 will be incremental assemble by udev rule. And
+# the testing machines' hostname is not testing. The md0 will
+# be considered as a foreign array. It can use 0 as metadata
+# name. md127 will be used
+testdev $md127 2 $mdsize11a 512
+mdadm --stop $md127
+mdadm --zero-superblock $md1
+mdadm --zero-superblock $md2
 mdadm -Ss
 
 mdadm --zero-superblock $dev0 $dev1 $dev2 $dev3
@@ -20,5 +27,31 @@ mdadm -CR $md0 -l0 -n2 $md1 $dev2  --homehost=testing
 mdadm -Ss
 mdadm -As -c /dev/null --homehost=testing -vvv
 testdev $md1 1 $mdsize1a 64
-testdev $md0 1 $[mdsize1a+mdsize11a] 512
+testdev $md127 1 $[mdsize1a+mdsize11a] 512
+mdadm --stop $md127
+mdadm --zero-superblock $md1
+mdadm -Ss
+
+# Don't specify homehost when creating raid and use the test
+# machine's homehost. For super1.2, if homehost name's length
+# is > 32, it doesn't use homehost name in metadata name and
+# the array will be treated as foreign array
+mdadm --zero-superblock $dev0 $dev1 $dev2 $dev3
+mdadm -CR $md1 -l1 -n2 $dev0 $dev1
+mdadm -CR $md2 -l1 -n2 $dev2 $dev3
+mdadm -CR $md0 -l0 -n2 $md1 $md2
+mdadm -Ss
+mdadm -As -c /dev/null
+if [ $is_foreign == "yes" ]; then
+	# md127 is md1
+	testdev $md127 1 $mdsize1a 64
+	# md126 is md0, udev rule incremental assemble it
+	testdev $md126 2 $mdsize11a 512
+	# md125 is md2
+	testdev $md125 1 $mdsize1a 64
+else
+	testdev $md1 1 $mdsize1a 64
+	testdev $md2 1 $mdsize1a 64
+	testdev $md0 2 $mdsize11a 512
+fi
 mdadm -Ss
diff --git a/tests/07autoassemble.broken b/tests/07autoassemble.broken
deleted file mode 100644
index 8be09407f628..000000000000
--- a/tests/07autoassemble.broken
+++ /dev/null
@@ -1,8 +0,0 @@
-always fails
-
-Prints lots of messages, but the array doesn't assemble. Error
-possibly related to:
-
-  mdadm: /dev/md/1 is busy - skipping
-  mdadm: no recogniseable superblock on /dev/md/testing:0
-  mdadm: /dev/md/2 is busy - skipping
-- 
2.32.0 (Apple Git-132)


  parent reply	other threads:[~2024-05-22  8:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  8:50 [PATCH 00/19] mdadm/tests: enhance/fix regression cases Xiao Ni
2024-05-22  8:50 ` [PATCH 01/19] Change some error messages to info level Xiao Ni
2024-05-23 14:20   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 02/19] mdadm: Start update_opt from 0 Xiao Ni
2024-05-23 14:22   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 03/19] Don't control reshape speed in daemon Xiao Ni
2024-05-23 14:25   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 04/19] mdadm/tests: test enhance Xiao Ni
2024-05-23 14:26   ` Mariusz Tkaczyk
2024-05-23 14:39     ` Xiao Ni
2024-05-23 14:52       ` Mariusz Tkaczyk
2024-05-23 14:56   ` Xiao Ni
2024-05-24  7:59   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 05/19] mdadm/tests: test don't fail when systemd reports error Xiao Ni
2024-05-23 14:29   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 06/19] mdadm/tests: names_template enhance Xiao Ni
2024-05-23 14:37   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 07/19] mdadm/tests: 03assem-incr enhance Xiao Ni
2024-05-23 14:39   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 08/19] mdadm/tests 03r0assem enhance Xiao Ni
2024-05-23 14:40   ` Mariusz Tkaczyk
2024-05-22  8:50 ` [PATCH 09/19] mdadm/tests: remove 03r5assem-failed Xiao Ni
2024-05-22  8:50 ` [PATCH 10/19] mdadm/tests: 03r5assemV1 Xiao Ni
2024-05-22  8:50 ` [PATCH 11/19] mdadm/tests: remove 04r5swap.broken Xiao Ni
2024-05-22  8:50 ` [PATCH 12/19] tests/04update-metadata skip linear Xiao Ni
2024-05-22  8:50 ` [PATCH 13/19] mdadm/tests: 05r5-internalbitmap Xiao Ni
2024-05-22  8:50 ` [PATCH 14/19] mdadm/tests: 05r6-bitmapfile Xiao Ni
2024-05-22  8:50 ` [PATCH 15/19] mdadm/tests: 06name enhance Xiao Ni
2024-05-22  8:50 ` Xiao Ni [this message]
2024-05-22  8:50 ` [PATCH 17/19] mdadm/tests: 07autodetect.broken can be removed Xiao Ni
2024-05-22  8:50 ` [PATCH 18/19] mdadm/tests: 07changelevelintr Xiao Ni
2024-05-22  8:50 ` [PATCH 19/19] mdadm/tests: disable selinux Xiao Ni
2024-05-24  8:45 ` [PATCH 00/19] mdadm/tests: enhance/fix regression cases Mariusz Tkaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240522085056.54818-17-xni@redhat.com \
    --to=xni@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=ncroxon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).