Gen-ust-events: use options instead of arguments
[lttng-tools.git] / tests / regression / tools / snapshots / test_ust_streaming
index c97813e40eec6738284682f621904fc4e2ee59ab..53dbeb2911dbcf6732fb193d687a4776acaed081 100755 (executable)
@@ -31,7 +31,7 @@ APPS_PID=
 
 TRACE_PATH=$(mktemp -d)
 
-NUM_TESTS=49
+NUM_TESTS=75
 
 source $TESTDIR/utils/utils.sh
 
@@ -60,7 +60,7 @@ function start_test_app()
        local tmp_file=$(mktemp -u)
 
        # Start application with a temporary file.
-       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT $tmp_file &
+       $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file &
        ret=$?
        APPS_PID="${APPS_PID} ${!}"
        ok $ret "Start application to trace"
@@ -206,6 +206,33 @@ function test_ust_custom_name()
        return $out
 }
 
+function test_ust_n_snapshot()
+{
+       diag "Test ust snapshot streaming multiple consecutive snapshot"
+       create_lttng_session_no_output $SESSION_NAME
+       enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME
+       enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
+       snapshot_add_output $SESSION_NAME "net://localhost" $name
+       start_test_app
+       for i in {1..5};
+       do
+               start_lttng_tracing_ok $SESSION_NAME
+               lttng_snapshot_record $SESSION_NAME
+               stop_lttng_tracing_ok $SESSION_NAME
+               validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/snapshot-1*
+               if [ $? -ne 0 ]; then
+                       return 1
+               fi
+               set -u
+               rm -rf $TRACE_PATH/$HOSTNAME
+               set +u
+       done
+
+       destroy_lttng_session_ok $SESSION_NAME
+       stop_test_apps
+       return 0
+}
+
 plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
@@ -219,7 +246,12 @@ fi
 start_lttng_relayd "-o $TRACE_PATH"
 start_lttng_sessiond
 
-tests=( test_ust_default_name_with_del test_ust_default_name test_ust_custom_name test_ust_default_name_custom_uri )
+tests=( test_ust_default_name_with_del
+       test_ust_default_name
+       test_ust_custom_name
+       test_ust_default_name_custom_uri
+       test_ust_n_snapshot
+)
 
 for fct_test in ${tests[@]};
 do
This page took 0.025665 seconds and 5 git commands to generate.