From: Jonathan Rajotte Date: Fri, 22 Jun 2018 17:51:58 +0000 (-0400) Subject: Tests: lttng_snapshot_add_output_ok: allow specifying output type X-Git-Tag: v2.12.0-rc1~251 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9f0e230a68c5715f28372aa3df9ad1cb13cf6b43;p=lttng-tools.git Tests: lttng_snapshot_add_output_ok: allow specifying output type Also add support for additional options. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index 391286f5f..ba0febf42 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -676,7 +676,7 @@ function test_snapshot () { #Test fail command #No channel enable start command should return element success false OUTPUT_DEST=$OUTPUT_DIR/$OUTPUT_FILE - lttng_snapshot_add_output_ok $session_name $snapshot_path + lttng_snapshot_add_output_ok $session_name file://$snapshot_path $XML_VALIDATE $OUTPUT_DEST ok $? "Mi test: snapshot xsd validation" diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel index f6f9508eb..06d16c757 100755 --- a/tests/regression/tools/snapshots/test_kernel +++ b/tests/regression/tools/snapshots/test_kernel @@ -35,7 +35,7 @@ function test_kernel_local_snapshot () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH lttng_snapshot_record $SESSION_NAME stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -58,7 +58,7 @@ function test_kernel_local_snapshot_after_stop () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH lttng_snapshot_record $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -82,7 +82,7 @@ function test_kernel_local_snapshot_append_to_metadata () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # first snapshot with only 1 event lttng_snapshot_record $SESSION_NAME @@ -127,7 +127,7 @@ function test_kernel_local_snapshot_discard () $CHANNEL_NAME lttng_enable_kernel_syscall_ok $SESSION_NAME -a $CHANNEL_NAME start_lttng_tracing_ok $SESSION_NAME - lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH true_loop_cpu0 10000 @@ -165,7 +165,7 @@ function test_kernel_local_snapshot_overwrite_small_buffers () $CHANNEL_NAME lttng_enable_kernel_syscall_ok $SESSION_NAME -a $CHANNEL_NAME start_lttng_tracing_ok $SESSION_NAME - lttng_snapshot_add_output_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH true_loop_cpu0 10000 @@ -204,7 +204,7 @@ function test_kernel_1000_local_snapshots () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH for i in $(seq 1 $NB_SNAP); do diag "Snapshot $i/$NB_SNAP" rm -rf $TRACE_PATH/snapshot/* 2>/dev/null diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index 7540be2d4..aa9d4763e 100755 --- a/tests/regression/tools/snapshots/ust_test +++ b/tests/regression/tools/snapshots/ust_test @@ -193,7 +193,7 @@ function test_ust_local_snapshot () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Returns once the application has at least fired ONE tracepoint. start_test_app @@ -224,7 +224,7 @@ function test_ust_local_snapshot_small_discard_buffers () enable_mmap_small_discard_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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Run test apps, wait for them to complete. start_test_app @@ -269,7 +269,7 @@ function test_ust_local_snapshot_small_overwrite_buffers () enable_mmap_small_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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Run test apps, wait for them to complete. start_test_app @@ -367,7 +367,7 @@ function test_ust_local_snapshot_large_metadata () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH $LM_BIN 1 1 ok $? "Start application to trace" lttng_snapshot_record $SESSION_NAME @@ -400,7 +400,7 @@ function test_ust_per_uid_local_snapshot () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Returns once the application has at least fired ONE tracepoint. start_test_app @@ -429,7 +429,7 @@ function test_ust_per_uid_local_snapshot_post_mortem () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Returns once the application has at least fired ONE tracepoint. start_test_app @@ -457,7 +457,7 @@ function test_ust_local_snapshots () 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_ok $SESSION_NAME $TRACE_PATH + lttng_snapshot_add_output_ok $SESSION_NAME file://$TRACE_PATH # Returns once the application has at least fired ONE tracepoint. start_test_app diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index a8b9b3bdf..9df9a0bf0 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -1369,14 +1369,15 @@ function lttng_snapshot_add_output () 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 $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 }