@@ -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
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(-)