]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: test_status_in_pool_dir: explicitly check grep return value
authorMykola Golub <mgolub@mirantis.com>
Fri, 2 Dec 2016 08:10:52 +0000 (10:10 +0200)
committerNathan Cutler <ncutler@suse.com>
Sun, 29 Jan 2017 20:37:43 +0000 (21:37 +0100)
Otherwise, it does not work as supposed to work in statements like below:

 set -e
 test_status_in_pool_dir ... && ...

(e.g. in wait_for_status_in_pool_dir)

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 7c078eda0fc260f6a885fa43f377b47844867d12)

qa/workunits/rbd/rbd_mirror_helpers.sh

index e9360e717040989dfd2786eca9b88fee084e0ad1..b02dfa790b37d6513ff8b125dec75e1f1fc97865 100755 (executable)
@@ -468,8 +468,8 @@ test_status_in_pool_dir()
     local status_log=${TEMPDIR}/${cluster}-${image}.mirror_status
     rbd --cluster ${cluster} -p ${pool} mirror image status ${image} |
        tee ${status_log} >&2
-    grep "state: .*${state_pattern}" ${status_log}
-    grep "description: .*${description_pattern}" ${status_log}
+    grep "state: .*${state_pattern}" ${status_log} || return 1
+    grep "description: .*${description_pattern}" ${status_log} || return 1
 }
 
 wait_for_status_in_pool_dir()