summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-07-02 20:25:20 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-07-10 14:23:53 +0200
commit5ca4fd0478f239cc04233612bdf52019733b6bef (patch)
tree29a6b858459afd4f62a4103f4191b9dd2a89599b /test
parentd12c0ae16315680efcd2306f8f657d45e7c4aca6 (diff)
downloadlvm2-5ca4fd0478f239cc04233612bdf52019733b6bef.tar.gz
tests: correcting usage of '==' in bash
Diffstat (limited to 'test')
-rw-r--r--test/shell/lvchange-raid.sh10
-rw-r--r--test/shell/lvconvert-raid-status-validation.sh24
-rw-r--r--test/shell/process-each-duplicate-pvs.sh2
3 files changed, 18 insertions, 18 deletions
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index 7418cd557..ac885be03 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -261,17 +261,17 @@ run_recovery_rate_check() {
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
@@ -285,7 +285,7 @@ run_checks() {
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
@@ -298,7 +298,7 @@ run_checks() {
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"
diff --git a/test/shell/lvconvert-raid-status-validation.sh b/test/shell/lvconvert-raid-status-validation.sh
index d705cc24b..bc9654ce9 100644
--- a/test/shell/lvconvert-raid-status-validation.sh
+++ b/test/shell/lvconvert-raid-status-validation.sh
@@ -55,16 +55,16 @@ while true; do
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
@@ -84,16 +84,16 @@ while true; do
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
@@ -112,11 +112,11 @@ while true; do
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
diff --git a/test/shell/process-each-duplicate-pvs.sh b/test/shell/process-each-duplicate-pvs.sh
index 270fc528e..542ee531b 100644
--- a/test/shell/process-each-duplicate-pvs.sh
+++ b/test/shell/process-each-duplicate-pvs.sh
@@ -76,7 +76,7 @@ grep "prefers device" warn
# Find which is the preferred dev and which is the duplicate.
PV=$(pvs --noheadings -o name -S uuid=$UUID1)
-if [ $PV == "$dev1" ]; then
+if [ "$PV" = "$dev1" ]; then
DUP=$dev2
else
DUP=$dev1