Tests: lttng_snapshot_add_output_ok: allow specifying output type
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 22 Jun 2018 17:51:58 +0000 (13:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 8 Nov 2019 22:33:41 +0000 (17:33 -0500)
Also add support for additional options.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/mi/test_mi
tests/regression/tools/snapshots/test_kernel
tests/regression/tools/snapshots/ust_test
tests/utils/utils.sh

index 391286f5f64accce8ab97064f4ff9569f7b9ee39..ba0febf4281237ed09f907e0a943b1dc3002cb45 100755 (executable)
@@ -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"
 
index f6f9508ebb07b3527b7cae00d855cedcaaed394e..06d16c75703b3b842917cceb6e44a7fd1dc98088 100755 (executable)
@@ -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
index 7540be2d490f1074ff4a74204295e7004560c04d..aa9d4763e6c762419cf678f77e5c7db68eba4cf1 100755 (executable)
@@ -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
index a8b9b3bdf5e76718f0aca85991868809a3ed9eda..9df9a0bf0985fed35cdf2da8c9dc79cbbbef14b0 100644 (file)
@@ -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
 }
 
This page took 0.039449 seconds and 4 git commands to generate.