From 389bd00da35d1309e165c98fcfb4f917a95ea4ca Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 4 Feb 2017 14:28:59 +0800 Subject: [PATCH] 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 --- qa/workunits/ceph-helpers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() { -- 2.47.3