From: Kefu Chai Date: Sat, 4 Feb 2017 06:28:59 +0000 (+0800) Subject: tests: ceph-helpers.sh reduce get_timeout_delays() verbosity X-Git-Tag: v12.0.0~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=389bd00da35d1309e165c98fcfb4f917a95ea4ca;p=ceph.git tests: ceph-helpers.sh reduce get_timeout_delays() verbosity `set +o` prints out the full command line which is echoed if "xtrace" is enabled. this increases the verbosity of get_timeout_delays(). in this change, we follow the way of kill_daemons() to kill the extra output. see aefcf6d. Signed-off-by: Kefu Chai --- diff --git a/qa/workunits/ceph-helpers.sh b/qa/workunits/ceph-helpers.sh index c2bd782c229e..049baf74a34d 100755 --- a/qa/workunits/ceph-helpers.sh +++ b/qa/workunits/ceph-helpers.sh @@ -1085,8 +1085,8 @@ function test_is_clean() { # @return a list of sleep delays # function get_timeout_delays() { - local saved_state=$(set +o) - set +x + local trace=$(shopt -q -o xtrace && echo true || echo false) + $trace && shopt -u -o xtrace local timeout=$1 local first_step=${2:-1} @@ -1101,7 +1101,7 @@ function get_timeout_delays() { if test "$(echo $total \< $timeout | bc -l)" = "1"; then echo -n $(echo $timeout - $total | bc -l) fi - eval "$saved_state" + $trace && shopt -s -o xtrace } function test_get_timeout_delays() {