From: John L. Hammond Date: Fri, 19 Dec 2014 18:09:51 +0000 (-0600) Subject: LU-6058 test: log to stderr X-Git-Tag: 2.6.92~32 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e00d24d8d7642cf5897799226b84ce5a71913dc0 LU-6058 test: log to stderr In test-framework.sh's log() function print the message to stderr instead of stdout. This ensures that the message will not be not captured by command substitution. Similarly print bash stack traces to stderr from error(). Signed-off-by: John L. Hammond Change-Id: If9ca4af1c8d66f9bb3767f4fc3c04fb6966de915 Reviewed-on: http://review.whamcloud.com/13155 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index bfdc9c2..8a273d0 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -4638,7 +4638,7 @@ stop_full_debug_logging() { } # prints bash call stack -log_trace_dump() { +print_stack_trace() { echo " Trace dump:" for (( i=1; i < ${#BASH_LINENO[*]} ; i++ )) ; do local s=${BASH_SOURCE[$i]} @@ -4664,7 +4664,7 @@ error_noexit() { log " ${TESTSUITE} ${TESTNAME}: @@@@@@ ${TYPE}: $@ " - log_trace_dump + print_stack_trace >&2 mkdir -p $LOGDIR # We need to dump the logs on all nodes @@ -4850,7 +4850,7 @@ run_test() { } log() { - echo "$*" + echo "$*" >&2 module_loaded lnet || load_modules local MSG="$*"