diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 78784f5d1c59a..a658da254d107 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -105,7 +105,7 @@ daemon_pid_file() testlog() { - echo $(date '+%F %T') $@ | tee -a "${TEMPDIR}/rbd-mirror.test.log" + echo $(date '+%F %T') $@ | tee -a "${TEMPDIR}/rbd-mirror.test.log" >&2 } expect_failure() @@ -467,7 +467,7 @@ 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} + tee ${status_log} >&2 grep "state: .*${state_pattern}" ${status_log} grep "description: .*${description_pattern}" ${status_log} } diff --git a/qa/workunits/rbd/rbd_mirror_stress.sh b/qa/workunits/rbd/rbd_mirror_stress.sh index e9ed2ce7c6cbf..d604d4b8bea32 100755 --- a/qa/workunits/rbd/rbd_mirror_stress.sh +++ b/qa/workunits/rbd/rbd_mirror_stress.sh @@ -56,17 +56,18 @@ wait_for_pool_images() while true; do for s in `seq 1 40`; do + test $s -ne 1 && sleep 30 count=$(rbd --cluster ${cluster} -p ${pool} mirror pool status | grep 'images: ' | cut -d' ' -f 2) test "${count}" = "${image_count}" && return 0 # reset timeout if making forward progress - test $count -gt $last_count && break - sleep 30 + test $count -ne $last_count && break done - test $count -eq $last_count && return 1 - $last_count=$count + test $count -eq $last_count && break + last_count=$count done + rbd --cluster ${cluster} -p ${pool} mirror pool status --verbose >&2 return 1 } @@ -78,11 +79,12 @@ wait_for_pool_healthy() local state for s in `seq 1 40`; do + test $s -ne 1 && sleep 30 state=$(rbd --cluster ${cluster} -p ${pool} mirror pool status | grep 'health:' | cut -d' ' -f 2) - test "${state}" = "ERROR" && return 1 + test "${state}" = "ERROR" && break test "${state}" = "OK" && return 0 - sleep 30 done + rbd --cluster ${cluster} -p ${pool} mirror pool status --verbose >&2 return 1 }