Whamcloud - gitweb
LU-6058 test: log to stderr 55/13155/2
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 19 Dec 2014 18:09:51 +0000 (12:09 -0600)
committerAndreas Dilger <andreas.dilger@intel.com>
Sat, 20 Dec 2014 17:52:49 +0000 (17:52 +0000)
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 <john.hammond@intel.com>
Change-Id: If9ca4af1c8d66f9bb3767f4fc3c04fb6966de915
Reviewed-on: http://review.whamcloud.com/13155
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/test-framework.sh

index bfdc9c2..8a273d0 100755 (executable)
@@ -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="$*"