X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fsnapshots%2Ftest_ust_streaming;h=3104afb3b4ea6711ec086ce56de2a469ed325b61;hb=f38b11e104c2f6e916f83617f14e643e73ca917b;hp=03c244bc1b31f596d49539fab95a3522271e999f;hpb=6c4a91d639747f260ab46decebc50998ef063712;p=lttng-tools.git diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming index 03c244bc1..3104afb3b 100755 --- a/tests/regression/tools/snapshots/test_ust_streaming +++ b/tests/regression/tools/snapshots/test_ust_streaming @@ -2,18 +2,8 @@ # # Copyright (C) - 2013 David Goulet # -# This library is free software; you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License as published by the Free -# Software Foundation; version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -# details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this library; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# SPDX-License-Identifier: LGPL-2.1-only + TEST_DESC="Streaming - Snapshot UST tracing" CURDIR=$(dirname $0)/ @@ -29,9 +19,9 @@ NR_ITER=-1 NR_USEC_WAIT=100 APPS_PID= -TRACE_PATH=$(mktemp -d) +TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_ust_streaming_trace_path.XXXXXX) -NUM_TESTS=75 +NUM_TESTS=85 source $TESTDIR/utils/utils.sh @@ -57,7 +47,7 @@ function snapshot_add_output () # Start trace application and return once one event has been hit. function start_test_app() { - local tmp_file=$(mktemp -u) + local tmp_file=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_tmp_file.XXXXXX) # Start application with a temporary file. $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file & @@ -99,6 +89,7 @@ function test_ust_default_name_with_del() lttng_snapshot_record $SESSION_NAME # Validate test + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-1" 0 validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-1* if [ $? -ne 0 ]; then stop_test_apps @@ -110,6 +101,7 @@ function test_ust_default_name_with_del() lttng_snapshot_record $SESSION_NAME # Validate test with the next ID since a del output was done prior. + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-2" 1 validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-2* if [ $? -ne 0 ]; then stop_test_apps @@ -140,6 +132,7 @@ function test_ust_default_name() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME # Validate test + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-1" 0 validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-1* out=$? @@ -163,6 +156,7 @@ function test_ust_default_name_custom_uri() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME # Validate test + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-1" 0 validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-1* out=$? @@ -193,6 +187,7 @@ function test_ust_custom_name() if ls $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/$name* &> /dev/null; then ok 0 "Custom name snapshot exists" # Validate test + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "$name" 0 validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/$name-* out=$? else @@ -211,13 +206,14 @@ function test_ust_n_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 + snapshot_add_output $SESSION_NAME "net://localhost" start_test_app - for i in {1..5}; + for i in {0..4}; do start_lttng_tracing_ok $SESSION_NAME lttng_snapshot_record $SESSION_NAME stop_lttng_tracing_ok $SESSION_NAME + validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-1" $i validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-1* if [ $? -ne 0 ]; then return 1 @@ -236,6 +232,8 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +bail_out_if_no_babeltrace + if [ "$(id -u)" == "0" ]; then isroot=1 else