]> sourceware.org Git - lvm2.git/commitdiff
tests: correcting usage of '==' in bash
authorZdenek Kabelac <zkabelac@redhat.com>
Sun, 2 Jul 2017 18:25:20 +0000 (20:25 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 10 Jul 2017 12:23:53 +0000 (14:23 +0200)
test/shell/lvchange-raid.sh
test/shell/lvconvert-raid-status-validation.sh
test/shell/process-each-duplicate-pvs.sh

index 7418cd557dc5ee28a19269e3fd0c0682bf6f4e9e..ac885be03877ae042cef35e337b265ece1061a2f 100644 (file)
@@ -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"
 
index d705cc24b61e21cba1b33a83d046769032af27aa..bc9654ce9b7ff9a68a9b4486422bf4aae3138e4c 100644 (file)
@@ -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
index 270fc528e6ee8db919b77a57f60c549f7fda3989..542ee531bb2f30799235d02e85bc8899e29cc018 100644 (file)
@@ -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
This page took 0.039852 seconds and 5 git commands to generate.