run_checks() {
THIN_POSTFIX=""
- if [ -z $3 ]; then
+ if [ -z "$3" ]; then
printf "#\n#\n# run_checks: Too few arguments\n#\n#\n"
return 1
- elif [ '-' == $3 ]; then
+ elif [ '-' = "$3" ]; then
printf "#\n#\n# run_checks: Simple check\n#\n#\n"
run_writemostly_check $1 $2
run_syncaction_check $1 $2
run_refresh_check $1 $2
run_recovery_rate_check $1 $2
- elif [ 'thinpool_data' == $3 ]; then
+ elif [ "thinpool_data" = "$3" ]; then
printf "#\n#\n# run_checks: RAID as thinpool data\n#\n#\n"
# Hey, specifying devices for thin allocation doesn't work
run_syncaction_check $1 $2
run_refresh_check $1 $2
run_recovery_rate_check $1 $2
- elif [ 'thinpool_meta' == $3 ]; then
+ elif [ "thinpool_meta" = "$3" ]; then
printf "#\n#\n# run_checks: RAID as thinpool metadata\n#\n#\n"
lvrename $1/$2 ${2}_meta
run_syncaction_check $1 $2
run_refresh_check $1 $2
run_recovery_rate_check $1 $2
- elif [ 'snapshot' == $3 ]; then
+ elif [ "snapshot" = "$3" ]; then
printf "#\n#\n# run_checks: RAID under snapshot\n#\n#\n"
lvcreate -aey -s $1/$2 -l 4 -n snap "$dev6"
if [ ${b[0]} -ne ${b[1]} ]; then
# If the sync operation ("recover" in this case) is not
# finished, then it better be as follows:
- [ ${a[5]} == "Aa" ]
- [ ${a[7]} == "recover" ]
+ [ ${a[5]} = "Aa" ]
+ [ ${a[7]} = "recover" ]
else
# Tough to tell the INVALID case,
# Before starting sync thread: "Aa X/X recover"
# from the valid case,
# Just finished sync thread: "Aa X/X recover"
# We'll just put "should" for now
- should [ ${a[5]} == "AA" ]
- should [ ${a[7]} == "idle" ]
+ should [ ${a[5]} = "AA" ]
+ should [ ${a[7]} = "idle" ]
break
fi
sleep .1
if [ ${b[0]} -ne ${b[1]} ]; then
# If the sync operation ("recover" in this case) is not
# finished, then it better be as follows:
- [ ${a[5]} == "AAa" ]
- [ ${a[7]} == "recover" ]
+ [ ${a[5]} = "AAa" ]
+ [ ${a[7]} = "recover" ]
else
# Tough to tell the INVALID case,
# Before starting sync thread: "Aa X/X recover"
# from the valid case,
# Just finished sync thread: "Aa X/X recover"
# We'll just put "should" for now
- should [ ${a[5]} == "AAA" ]
- should [ ${a[7]} == "idle" ]
+ should [ ${a[5]} = "AAA" ]
+ should [ ${a[7]} = "idle" ]
break
fi
sleep .1
if [ ${b[0]} -ne ${b[1]} ]; then
# If the sync operation ("resync" in this case) is not
# finished, then it better be as follows:
- [ ${a[5]} == "aa" ]
- [ ${a[7]} == "resync" ]
+ [ ${a[5]} = "aa" ]
+ [ ${a[7]} = "resync" ]
else
- should [ ${a[5]} == "AA" ]
- should [ ${a[7]} == "idle" ]
+ should [ ${a[5]} = "AA" ]
+ should [ ${a[7]} = "idle" ]
break
fi
sleep .1