3 # Copyright (C) - 2019 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # This library is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation; version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 TEST_DESC
="Clear - UST tracing"
21 TESTDIR
=$CURDIR/..
/..
/..
22 EVENT_NAME
="tp:tptest"
24 TESTAPP_PATH
="$TESTDIR/utils/testapp"
25 TESTAPP_NAME
="gen-ust-events"
26 TESTAPP_BIN
="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
30 PAGE_SIZE
=$
(getconf PAGE_SIZE
)
31 TRACE_PATH
=$
(mktemp
-d)
33 source $TESTDIR/utils
/utils.sh
35 if [ ! -x "$TESTAPP_BIN" ]; then
36 BAIL_OUT
"No UST events binary detected."
39 function clean_path
()
47 function cond_start_tracing
()
50 local tracing_active
=$2
52 if [[ $tracing_active -ne 1 ]]; then
53 start_lttng_tracing_ok
$session_name
57 function cond_stop_tracing
()
60 local tracing_active
=$2
62 if [[ $tracing_active -ne 1 ]]; then
63 stop_lttng_tracing_ok
$session_name
67 function do_clear_session
()
70 local tracing_active
=$2
72 local rotate_before
=$4
75 cond_stop_tracing
$session_name $tracing_active
76 if [[ $rotate_before -eq 1 ]]; then
77 rotate_session_ok
$SESSION_NAME
79 lttng_clear_session_ok
$SESSION_NAME
80 if [[ $clear_twice -eq 1 ]]; then
81 lttng_clear_session_ok
$SESSION_NAME
83 if [[ $rotate_after -eq 1 ]]; then
84 if [[ $tracing_active -eq 1 ]]; then
85 rotate_session_ok
$SESSION_NAME
88 rotate_session_fail
$SESSION_NAME
91 cond_start_tracing
$session_name $tracing_active
94 function test_ust_streaming
()
96 local tracing_active
=$1
98 local rotate_before
=$3
101 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
102 local channel_name
="chan"
104 diag
"Test ust streaming clear"
105 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
106 create_lttng_session_uri
$SESSION_NAME net
://localhost
107 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
108 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
109 start_lttng_tracing_ok
$SESSION_NAME
111 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
112 stop_lttng_tracing_ok
$SESSION_NAME
114 if [[ $rotate_before -eq 1 ]]; then
115 validate_trace_count
$EVENT_NAME $local_path 10
117 if [[ "$buffer_type" == "uid" ]]; then
118 validate_trace_empty
$local_path
120 validate_directory_empty
$local_path
124 destroy_lttng_session_ok
$SESSION_NAME
127 function test_ust_streaming_rotate_clear
()
129 local tracing_active
=$1
131 local rotate_before
=$3
132 local rotate_after
=$4
134 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
135 local channel_name
="chan"
137 diag
"Test ust streaming rotate-clear"
138 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
139 create_lttng_session_uri
$SESSION_NAME net
://localhost
140 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
141 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
142 start_lttng_tracing_ok
$SESSION_NAME
144 rotate_session_ok
$SESSION_NAME
146 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
148 stop_lttng_tracing_ok
$SESSION_NAME
150 if [[ $rotate_before -eq 1 ]]; then
155 validate_trace_count
$EVENT_NAME $local_path $expect_count
157 destroy_lttng_session_ok
$SESSION_NAME
160 function test_ust_streaming_clear_rotate
()
162 local tracing_active
=$1
164 local rotate_before
=$3
165 local rotate_after
=$4
167 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
168 local channel_name
="chan"
170 diag
"Test ust streaming clear-rotate"
171 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
172 create_lttng_session_uri
$SESSION_NAME net
://localhost
173 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
174 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
175 start_lttng_tracing_ok
$SESSION_NAME
177 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
179 rotate_session_ok
$SESSION_NAME
181 stop_lttng_tracing_ok
$SESSION_NAME
183 if [[ $rotate_before -eq 1 ]]; then
188 validate_trace_count
$EVENT_NAME $local_path $expect_count
190 destroy_lttng_session_ok
$SESSION_NAME
193 function test_ust_streaming_live
()
195 local tracing_active
=$1
199 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
200 local channel_name
="chan"
202 diag
"Test ust streaming live clear"
203 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
204 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
205 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
206 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
207 start_lttng_tracing_ok
$SESSION_NAME
209 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
210 stop_lttng_tracing_ok
$SESSION_NAME
212 validate_directory_empty
$local_path
214 destroy_lttng_session_ok
$SESSION_NAME
218 function test_ust_basic_streaming_live_viewer
()
220 local tracing_active
=$1
224 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
225 local remote_trace_path
="${HOSTNAME}/${SESSION_NAME}"
226 local channel_name
="chan"
227 local bt_output_path
=$
(mktemp
-u)
228 local file_sync_before_exit
=$
(mktemp
-u)
230 diag
"Test ust basic streaming live with viewer"
231 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
232 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
233 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
234 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
235 start_lttng_tracing_ok
$SESSION_NAME
237 wait_live_trace_ready net
://localhost
239 # Connect a live viewer
240 $BABELTRACE_BIN -i lttng-live net
://localhost
/host
/$remote_trace_path > $bt_output_path &
243 wait_live_viewer_connect net
://localhost
245 $TESTAPP_BIN -i 10 --sync-before-exit $file_sync_before_exit &
248 diag
"Wait until viewer sees all 10 expected events"
250 while [ $evcount -ne 10 ]; do
251 evcount
=$
(cat $bt_output_path |
wc -l)
254 pass
"Live viewer read $evcount events, expect 10"
256 destroy_lttng_session_ok
$SESSION_NAME
257 touch $file_sync_before_exit
258 diag
"Wait for application to exit"
260 pass
"Wait for application to exit"
261 diag
"Wait for viewer to exit"
263 ok $?
"Babeltrace succeeds"
264 pass
"Wait for viewer to exit"
266 rm -f $bt_output_path
267 rm -f $file_sync_before_exit
270 function test_ust_streaming_live_viewer
()
272 local tracing_active
=$1
276 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
277 local remote_trace_path
="${HOSTNAME}/${SESSION_NAME}"
278 local channel_name
="chan"
279 local bt_output_path
=$
(mktemp
-d)/bt-output.txt
281 diag
"Test ust streaming live clear with viewer"
282 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
283 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--live"
284 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
285 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
286 start_lttng_tracing_ok
$SESSION_NAME
288 wait_live_trace_ready net
://localhost
290 # Connect a live viewer
291 $BABELTRACE_BIN -i lttng-live net
://localhost
/host
/$remote_trace_path > $bt_output_path &
294 wait_live_viewer_connect net
://localhost
297 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
298 stop_lttng_tracing_ok
$SESSION_NAME
300 destroy_lttng_session_ok
$SESSION_NAME
301 diag
"Wait for viewer to exit"
303 ok $?
"Babeltrace succeeds"
304 pass
"Wait for viewer to exit"
306 clean_path
$bt_output_path
309 function test_ust_local
()
311 local tracing_active
=$1
313 local rotate_before
=$3
314 local rotate_after
=$4
316 local channel_name
="chan"
318 diag
"Test ust local"
319 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
320 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
321 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
322 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
323 start_lttng_tracing_ok
$SESSION_NAME
325 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
326 stop_lttng_tracing_ok
$SESSION_NAME
328 if [[ $rotate_before -eq 1 ]]; then
329 validate_trace_count
$EVENT_NAME $TRACE_PATH 10
331 if [[ "$buffer_type" == "uid" ]]; then
332 validate_trace_empty
$TRACE_PATH
334 validate_directory_empty
$TRACE_PATH
338 destroy_lttng_session_ok
$SESSION_NAME
341 function test_ust_local_rotate_clear
()
343 local tracing_active
=$1
345 local rotate_before
=$3
346 local rotate_after
=$4
348 local channel_name
="chan"
350 diag
"Test ust local rotate-clear"
351 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
352 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
353 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
354 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
355 start_lttng_tracing_ok
$SESSION_NAME
357 rotate_session_ok
$SESSION_NAME
359 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
361 stop_lttng_tracing_ok
$SESSION_NAME
363 if [[ $rotate_before -eq 1 ]]; then
368 validate_trace_count
$EVENT_NAME $TRACE_PATH $expect_count
370 destroy_lttng_session_ok
$SESSION_NAME
373 function test_ust_local_clear_rotate
()
375 local tracing_active
=$1
377 local rotate_before
=$3
378 local rotate_after
=$4
380 local channel_name
="chan"
382 diag
"Test ust local clear-rotate"
383 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
384 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
385 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
386 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
387 start_lttng_tracing_ok
$SESSION_NAME
389 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
391 rotate_session_ok
$SESSION_NAME
393 stop_lttng_tracing_ok
$SESSION_NAME
395 if [[ $rotate_before -eq 1 ]]; then
400 validate_trace_count
$EVENT_NAME $TRACE_PATH $expect_count
402 destroy_lttng_session_ok
$SESSION_NAME
405 function do_ust_snapshot
()
407 local session_name
=$1
409 local tracing_active
=$3
412 local channel_name
="snapshot"
414 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
415 enable_ust_lttng_event_ok
$session_name $EVENT_NAME $channel_name
416 start_lttng_tracing_ok
$session_name
418 # Generate 10 events that will sit in the buffers.
421 # Take a first snapshot and validate that the events are present.
422 lttng_snapshot_record
$session_name
423 stop_lttng_tracing_ok
$session_name
424 validate_trace_count
$EVENT_NAME $trace_path 10
426 # Clean the output path
427 clean_path
$trace_path
428 start_lttng_tracing_ok
$session_name
430 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
432 # Make sure the subsequent snapshot is empty and valid.
433 lttng_snapshot_record
$session_name
434 stop_lttng_tracing_ok
$session_name
435 validate_trace_empty
$trace_path
437 # Clean the output path
438 clean_path
$trace_path
439 start_lttng_tracing_ok
$session_name
441 # Make sure that everything still works, generate events and take a
444 lttng_snapshot_record
$session_name
445 stop_lttng_tracing_ok
$session_name
446 validate_trace_count
$EVENT_NAME $trace_path 10
449 function test_ust_streaming_snapshot
()
451 local tracing_active
=$1
456 diag
"Test ust streaming snapshot clear"
457 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
459 create_lttng_session_uri
$SESSION_NAME net
://localhost
"--snapshot"
460 do_ust_snapshot
$SESSION_NAME $TRACE_PATH $tracing_active $clear_twice $buffer_type
461 destroy_lttng_session_ok
$SESSION_NAME
464 function test_ust_local_snapshot
()
466 local tracing_active
=$1
471 diag
"Test ust local snapshot clear"
472 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
474 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH "--snapshot"
475 do_ust_snapshot
$SESSION_NAME $TRACE_PATH $tracing_active $clear_twice $buffer_type
476 destroy_lttng_session_ok
$SESSION_NAME
479 # snapshot for per-pid is tested independently of the "buffer type" parameter
480 # because an application needs to be live to appear in a snapshot.
481 function test_ust_local_snapshot_per_pid
()
483 local tracing_active
=$1
487 local channel_name
="channel0"
488 local file_sync_before_last
=$
(mktemp
-u)
489 local file_sync_before_last_touch
=$
(mktemp
-u)
490 local file_sync_before_exit
=$
(mktemp
-u)
491 local file_sync_before_exit_touch
=$
(mktemp
-u)
493 diag
"Test ust local snapshot clear per pid"
494 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
496 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH "--snapshot"
497 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --buffers-$buffer_type
498 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
499 start_lttng_tracing_ok
$SESSION_NAME
501 # Generate 10 events that will sit in the buffers.
502 $TESTAPP_BIN -i 10 -w 0 \
503 --sync-before-last-event ${file_sync_before_last} \
504 --sync-before-last-event-touch ${file_sync_before_last_touch} \
505 --sync-before-exit ${file_sync_before_exit} \
506 --sync-before-exit-touch ${file_sync_before_exit_touch} >/dev
/null
2>&1 &
508 # Continue only when there is only the last event remaining.
509 while [ ! -f "${file_sync_before_last_touch}" ]; do
513 # Take a first snapshot and validate that the events are present.
514 lttng_snapshot_record
$SESSION_NAME
515 stop_lttng_tracing_ok
$SESSION_NAME
516 validate_trace_count
$EVENT_NAME $TRACE_PATH 9
518 # Clean the output path
519 clean_path
$TRACE_PATH
520 start_lttng_tracing_ok
$SESSION_NAME
522 do_clear_session
$SESSION_NAME $tracing_active $clear_twice 0 0
524 # Make sure the subsequent snapshot is empty and valid.
525 lttng_snapshot_record
$SESSION_NAME
526 stop_lttng_tracing_ok
$SESSION_NAME
527 validate_trace_empty
$TRACE_PATH
529 # Validate that tracing still works and subsequent snapshots are valid.
530 # Clean the output path.
531 clean_path
$TRACE_PATH
532 start_lttng_tracing_ok
$SESSION_NAME
534 # Continue over the last event.
535 touch ${file_sync_before_last}
537 # Wait for the before exit sync point. This ensure that we went over the
539 while [ ! -f "${file_sync_before_exit_touch}" ]; do
543 # Make sure the snapshot contains the last event.
544 lttng_snapshot_record
$SESSION_NAME
545 stop_lttng_tracing_ok
$SESSION_NAME
546 validate_trace_count
$EVENT_NAME $TRACE_PATH 1
548 # Release the application.
549 touch ${file_sync_before_exit}
551 destroy_lttng_session_ok
$SESSION_NAME
553 rm -f ${file_sync_before_last}
554 rm -f ${file_sync_before_last_touch}
555 rm -f ${file_sync_before_exit}
556 rm -f ${file_sync_before_exit_touch}
559 function test_ust_streaming_tracefile_rotation
()
561 local tracing_active
=$1
563 local rotate_before
=$3
564 local rotate_after
=$4
566 local channel_name
="rotchan"
567 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
569 diag
"Test ust streaming clear with tracefile rotation"
570 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
571 create_lttng_session_uri
$SESSION_NAME net
://localhost
572 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --subbuf-size=$PAGE_SIZE \
573 --tracefile-size=$PAGE_SIZE --tracefile-count=2 --buffers-$buffer_type
574 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
575 start_lttng_tracing_ok
$SESSION_NAME
577 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
578 stop_lttng_tracing_ok
$SESSION_NAME
580 if [[ $rotate_before -eq 1 ]]; then
581 validate_trace_count
$EVENT_NAME $local_path 10
583 if [[ "$buffer_type" == "uid" ]]; then
584 validate_trace_empty
$local_path
586 validate_directory_empty
$local_path
590 start_lttng_tracing_ok
$SESSION_NAME
592 stop_lttng_tracing_ok
594 if [[ $rotate_before -eq 1 ]]; then
595 validate_trace_count
$EVENT_NAME $local_path 30
597 validate_trace_count
$EVENT_NAME $local_path 20
600 destroy_lttng_session_ok
$SESSION_NAME
603 # With 1 byte per event (as strict minimum), generating 200000 events
604 # guarantees filling up 2 files of 64k in size, which is the maximum
605 # page size known on Linux
606 function test_ust_streaming_tracefile_rotation_overwrite_files
()
608 local tracing_active
=$1
610 local rotate_before
=$3
611 local rotate_after
=$4
613 local channel_name
="rotchan"
614 local local_path
="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
616 diag
"Test ust streaming clear with tracefile rotation, overwrite files"
617 diag
"Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, rotate_before=$rotate_before, rotate_after=$rotate_after, buffer_type=$buffer_type"
618 create_lttng_session_uri
$SESSION_NAME net
://localhost
619 enable_ust_lttng_channel_ok
$SESSION_NAME $channel_name --subbuf-size=$PAGE_SIZE \
620 --tracefile-size=$PAGE_SIZE --tracefile-count=2 --buffers-$buffer_type
621 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME $channel_name
622 start_lttng_tracing_ok
$SESSION_NAME
623 taskset
-c 0 $TESTAPP_BIN -i 200000
624 do_clear_session
$SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after
625 stop_lttng_tracing_ok
$SESSION_NAME
627 if [[ $rotate_before -eq 1 ]]; then
628 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 200000
630 if [[ "$buffer_type" == "uid" ]]; then
631 validate_trace_empty
$local_path
633 validate_directory_empty
$local_path
637 start_lttng_tracing_ok
$SESSION_NAME
638 taskset
-c 0 $TESTAPP_BIN -i 400000
639 stop_lttng_tracing_ok
641 if [[ $rotate_before -eq 1 ]]; then
642 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 600000
644 validate_trace_count_range_incl_min_excl_max
$EVENT_NAME $local_path 1 200000
647 destroy_lttng_session_ok
$SESSION_NAME
650 function test_ust_disallow_clear
()
652 diag
"Test ust disallow clear on relay daemon"
653 SESSION_NAME
=$
(randstring
16 0)
655 LTTNG_RELAYD_DISALLOW_CLEAR
=1 start_lttng_relayd
"-o $TRACE_PATH"
659 create_lttng_session_uri
$SESSION_NAME net
://localhost
660 enable_ust_lttng_event_ok
$SESSION_NAME $EVENT_NAME
661 start_lttng_tracing_ok
$SESSION_NAME
662 lttng_clear_session_fail
$SESSION_NAME
663 destroy_lttng_session_ok
$SESSION_NAME
667 clean_path
$TRACE_PATH
670 plan_tests
$NUM_TESTS
672 print_test_banner
"$TEST_DESC"
674 streaming_tests
=(test_ust_streaming
675 test_ust_streaming_rotate_clear
676 test_ust_streaming_clear_rotate
677 test_ust_streaming_tracefile_rotation
678 test_ust_streaming_tracefile_rotation_overwrite_files
681 live_tests
=(test_ust_streaming_live
682 test_ust_basic_streaming_live_viewer
683 test_ust_streaming_live_viewer
686 local_tests
=(test_ust_local
687 test_ust_local_rotate_clear
688 test_ust_local_clear_rotate
691 snapshot_uid_tests
=(test_ust_streaming_snapshot
692 test_ust_local_snapshot
695 snapshot_pid_tests
=(test_ust_local_snapshot_per_pid
)
697 start_lttng_relayd
"-o $TRACE_PATH"
702 # Clear with tracing active, clear once
703 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
705 SESSION_NAME
=$
(randstring
16 0)
706 ${fct_test} 1 0 0 0 uid
707 clean_path
$TRACE_PATH
710 # Clear with tracing active, clear twice
711 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
713 SESSION_NAME
=$
(randstring
16 0)
714 ${fct_test} 1 1 0 0 uid
715 clean_path
$TRACE_PATH
718 # Clear with tracing inactive, clear once
719 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
721 SESSION_NAME
=$
(randstring
16 0)
722 ${fct_test} 0 0 0 0 uid
723 clean_path
$TRACE_PATH
726 # Clear with tracing inactive, clear twice
727 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_uid_tests[@]};
729 SESSION_NAME
=$
(randstring
16 0)
730 ${fct_test} 0 1 0 0 uid
731 clean_path
$TRACE_PATH
734 # Clear with tracing inactive, rotate-clear once
735 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
737 SESSION_NAME
=$
(randstring
16 0)
738 ${fct_test} 0 0 1 0 uid
739 clean_path
$TRACE_PATH
742 # Clear with tracing inactive, clear once-rotate(fail)
743 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
745 SESSION_NAME
=$
(randstring
16 0)
746 ${fct_test} 0 0 0 1 uid
747 clean_path
$TRACE_PATH
753 # Clear with tracing active, clear once
754 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
756 SESSION_NAME
=$
(randstring
16 0)
757 ${fct_test} 1 0 0 0 pid
758 clean_path
$TRACE_PATH
761 # Clear with tracing active, clear twice
762 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
764 SESSION_NAME
=$
(randstring
16 0)
765 ${fct_test} 1 1 0 0 pid
766 clean_path
$TRACE_PATH
769 # Clear with tracing inactive, clear once
770 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
772 SESSION_NAME
=$
(randstring
16 0)
773 ${fct_test} 0 0 0 0 pid
774 clean_path
$TRACE_PATH
777 # Clear with tracing inactive, clear twice
778 for fct_test
in ${streaming_tests[@]} ${live_tests[@]} ${local_tests[@]} ${snapshot_pid_tests[@]};
780 SESSION_NAME
=$
(randstring
16 0)
781 ${fct_test} 0 1 0 0 pid
782 clean_path
$TRACE_PATH
785 # Clear with tracing inactive, rotate-clear once
786 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
788 SESSION_NAME
=$
(randstring
16 0)
789 ${fct_test} 0 0 1 0 pid
790 clean_path
$TRACE_PATH
793 # Clear with tracing inactive, clear once-rotate(fail)
794 for fct_test
in ${streaming_tests[@]} ${local_tests[@]};
796 SESSION_NAME
=$
(randstring
16 0)
797 ${fct_test} 0 0 0 1 pid
798 clean_path
$TRACE_PATH
804 test_ust_disallow_clear