X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fclear%2Ftest_ust;h=45abc9112f21ff212df58a2b27e353abba0d303f;hb=9e3c8d584765f2d8a697145559b58d235b23b793;hp=0be3bd4371e03a593b1e5102dedcb830a3902dbb;hpb=c28fcefd993b7539716bb5cd9557a08a217ec463;p=lttng-tools.git diff --git a/tests/regression/tools/clear/test_ust b/tests/regression/tools/clear/test_ust index 0be3bd437..45abc9112 100755 --- a/tests/regression/tools/clear/test_ust +++ b/tests/regression/tools/clear/test_ust @@ -1,19 +1,8 @@ #!/bin/bash # -# Copyright (C) - 2019 Jonathan Rajotte-Julien +# Copyright (C) 2019 Jonathan Rajotte # -# 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="Clear - UST tracing" @@ -25,7 +14,7 @@ TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" -NUM_TESTS=1683 +NUM_TESTS=1915 PAGE_SIZE=$(getconf PAGE_SIZE) TRACE_PATH=$(mktemp -d) @@ -124,6 +113,31 @@ function test_ust_streaming () destroy_lttng_session_ok $SESSION_NAME } +function test_ust_streaming_no_event () +{ + local tracing_active=$1 + local clear_twice=$2 + #local rotate_before=$3 ignored + #local rotate_after=$4 + local buffer_type=uid + local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" + local channel_name="chan" + + diag "Test ust streaming clear no event" + diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type" + create_lttng_session_uri $SESSION_NAME net://localhost + enable_ust_lttng_channel_ok $SESSION_NAME $channel_name --buffers-$buffer_type + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $channel_name + start_lttng_tracing_ok $SESSION_NAME + + do_clear_session $SESSION_NAME "$tracing_active" "$clear_twice" "$rotate_before" "$rotate_after" + stop_lttng_tracing_ok $SESSION_NAME + + validate_directory_empty "$local_path" + + destroy_lttng_session_ok $SESSION_NAME +} + function test_ust_streaming_rotate_clear () { local tracing_active=$1 @@ -209,7 +223,11 @@ function test_ust_streaming_live () do_clear_session $SESSION_NAME $tracing_active $clear_twice 0 0 stop_lttng_tracing_ok $SESSION_NAME - validate_directory_empty $local_path + if [[ "$buffer_type" == "uid" ]]; then + validate_trace_empty $local_path + else # pid + validate_directory_empty $local_path + fi destroy_lttng_session_ok $SESSION_NAME } @@ -331,13 +349,40 @@ function test_ust_local () if [[ "$buffer_type" == "uid" ]]; then validate_trace_empty $TRACE_PATH else # pid - validate_directory_empty $TRACE_PATH + + # The sessiond always created a `ust/ directory + # whenever the UST domain is active + validate_directory_empty $TRACE_PATH/ust/ fi fi destroy_lttng_session_ok $SESSION_NAME } +function test_ust_local_no_event () +{ + local tracing_active=$1 + local clear_twice=$2 + #local rotate_before=$3 ignored + #local rotate_after=$4 ignored + local buffer_type=$5 + local channel_name="chan" + + diag "Test ust local no event" + diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type" + create_lttng_session_ok $SESSION_NAME "$TRACE_PATH" + enable_ust_lttng_channel_ok $SESSION_NAME $channel_name "--buffers-$buffer_type" + enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $channel_name + start_lttng_tracing_ok $SESSION_NAME + + do_clear_session $SESSION_NAME "$tracing_active" "$clear_twice" "$rotate_before" "$rotate_after" + stop_lttng_tracing_ok $SESSION_NAME + + validate_directory_empty "$TRACE_PATH" + + destroy_lttng_session_ok $SESSION_NAME +} + function test_ust_local_rotate_clear () { local tracing_active=$1 @@ -676,6 +721,7 @@ streaming_tests=(test_ust_streaming test_ust_streaming_clear_rotate test_ust_streaming_tracefile_rotation test_ust_streaming_tracefile_rotation_overwrite_files + test_ust_streaming_no_event ) live_tests=(test_ust_streaming_live @@ -686,6 +732,7 @@ live_tests=(test_ust_streaming_live local_tests=(test_ust_local test_ust_local_rotate_clear test_ust_local_clear_rotate + test_ust_local_no_event ) snapshot_uid_tests=(test_ust_streaming_snapshot