function start_lttng_relayd_opt()
{
local withtap=$1
- local opt=$2
+ local process_mode=$2
+ local opt=$3
DIR=$(readlink -f $TESTDIR)
if [ -z $(pgrep $RELAYD_MATCH) ]; then
- $DIR/../src/bin/lttng-relayd/$RELAYD_BIN -b $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
#$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
if [ $? -eq 1 ]; then
if [ $withtap -eq "1" ]; then
- fail "Start lttng-relayd (opt: $opt)"
+ fail "Start lttng-relayd (process mode: $process_mode opt: $opt)"
fi
return 1
else
if [ $withtap -eq "1" ]; then
- pass "Start lttng-relayd (opt: $opt)"
+ pass "Start lttng-relayd (process mode: $process_mode opt: $opt)"
fi
fi
else
function start_lttng_relayd()
{
- start_lttng_relayd_opt 1 "$@"
+ start_lttng_relayd_opt 1 "-b" "$@"
}
function start_lttng_relayd_notap()
{
- start_lttng_relayd_opt 0 "$@"
+ start_lttng_relayd_opt 0 "-b" "$@"
}
function stop_lttng_relayd_opt()
ok $? "Create session $sess_name in no-output mode"
}
+function create_lttng_session_uri () {
+ local sess_name=$1
+ local uri=$2
+ local opts="${@:3}"
+
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -U $uri $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ ok $? "Create session $sess_name with uri:$uri and opts: $opts"
+}
+
function create_lttng_session ()
{
local expected_to_fail=$1
local expected_to_fail=$1
local sess_name=$2
local trace_path=$3
+ local opts=$4
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name file://$trace_path 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name $trace_path $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
ret=$?
if [[ $expected_to_fail -eq 1 ]]; then
test "$ret" -ne "0"
- ok $? "Added snapshot output file://$trace_path failed as expected"
+ ok $? "Added snapshot output $trace_path failed as expected"
else
- ok $ret "Added snapshot output file://$trace_path"
+ ok $ret "Added snapshot output $trace_path"
fi
}
skip 0 "Babeltrace binary not found. Skipping trace validation"
fi
- traced=$($BABELTRACE_BIN $trace_path 2>/dev/null | wc -l)
+ events=$($BABELTRACE_BIN $trace_path 2>/dev/null)
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ fail "Failed to parse trace"
+ return $ret
+ fi
+
+ traced=$(echo -n "$events" | wc -l)
if [ "$traced" -eq 0 ]; then
pass "Validate empty trace"
else