From 7612ac476e109cdef8d42acb40e7cf3d952922f9 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Thu, 9 May 2019 12:50:26 +0200 Subject: [PATCH] autotest/common: disable xtrace for the autotest_common.sh itself Most of our test scripts source autotest_common.sh at the very top of the file, and - since autotest_common.sh enables xtraces inside - the first thing we'll see in test output are likely xtraces from sourcing the configuration file and setting up $config_params. Even a simplest test script will produce a ton of output this way, making the entire output unreadable. This is especially annoying when the test script is run manually, so we get rid of it now. All the SPDK autotest options and $config_params will be printed elsewhere anyway. Change-Id: I6d9c8e8ba261b632ffbb7d6d26d84eb7ccfb2ed8 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453875 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/common/autotest_common.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index d4c7713d9..7ab8cb7ff 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1,10 +1,3 @@ -PS4=' \t \$ ' - -: ${SPDK_AUTOTEST_X=true}; export SPDK_AUTOTEST_X -if $SPDK_AUTOTEST_X; then - set -x -fi - function xtrace_disable() { PREV_BASH_OPTS="$-" set +x @@ -27,6 +20,7 @@ function xtrace_restore() { xtrace_enable } +xtrace_disable set -e if [ "$(uname -s)" = "Linux" ]; then @@ -104,6 +98,7 @@ fi : ${SPDK_TEST_BDEV_FTL=0}; export SPDK_TEST_BDEV_FTL : ${SPDK_TEST_OCF=0}; export SPDK_TEST_OCF : ${SPDK_TEST_FTL_EXTENDED=0}; export SPDK_TEST_FTL_EXTENDED +: ${SPDK_AUTOTEST_X=true}; export SPDK_AUTOTEST_X if [ -z "$DEPENDENCY_DIR" ]; then export DEPENDENCY_DIR=/home/sys_sgsw @@ -778,3 +773,12 @@ function freebsd_update_contigmem_mod() set -o errtrace trap "trap - ERR; print_backtrace >&2" ERR + +PS4=' \t \$ ' +if $SPDK_AUTOTEST_X; then + # explicitly enable xtraces + set -x + xtrace_enable +else + xtrace_restore +fi