<div dir="ltr">Merged, thanks!<div><br></div><div>Jérémie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 29, 2015 at 5:57 PM, Jonathan Rajotte <span dir="ltr"><<a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Jonathan Rajotte <<a href="mailto:jonathan.rajotte-julien@efficios.com">jonathan.rajotte-julien@efficios.com</a>><br>
---<br>
tests/utils/utils.sh | 75 ++++++++++++++++++++++++++--------------------------<br>
1 file changed, 38 insertions(+), 37 deletions(-)<br>
<br>
diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh<br>
index 4282fbb..ba0b10e 100644<br>
--- a/tests/utils/utils.sh<br>
+++ b/tests/utils/utils.sh<br>
@@ -20,7 +20,8 @@ CONSUMERD_BIN="lttng-consumerd"<br>
RELAYD_BIN="lttng-relayd"<br>
LTTNG_BIN="lttng"<br>
BABELTRACE_BIN="babeltrace"<br>
-OUTPUT_DEST=/dev/null 2>&1<br>
+OUTPUT_DEST=/dev/null<br>
+ERROR_OUTPUT_DEST=/dev/null<br>
<br>
# Minimal kernel version supported for session daemon tests<br>
KERNEL_MAJOR_VERSION=2<br>
@@ -103,7 +104,7 @@ function lttng_enable_kernel_event<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -k >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable kernel event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -126,7 +127,7 @@ function lttng_enable_kernel_syscall()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --syscall "$syscall_name" $chan -s $sess_name -k >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --syscall "$syscall_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test $ret -ne "0"<br>
@@ -165,7 +166,7 @@ function lttng_disable_kernel_syscall()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event --syscall "$syscall_name" $chan -s $sess_name -k >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event --syscall "$syscall_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
@@ -192,7 +193,7 @@ function lttng_enable_kernel_channel()<br>
local sess_name=$2<br>
local channel_name=$3<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -k $channel_name -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -k $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -218,7 +219,7 @@ function lttng_disable_kernel_channel()<br>
local sess_name=$2<br>
local channel_name=$3<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel -k $channel_name -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel -k $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -245,7 +246,7 @@ function start_lttng_relayd<br>
DIR=$(readlink -f $TESTDIR)<br>
<br>
if [ -z $(pidof lt-$RELAYD_BIN) ]; then<br>
- $DIR/../src/bin/lttng-relayd/$RELAYD_BIN -b $opt >$OUTPUT_DEST<br>
+ $DIR/../src/bin/lttng-relayd/$RELAYD_BIN -b $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
#$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &<br>
if [ $? -eq 1 ]; then<br>
fail "Start lttng-relayd (opt: $opt)"<br>
@@ -263,7 +264,7 @@ function stop_lttng_relayd_nocheck<br>
PID_RELAYD=`pidof lt-$RELAYD_BIN`<br>
<br>
diag "Killing lttng-relayd (pid: $PID_RELAYD)"<br>
- kill $PID_RELAYD >$OUTPUT_DEST<br>
+ kill $PID_RELAYD 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
retval=$?<br>
<br>
if [ $retval -eq 1 ]; then<br>
@@ -331,7 +332,7 @@ function stop_lttng_sessiond ()<br>
<br>
PID_SESSIOND=`pidof lt-$SESSIOND_BIN`<br>
<br>
- kill $PID_SESSIOND >$OUTPUT_DEST<br>
+ kill $PID_SESSIOND 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
<br>
if [ $? -eq 1 ]; then<br>
fail "Kill sessions daemon"<br>
@@ -354,7 +355,7 @@ function stop_lttng_sessiond ()<br>
function list_lttng_with_opts ()<br>
{<br>
local opts=$1<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN list $opts >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN list $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Lttng-tool list command with option $opts"<br>
}<br>
<br>
@@ -362,7 +363,7 @@ function create_lttng_session_no_output ()<br>
{<br>
local sess_name=$1<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name --no-output >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name --no-output 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Create session $sess_name in no-output mode"<br>
}<br>
<br>
@@ -399,7 +400,7 @@ function enable_ust_lttng_channel ()<br>
local sess_name=$2<br>
local channel_name=$3<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -u $channel_name -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -u $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expect_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -424,7 +425,7 @@ function disable_ust_lttng_channel()<br>
local sess_name=$1<br>
local channel_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel -u $channel_name -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-channel -u $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Disable channel $channel_name for session $sess_name"<br>
}<br>
<br>
@@ -433,7 +434,7 @@ function enable_lttng_mmap_overwrite_kernel_channel()<br>
local sess_name=$1<br>
local channel_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -s $sess_name $channel_name -k --output mmap --overwrite >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -s $sess_name $channel_name -k --output mmap --overwrite 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable channel $channel_name for session $sess_name"<br>
}<br>
<br>
@@ -442,7 +443,7 @@ function enable_lttng_mmap_overwrite_ust_channel()<br>
local sess_name=$1<br>
local channel_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -s $sess_name $channel_name -u --output mmap --overwrite >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel -s $sess_name $channel_name -u --output mmap --overwrite 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable channel $channel_name for session $sess_name"<br>
}<br>
<br>
@@ -460,7 +461,7 @@ function enable_ust_lttng_event ()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -u >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -u 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test $ret -ne "0"<br>
@@ -493,7 +494,7 @@ function enable_jul_lttng_event()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -j >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -j 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable JUL event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -511,7 +512,7 @@ function enable_jul_lttng_event_loglevel()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -j >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -j 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable JUL event $event_name for session $sess_name with loglevel $loglevel"<br>
}<br>
<br>
@@ -528,7 +529,7 @@ function enable_log4j_lttng_event()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -l >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -l 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable LOG4J event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -546,7 +547,7 @@ function enable_log4j_lttng_event_loglevel()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -l >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -l 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable LOG4J event $event_name for session $sess_name with loglevel $loglevel"<br>
}<br>
<br>
@@ -563,7 +564,7 @@ function enable_python_lttng_event()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -p >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" $chan -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable Python event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -581,7 +582,7 @@ function enable_python_lttng_event_loglevel()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -p >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable Python event $event_name for session $sess_name with loglevel $loglevel"<br>
}<br>
<br>
@@ -591,7 +592,7 @@ function enable_ust_lttng_event_filter()<br>
local event_name="$2"<br>
local filter="$3"<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --filter "$filter" >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --filter "$filter" 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable event $event_name with filtering for session $sess_name"<br>
}<br>
<br>
@@ -601,7 +602,7 @@ function enable_ust_lttng_event_loglevel()<br>
local event_name="$2"<br>
local loglevel="$3"<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --loglevel $loglevel >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --loglevel $loglevel 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable event $event_name with loglevel $loglevel"<br>
}<br>
<br>
@@ -611,7 +612,7 @@ function enable_ust_lttng_event_loglevel_only()<br>
local event_name="$2"<br>
local loglevel="$3"<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --loglevel-only $loglevel >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" -s $sess_name -u --loglevel-only $loglevel 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Enable event $event_name with loglevel-only $loglevel"<br>
}<br>
<br>
@@ -628,7 +629,7 @@ function disable_ust_lttng_event ()<br>
chan="-c $channel_name"<br>
fi<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event "$event_name" -s $sess_name $chan -u >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event "$event_name" -s $sess_name $chan -u 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Disable event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -655,7 +656,7 @@ function disable_python_lttng_event ()<br>
local sess_name="$1"<br>
local event_name="$2"<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event "$event_name" -s $sess_name -p >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN disable-event "$event_name" -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Disable Python event $event_name for session $sess_name"<br>
}<br>
<br>
@@ -664,7 +665,7 @@ function start_lttng_tracing ()<br>
local expected_to_fail=$1<br>
local sess_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN start $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN start $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -689,7 +690,7 @@ function stop_lttng_tracing ()<br>
local expected_to_fail=$1<br>
local sess_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN stop $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN stop $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -714,7 +715,7 @@ function destroy_lttng_session ()<br>
local expected_to_fail=$1<br>
local sess_name=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -738,7 +739,7 @@ function destroy_lttng_session_fail ()<br>
<br>
function destroy_lttng_sessions ()<br>
{<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy --all >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy --all 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Destroy all lttng sessions"<br>
}<br>
<br>
@@ -748,7 +749,7 @@ function lttng_snapshot_add_output ()<br>
local sess_name=$2<br>
local trace_path=$3<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name file://$trace_path >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name file://$trace_path 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq 1 ]]; then<br>
test "$ret" -ne "0"<br>
@@ -774,7 +775,7 @@ function lttng_snapshot_del_output ()<br>
local sess_name=$2<br>
local id=$3<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot del-output -s $sess_name $id >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot del-output -s $sess_name $id 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ret=$?<br>
if [[ $expected_to_fail -eq "1" ]]; then<br>
test "$ret" -ne "0"<br>
@@ -799,14 +800,14 @@ function lttng_snapshot_record ()<br>
local sess_name=$1<br>
local trace_path=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot record -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot record -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Snapshot recorded"<br>
}<br>
<br>
function lttng_snapshot_list ()<br>
{<br>
local sess_name=$1<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot list-output -s $sess_name >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot list-output -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Snapshot list"<br>
}<br>
<br>
@@ -815,7 +816,7 @@ function lttng_save()<br>
local sess_name=$1<br>
local opts=$2<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN save $sess_name $opts >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN save $sess_name $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Session successfully saved"<br>
}<br>
<br>
@@ -823,7 +824,7 @@ function lttng_load()<br>
{<br>
local opts=$1<br>
<br>
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN load $opts >$OUTPUT_DEST<br>
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN load $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST<br>
ok $? "Load command successful"<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jérémie Galarneau<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div>
</div>