]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: qa/workunits/cephtool/test.sh ! and -e
authorLoic Dachary <loic-201408@dachary.org>
Sat, 6 Sep 2014 16:58:08 +0000 (18:58 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Fri, 19 Sep 2014 11:09:18 +0000 (13:09 +0200)
From the bash man page:

   set -e exit immediately ... The shell does not exit ... if the
   command's return value is being inverted with !

Add an explicit exit 1 where appropriate.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
qa/workunits/cephtool/test.sh

index 65f041adc9c1d3e3007f5c44a1a428e07b88aabe..1445ceb072c5ef7a073264d1b4b27b773904845e 100755 (executable)
@@ -249,12 +249,12 @@ function test_tiering()
   ceph osd dump | grep "pool.*'cache6'" 2>&1 | grep "tier_of[ \t]\+$poolB_id"
 
   ceph osd tier remove basepoolA cache5 2>&1 | grep 'not a tier of'
-  ! ceph osd dump | grep "pool.*'cache5'" 2>&1 | grep "tier_of"
+  ! ceph osd dump | grep "pool.*'cache5'" 2>&1 | grep "tier_of" || exit 1
   ceph osd tier remove basepoolB cache6 2>&1 | grep 'not a tier of'
-  ! ceph osd dump | grep "pool.*'cache6'" 2>&1 | grep "tier_of"
+  ! ceph osd dump | grep "pool.*'cache6'" 2>&1 | grep "tier_of" || exit 1
 
-  ! ceph osd dump | grep "pool.*'basepoolA'" 2>&1 | grep "tiers"
-  ! ceph osd dump | grep "pool.*'basepoolB'" 2>&1 | grep "tiers"
+  ! ceph osd dump | grep "pool.*'basepoolA'" 2>&1 | grep "tiers" || exit 1
+  ! ceph osd dump | grep "pool.*'basepoolB'" 2>&1 | grep "tiers" || exit 1
 
   ceph osd pool delete cache6 cache6 --yes-i-really-really-mean-it
   ceph osd pool delete cache5 cache5 --yes-i-really-really-mean-it
@@ -592,7 +592,7 @@ function test_mon_osd()
       break
     fi
   done
-  ! ceph osd dump | grep ' down '
+  ! ceph osd dump | grep ' down ' || exit 1
   
   # if you have more osds than this you are on your own
   for f in `seq 0 31`; do
@@ -1116,7 +1116,7 @@ fi
 
 for i in ${tests_to_run[@]}; do
   set -x
-  test_${i} ;
+  test_${i}
   set +x
 done