]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerMykola Golub <mgolub@mirantis.com>
Sat, 3 Dec 2016 17:37:10 +0000 (19:37 +0200)
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>
qa/workunits/rbd/rbd_mirror_helpers.sh

index 6f51ca97dbc5273cdbaebf1e33cb06e8166a5cb8..4899a7630935061a74eeedab7ec2211240a63093 100755 (executable)
@@ -483,8 +483,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()