From: Mykola Golub Date: Fri, 2 Dec 2016 08:10:52 +0000 (+0200) Subject: qa/workunits/rbd: test_status_in_pool_dir: explicitly check grep return value X-Git-Tag: v11.1.0~60^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c078eda0fc260f6a885fa43f377b47844867d12;p=ceph.git qa/workunits/rbd: test_status_in_pool_dir: explicitly check grep return value 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 --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 6f51ca97dbc..4899a763093 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -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()