#Test fail command
#No channel enable start command should return element success false
OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE
- lttng_snapshot_add_output $session_name $snapshot_path
+ lttng_snapshot_add_output_ok $session_name $snapshot_path
$XML_VALIDATE $OUTPUT_DEST
ok $? "Mi test: snapshot xsd validation"
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
lttng_snapshot_record $SESSION_NAME
stop_lttng_tracing_ok $SESSION_NAME
destroy_lttng_session_ok $SESSION_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
stop_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
lttng_snapshot_record $SESSION_NAME
destroy_lttng_session_ok $SESSION_NAME
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT1 $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
# first snapshot with only 1 event
lttng_snapshot_record $SESSION_NAME
enable_lttng_mmap_overwrite_kernel_channel $SESSION_NAME $CHANNEL_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
for i in $(seq 1 $NB_SNAP); do
diag "Snapshot $i/$NB_SNAP"
rm -rf $TRACE_PATH/snapshot/* 2>/dev/null
enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
# Returns once the application has at least fired ONE tracepoint.
start_test_app
enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $LM_EVENT $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
$LM_BIN 1 1
ok $? "Start application to trace"
lttng_snapshot_record $SESSION_NAME
enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
# Returns once the application has at least fired ONE tracepoint.
start_test_app
enable_channel_per_uid_mmap_overwrite $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
# Returns once the application has at least fired ONE tracepoint.
start_test_app
enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
start_lttng_tracing_ok $SESSION_NAME
- lttng_snapshot_add_output $SESSION_NAME $TRACE_PATH
+ lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH
# Returns once the application has at least fired ONE tracepoint.
start_test_app
function lttng_snapshot_add_output ()
{
- local sess_name=$1
- local trace_path=$2
- local expected_to_fail=$3
+ local expected_to_fail=$1
+ local sess_name=$2
+ local trace_path=$3
$TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot add-output -s $sess_name file://$trace_path >$OUTPUT_DEST
ret=$?
- if [[ $expected_to_fail ]]; then
+ if [[ $expected_to_fail -eq 1 ]]; then
test "$ret" -ne "0"
ok $? "Failed to add a snapshot output file://$trace_path as expected"
else
fi
}
+function lttng_snapshot_add_output_ok ()
+{
+ lttng_snapshot_add_output 0 "$@"
+}
+
+function lttng_snapshot_add_output_fail ()
+{
+ lttng_snapshot_add_output 1 "$@"
+}
+
function lttng_snapshot_del_output ()
{
local sess_name=$1