X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=0b126a706d3a4da30cc1576875626b2224af09e1;hb=ce9ee1fb2847b1603c4382c82aef95121f0e3d07;hp=71ddaa2cb5ea5a5c0e814eb307d201dcb2189817;hpb=529bb942d15366eacc37f14df5d4404dfcd64893;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 71ddaa2cb..0b126a706 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -66,11 +66,24 @@ function full_cleanup () # The '-' before the pid number ($$) indicates 'kill' to signal the # whole process group. trap - SIGTERM && kill -- -$$ + exit 1 } +function null_pipes () +{ + exec 0>/dev/null + exec 1>/dev/null + exec 2>/dev/null +} trap full_cleanup SIGINT SIGTERM +# perl prove closes its child pipes before giving it a chance to run its +# signal trap handlers. Redirect pipes to /dev/null if SIGPIPE is caught +# to allow those trap handlers to proceed. + +trap null_pipes SIGPIPE + function print_ok () { # Check if we are a terminal @@ -887,7 +900,14 @@ function create_lttng_session () local trace_path=$4 local opt=$5 - $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path $opt > $OUTPUT_DEST + if [ -z "$trace_path" ]; then + # Use lttng-sessiond default output. + trace_path="" + else + trace_path="-o $trace_path" + fi + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN create "$sess_name" $trace_path $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST ret=$? if [ $expected_to_fail -eq "1" ]; then test "$ret" -ne "0" @@ -1783,7 +1803,7 @@ function regenerate_statedump () test "$ret" -ne "0" ok $? "Expected fail on regenerate statedump $sess_name" else - ok $ret "Metadata regenerate $sess_name" + ok $ret "Statedump regenerate $sess_name" fi }