summaryrefslogtreecommitdiffstats
path: root/tests/func.sh
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2024-06-14 04:45:01 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-06-20 13:45:15 +0200
commit23aef35113553cb97ef2e7b01c760d5449592e14 (patch)
tree8fcb3ecd157faf5370f95602f05aa7f91993b81e /tests/func.sh
parentMakefile: Do not call gcc directly (diff)
downloadmdadm-23aef35113553cb97ef2e7b01c760d5449592e14.tar.xz
mdadm-23aef35113553cb97ef2e7b01c760d5449592e14.zip
mdadm/tests: judge foreign array in test cases
It needs to use array name when judging if one array is foreign or not. So calling is_raid_foreign in test cases which need it. Fixes: 41706a915684 ('mdadm/tests: names_template enhance') Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'tests/func.sh')
-rw-r--r--tests/func.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/func.sh b/tests/func.sh
index 8c142c76..e7ccc4fc 100644
--- a/tests/func.sh
+++ b/tests/func.sh
@@ -181,10 +181,12 @@ restore_system_speed_limit() {
is_raid_foreign() {
- # If the length of hostname is >= 32, super1 doesn't use
- # hostname in metadata
+ name=$1
+ # super1 uses this formula strlen(homehost)+1+strlen(name) < 32
+ # to decide if an array is foreign or local. It adds homehost if
+ # one array is local
hostname=$(hostname)
- if [ `expr length $(hostname)` -lt 32 ]; then
+ if [ `expr length "$(hostname)$name"` -lt 31 ]; then
is_foreign="no"
else
is_foreign="yes"
@@ -299,7 +301,6 @@ do_setup() {
[ -f /proc/mdstat ] || modprobe md_mod
echo 0 > /sys/module/md_mod/parameters/start_ro
record_system_speed_limit
- is_raid_foreign
record_selinux
}