diff mbox series

[15/19] mdadm/tests: 06name enhance

Message ID 20240522085056.54818-16-xni@redhat.com (mailing list archive)
State Accepted
Headers show
Series mdadm/tests: enhance/fix regression cases | expand

Commit Message

Xiao Ni May 22, 2024, 8:50 a.m. UTC
It needs to check hostname in metadata name if one array is
local. Add the check in this case.

Signed-off-by: Xiao Ni <xni@redhat.com>
---
 tests/06name | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/06name b/tests/06name
index 86eaab69e3a1..c3213f6c9f7b 100644
--- a/tests/06name
+++ b/tests/06name
@@ -3,8 +3,14 @@  set -x
 # create an array with a name
 
 mdadm -CR $md0 -l0 -n2 --metadata=1 --name="Fred" $dev0 $dev1
-mdadm -E $dev0 | grep 'Name : Fred' > /dev/null || exit 1
-mdadm -D $md0 | grep 'Name : Fred' > /dev/null || exit 1
+
+if [ $is_foreign == "no" ]; then
+	mdadm -E $dev0 | grep "Name : $(hostname):Fred" > /dev/null || exit 1
+	mdadm -D $md0 | grep "Name : $(hostname):Fred" > /dev/null || exit 1
+else
+	mdadm -E $dev0 | grep "Name : Fred" > /dev/null || exit 1
+	mdadm -D $md0 | grep "Name : Fred" > /dev/null || exit 1
+fi
 mdadm -S $md0
 
 mdadm -A $md0 --name="Fred" $devlist