From 7c078eda0fc260f6a885fa43f377b47844867d12 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 2 Dec 2016 10:10:52 +0200 Subject: [PATCH] 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 --- qa/workunits/rbd/rbd_mirror_helpers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() -- 2.39.5