1 # Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
3 # This library is free software; you can redistribute it and/or modify it under
4 # the terms of the GNU Lesser General Public License as published by the Free
5 # Software Foundation; version 2.1 of the License.
7 # This library is distributed in the hope that it will be useful, but WITHOUT
8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 # You should have received a copy of the GNU Lesser General Public License
13 # along with this library; if not, write to the Free Software Foundation, Inc.,
14 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 SESSIOND_BIN
="lttng-sessiond"
17 SESSIOND_MATCH
=".*lttng-sess.*"
19 RUNAS_BIN
="lttng-runas"
20 RUNAS_MATCH
=".*lttng-runas.*"
21 CONSUMERD_BIN
="lttng-consumerd"
22 CONSUMERD_MATCH
=".*lttng-consumerd.*"
23 RELAYD_BIN
="lttng-relayd"
24 RELAYD_MATCH
=".*lttng-relayd.*"
27 BABELTRACE_BIN
="babeltrace"
29 ERROR_OUTPUT_DEST
=/dev
/null
31 # Minimal kernel version supported for session daemon tests
32 KERNEL_MAJOR_VERSION
=2
33 KERNEL_MINOR_VERSION
=6
34 KERNEL_PATCHLEVEL_VERSION
=27
36 # We set the default UST register timeout and network and app socket timeout to
37 # "wait forever", so that basic tests don't have to worry about hitting
38 # timeouts on busy systems. Specialized tests should test those corner-cases.
39 export LTTNG_UST_REGISTER_TIMEOUT
=-1
40 export LTTNG_NETWORK_SOCKET_TIMEOUT
=-1
41 export LTTNG_APP_SOCKET_TIMEOUT
=-1
43 # We set the default lttng-sessiond path to /bin/true to prevent the spawning
44 # of a daemonized sessiond. This is necessary since 'lttng create' will spawn
45 # its own sessiond if none is running. It also ensures that 'lttng create'
46 # fails when no sessiond is running.
47 export LTTNG_SESSIOND_PATH
="/bin/true"
49 source $TESTDIR/utils
/tap
/tap.sh
51 function full_cleanup
()
53 if [ -n "${SESSIOND_PIDS}" ] ||
[ -n "${RELAYD_PIDS}" ]; then
54 kill -9 ${SESSIOND_PIDS} ${RELAYD_PIDS} > /dev
/null
2>&1
57 # Disable trap for SIGTERM since the following kill to the
58 # pidgroup will be SIGTERM. Otherwise it loops.
59 # The '-' before the pid number ($$) indicates 'kill' to signal the
60 # whole process group.
61 trap - SIGTERM
&& kill -- -$$
65 trap full_cleanup SIGINT SIGTERM
69 # Check if we are a terminal
71 echo -e "\e[1;32mOK\e[0m"
77 function print_fail
()
79 # Check if we are a terminal
81 echo -e "\e[1;31mFAIL\e[0m"
87 function print_test_banner
()
93 function validate_kernel_version
()
95 local kern_version
=($
(uname
-r |
awk -F.
'{ printf("%d.%d.%d\n",$1,$2,$3); }' |
tr '.' '\n'))
96 if [ ${kern_version[0]} -gt $KERNEL_MAJOR_VERSION ]; then
99 if [ ${kern_version[1]} -gt $KERNEL_MINOR_VERSION ]; then
102 if [ ${kern_version[2]} -ge $KERNEL_PATCHLEVEL_VERSION ]; then
108 # Generate a random string
109 # $1 = number of characters; defaults to 16
110 # $2 = include special characters; 1 = yes, 0 = no; defaults to yes
111 function randstring
()
113 [ "$2" == "0" ] && CHAR
="[:alnum:]" || CHAR
="[:graph:]"
114 cat /dev
/urandom
2>/dev
/null |
tr -cd "$CHAR" 2>/dev
/null |
head -c ${1:-16} 2>/dev
/null
118 # Return the number of _configured_ CPUs.
119 function conf_proc_count
()
121 getconf _NPROCESSORS_CONF
122 if [ $?
-ne 0 ]; then
123 diag
"Failed to get the number of configured CPUs"
128 # Check if base lttng-modules are present.
129 # Bail out on failure
130 function validate_lttng_modules_present
()
132 modprobe
-n lttng-tracer
2>/dev
/null
133 if [ $?
-ne 0 ]; then
134 BAIL_OUT
"LTTng modules not detected."
138 function enable_kernel_lttng_event
141 local expected_to_fail
="$2"
143 local event_name
="$4"
144 local channel_name
="$5"
146 if [ -z "$event_name" ]; then
147 # Enable all event if no event name specified
151 if [ -z "$channel_name" ]; then
152 # default channel if none specified
155 chan
="-c $channel_name"
158 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
160 if [[ $expected_to_fail -eq "1" ]]; then
163 if [ $withtap -eq "1" ]; then
164 ok
$ret "Enable kernel event $event_name for session $session_name on channel $channel_name failed as expected"
167 if [ $withtap -eq "1" ]; then
168 ok
$ret "Enable kernel event $event_name for session $sess_name"
173 function enable_kernel_lttng_event_ok
()
175 enable_kernel_lttng_event
1 0 "$@"
178 function enable_kernel_lttng_event_fail
()
180 enable_kernel_lttng_event
1 1 "$@"
183 function enable_kernel_lttng_event_notap
()
185 enable_kernel_lttng_event
0 0 "$@"
189 function lttng_enable_kernel_event
191 enable_kernel_lttng_event_ok
"$@"
194 function lttng_enable_kernel_syscall
()
196 local expected_to_fail
=$1
198 local syscall_name
=$3
199 local channel_name
=$4
201 if [ -z $syscall_name ]; then
202 # Enable all event if no syscall name specified
206 if [ -z $channel_name ]; then
207 # default channel if none specified
210 chan
="-c $channel_name"
213 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--syscall "$syscall_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
215 if [[ $expected_to_fail -eq "1" ]]; then
217 ok $?
"Enable kernel syscall $syscall_name for session $sess_name on channel $channel_name fail as expected"
219 ok
$ret "Enable kernel syscall $syscall_name for session $sess_name on channel $channel_name"
223 function lttng_enable_kernel_syscall_ok
()
225 lttng_enable_kernel_syscall
0 "$@"
228 function lttng_enable_kernel_syscall_fail
()
230 lttng_enable_kernel_syscall
1 "$@"
233 function lttng_disable_kernel_syscall
()
235 local expected_to_fail
=$1
237 local syscall_name
=$3
238 local channel_name
=$4
240 if [ -z $syscall_name ]; then
241 # Enable all event if no syscall name specified
245 if [ -z $channel_name ]; then
246 # default channel if none specified
249 chan
="-c $channel_name"
252 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
--syscall "$syscall_name" $chan -s $sess_name -k 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
255 if [[ $expected_to_fail -eq "1" ]]; then
257 ok $?
"Disable kernel syscall $syscall_name for session $sess_name on channel $channel_name failed as expected"
259 ok
$ret "Disable kernel syscall $syscall_name for session $sess_name on channel $channel_name"
263 function lttng_disable_kernel_syscall_ok
()
265 lttng_disable_kernel_syscall
0 "$@"
268 function lttng_disable_kernel_syscall_fail
()
270 lttng_disable_kernel_syscall
1 "$@"
273 function lttng_enable_kernel_userspace_probe_event
()
275 local expected_to_fail
="$1"
278 local event_name
="$4"
280 "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" enable-event
--kernel --userspace-probe="$target" "$event_name" -s "$sess_name" > "$OUTPUT_DEST" 2> "$ERROR_OUTPUT_DEST"
282 if [[ $expected_to_fail -eq "1" ]]; then
284 ok $?
"Enable kernel userspace probe event for session $sess_name failed as expected"
286 ok
$ret "Enable kernel userspace probe event for session $sess_name"
290 function lttng_enable_kernel_userspace_probe_event_fail
()
292 lttng_enable_kernel_userspace_probe_event
1 "$@"
295 function lttng_enable_kernel_userspace_probe_event_ok
()
297 lttng_enable_kernel_userspace_probe_event
0 "$@"
300 function disable_kernel_lttng_userspace_probe_event_ok
()
303 local event_name
="$2"
305 "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" disable-event
--kernel "$event_name" -s "$sess_name" > "$OUTPUT_DEST" 2> "$ERROR_OUTPUT_DEST"
306 ok $?
"Disable kernel event $target for session $sess_name"
308 function lttng_enable_kernel_channel
()
311 local expected_to_fail
=$2
313 local channel_name
=$4
316 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-k $channel_name -s $sess_name $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
318 if [[ $expected_to_fail -eq "1" ]]; then
321 if [ $withtap -eq "1" ]; then
322 ok
$ret "Enable channel $channel_name for session $sess_name failed as expected"
325 if [ $withtap -eq "1" ]; then
326 ok
$ret "Enable channel $channel_name for session $sess_name"
331 function lttng_enable_kernel_channel_ok
()
333 lttng_enable_kernel_channel
1 0 "$@"
336 function lttng_enable_kernel_channel_fail
()
338 lttng_enable_kernel_channel
1 1 "$@"
341 function lttng_enable_kernel_channel_notap
()
343 lttng_enable_kernel_channel
0 0 "$@"
346 function enable_kernel_lttng_channel_ok
()
348 lttng_enable_kernel_channel
1 0 "$@"
351 function lttng_disable_kernel_channel
()
353 local expected_to_fail
=$1
355 local channel_name
=$3
357 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-channel
-k $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
359 if [[ $expected_to_fail -eq "1" ]]; then
361 ok $?
"Disable channel $channel_name for session $sess_name failed as expected"
363 ok
$ret "Disable channel $channel_name for session $sess_name"
367 function lttng_disable_kernel_channel_ok
()
369 lttng_disable_kernel_channel
0 "$@"
372 function lttng_disable_kernel_channel_fail
()
374 lttng_disable_kernel_channel
1 "$@"
377 function start_lttng_relayd_opt
()
382 DIR
=$
(readlink
-f $TESTDIR)
384 if [ -z $
(pgrep
$RELAYD_MATCH) ]; then
385 $DIR/..
/src
/bin
/lttng-relayd
/$RELAYD_BIN -b $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
386 #$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
387 if [ $?
-eq 1 ]; then
388 if [ $withtap -eq "1" ]; then
389 fail
"Start lttng-relayd (opt: $opt)"
393 if [ $withtap -eq "1" ]; then
394 pass
"Start lttng-relayd (opt: $opt)"
398 pass
"Start lttng-relayd (opt: $opt)"
401 RELAYD_PIDS
=$
(pgrep
$RELAYD_MATCH)
404 function start_lttng_relayd
()
406 start_lttng_relayd_opt
1 "$@"
409 function start_lttng_relayd_notap
()
411 start_lttng_relayd_opt
0 "$@"
414 function stop_lttng_relayd_opt
()
418 if [ $withtap -eq "1" ]; then
419 diag
"Killing lttng-relayd (pid: $RELAYD_PIDS)"
421 kill $RELAYD_PIDS 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
424 if [ $?
-eq 1 ]; then
425 if [ $withtap -eq "1" ]; then
426 fail
"Kill relay daemon"
431 while [ -n "$out" ]; do
432 out
=$
(pgrep
$RELAYD_MATCH)
435 if [ $withtap -eq "1" ]; then
436 pass
"Kill relay daemon"
443 function stop_lttng_relayd
()
445 stop_lttng_relayd_opt
1 "$@"
448 function stop_lttng_relayd_notap
()
450 stop_lttng_relayd_opt
0 "$@"
453 #First arg: show tap output
454 #Second argument: load path for automatic loading
455 function start_lttng_sessiond_opt
()
462 local long_bit_value
=$
(getconf LONG_BIT
)
464 if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
465 # Env variable requested no session daemon
469 DIR
=$
(readlink
-f $TESTDIR)
471 # Get long_bit value for 32/64 consumerd
472 case "$long_bit_value" in
474 consumerd
="--consumerd32-path=$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
477 consumerd
="--consumerd64-path=$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
484 # Check for env. variable. Allow the use of LD_PRELOAD etc.
485 if [[ "x${LTTNG_SESSIOND_ENV_VARS}" != "x" ]]; then
486 env_vars
=${LTTNG_SESSIOND_ENV_VARS}
489 validate_kernel_version
490 if [ $?
-ne 0 ]; then
491 fail
"Start session daemon"
492 BAIL_OUT
"*** Kernel too old for session daemon tests ***"
495 : ${LTTNG_SESSION_CONFIG_XSD_PATH=${DIR}/../src/common/config/}
496 export LTTNG_SESSION_CONFIG_XSD_PATH
498 if [ -z $
(pgrep
${SESSIOND_MATCH}) ]; then
500 if [ -n "$load_path" ]; then
501 env
$env_vars $DIR/..
/src
/bin
/lttng-sessiond
/$SESSIOND_BIN --load "$load_path" --background $consumerd
503 env
$env_vars $DIR/..
/src
/bin
/lttng-sessiond
/$SESSIOND_BIN --background $consumerd
505 #$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --verbose-consumer >>/tmp/sessiond.log 2>&1
507 if [ $withtap -eq "1" ]; then
508 ok
$status "Start session daemon"
511 SESSIOND_PIDS
=$
(pgrep
$SESSIOND_MATCH)
514 function start_lttng_sessiond
()
516 start_lttng_sessiond_opt
1 "$@"
519 function start_lttng_sessiond_notap
()
521 start_lttng_sessiond_opt
0 "$@"
524 function stop_lttng_sessiond_opt
()
530 if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
531 # Env variable requested no session daemon
535 local pids
="${SESSIOND_PIDS} $(pgrep $RUNAS_MATCH)"
538 kill_opt
="$kill_opt -s $signal"
540 if [ $withtap -eq "1" ]; then
541 diag
"Killing $SESSIOND_BIN and lt-$SESSIOND_BIN pids: $(echo $pids | tr '\n' ' ')"
543 kill $kill_opt $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
545 if [ $?
-eq 1 ]; then
546 if [ $withtap -eq "1" ]; then
547 fail
"Kill sessions daemon"
551 while [ -n "$out" ]; do
552 out
=$
(pgrep
${SESSIOND_MATCH})
556 while [ -n "$out" ]; do
557 out
=$
(pgrep
$CONSUMERD_MATCH)
562 if [ $withtap -eq "1" ]; then
563 pass
"Kill session daemon"
568 function stop_lttng_sessiond
()
570 stop_lttng_sessiond_opt
1 "$@"
573 function stop_lttng_sessiond_notap
()
575 stop_lttng_sessiond_opt
0 "$@"
578 function sigstop_lttng_sessiond_opt
()
584 if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
585 # Env variable requested no session daemon
589 PID_SESSIOND
="$(pgrep ${SESSIOND_MATCH}) $(pgrep $RUNAS_MATCH)"
591 kill_opt
="$kill_opt -s $signal"
593 if [ $withtap -eq "1" ]; then
594 diag
"Sending SIGSTOP to lt-$SESSIOND_BIN and $SESSIOND_BIN pids: $(echo $PID_SESSIOND | tr '\n' ' ')"
596 kill $kill_opt $PID_SESSIOND 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
598 if [ $?
-eq 1 ]; then
599 if [ $withtap -eq "1" ]; then
600 fail
"Sending SIGSTOP to session daemon"
604 while [ $out -ne 0 ]; do
605 pid
=$
(pgrep
$SESSIOND_MATCH)
607 # Wait until state becomes stopped for session
610 for sessiond_pid
in $pid; do
611 state
=$
(ps
-p $sessiond_pid -o state
= )
612 if [[ -n "$state" && "$state" != "T" ]]; then
618 if [ $withtap -eq "1" ]; then
619 pass
"Sending SIGSTOP to session daemon"
624 function sigstop_lttng_sessiond
()
626 sigstop_lttng_sessiond_opt
1 "$@"
629 function sigstop_lttng_sessiond_notap
()
631 sigstop_lttng_sessiond_opt
0 "$@"
634 function stop_lttng_consumerd_opt
()
640 PID_CONSUMERD
=$
(pgrep
$CONSUMERD_MATCH)
643 kill_opt
="$kill_opt -s $signal"
646 if [ $withtap -eq "1" ]; then
647 diag
"Killing $CONSUMERD_BIN pids: $(echo $PID_CONSUMERD | tr '\n' ' ')"
650 kill $kill_opt $PID_CONSUMERD 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
653 if [ $?
-eq 1 ]; then
654 if [ $withtap -eq "1" ]; then
655 fail
"Kill consumer daemon"
660 while [ $out -ne 0 ]; do
661 pid
=$
(pgrep
$CONSUMERD_MATCH)
663 # If consumerds are still present check their status.
664 # A zombie status qualifies the consumerd as *killed*
666 for consumer_pid
in $pid; do
667 state
=$
(ps
-p $consumer_pid -o state
= )
668 if [[ -n "$state" && "$state" != "Z" ]]; then
674 if [ $withtap -eq "1" ]; then
675 pass
"Kill consumer daemon"
681 function stop_lttng_consumerd
()
683 stop_lttng_consumerd_opt
1 "$@"
686 function stop_lttng_consumerd_notap
()
688 stop_lttng_consumerd_opt
0 "$@"
691 function sigstop_lttng_consumerd_opt
()
697 PID_CONSUMERD
=$
(pgrep
$CONSUMERD_MATCH)
699 kill_opt
="$kill_opt -s $signal"
701 if [ $withtap -eq "1" ]; then
702 diag
"Sending SIGSTOP to $CONSUMERD_BIN pids: $(echo $PID_CONSUMERD | tr '\n' ' ')"
704 kill $kill_opt $PID_CONSUMERD 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
707 if [ $?
-eq 1 ]; then
708 if [ $withtap -eq "1" ]; then
709 fail
"Sending SIGSTOP to consumer daemon"
714 while [ $out -ne 0 ]; do
715 pid
=$
(pgrep
$CONSUMERD_MATCH)
717 # Wait until state becomes stopped for all
720 for consumer_pid
in $pid; do
721 state
=$
(ps
-p $consumer_pid -o state
= )
722 if [[ -n "$state" && "$state" != "T" ]]; then
728 if [ $withtap -eq "1" ]; then
729 pass
"Sending SIGSTOP to consumer daemon"
735 function sigstop_lttng_consumerd
()
737 sigstop_lttng_consumerd_opt
1 "$@"
740 function sigstop_lttng_consumerd_notap
()
742 sigstop_lttng_consumerd_opt
0 "$@"
745 function list_lttng_with_opts
()
748 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN list
$opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
749 ok $?
"Lttng-tool list command with option $opts"
752 function create_lttng_session_no_output
()
757 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$sess_name --no-output $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
758 ok $?
"Create session $sess_name in no-output mode"
761 function create_lttng_session_uri
() {
766 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$sess_name -U $uri $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
767 ok $?
"Create session $sess_name with uri:$uri and opts: $opts"
770 function create_lttng_session
()
773 local expected_to_fail
=$2
778 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN create
$sess_name -o $trace_path $opt > $OUTPUT_DEST
780 if [ $expected_to_fail -eq "1" ]; then
783 if [ $withtap -eq "1" ]; then
784 ok
$ret "Create session $sess_name in $trace_path failed as expected"
787 if [ $withtap -eq "1" ]; then
788 ok
$ret "Create session $sess_name in $trace_path"
794 function create_lttng_session_ok
()
796 create_lttng_session
1 0 "$@"
799 function create_lttng_session_fail
()
801 create_lttng_session
1 1 "$@"
804 function create_lttng_session_notap
()
806 create_lttng_session
0 0 "$@"
810 function enable_ust_lttng_channel
()
813 local expected_to_fail
=$2
815 local channel_name
=$4
818 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-u $channel_name -s $sess_name $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
820 if [[ $expected_to_fail -eq "1" ]]; then
823 if [ $withtap -eq "1" ]; then
824 ok
$ret "Enable channel $channel_name for session $sess_name failed as expected"
827 if [ $withtap -eq "1" ]; then
828 ok
$ret "Enable channel $channel_name for session $sess_name"
834 function enable_ust_lttng_channel_ok
()
836 enable_ust_lttng_channel
1 0 "$@"
839 function enable_ust_lttng_channel_fail
()
841 enable_ust_lttng_channel
1 1 "$@"
844 function enable_ust_lttng_channel_notap
()
846 enable_ust_lttng_channel
0 0 "$@"
849 function disable_ust_lttng_channel
()
852 local channel_name
=$2
854 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-channel
-u $channel_name -s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
855 ok $?
"Disable channel $channel_name for session $sess_name"
858 function enable_lttng_mmap_overwrite_kernel_channel
()
861 local channel_name
=$2
863 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-s $sess_name $channel_name -k --output mmap
--overwrite 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
864 ok $?
"Enable channel $channel_name for session $sess_name"
867 function enable_lttng_mmap_discard_small_kernel_channel
()
870 local channel_name
=$2
872 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-s $sess_name $channel_name -k --output mmap
--discard --subbuf-size=$
(getconf PAGE_SIZE
) --num-subbuf=2 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
873 ok $?
"Enable small discard channel $channel_name for session $sess_name"
876 function enable_lttng_mmap_overwrite_small_kernel_channel
()
879 local channel_name
=$2
881 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-s $sess_name $channel_name -k --output mmap
--overwrite --subbuf-size=$
(getconf PAGE_SIZE
) --num-subbuf=2 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
882 ok $?
"Enable small discard channel $channel_name for session $sess_name"
885 function enable_lttng_mmap_overwrite_ust_channel
()
888 local channel_name
=$2
890 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-channel
-s $sess_name $channel_name -u --output mmap
--overwrite 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
891 ok $?
"Enable channel $channel_name for session $sess_name"
894 function enable_ust_lttng_event
()
897 local expected_to_fail
=$2
899 local event_name
="$4"
900 local channel_name
=$5
902 if [ -z $channel_name ]; then
903 # default channel if none specified
906 chan
="-c $channel_name"
909 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" $chan -s $sess_name -u 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
911 if [[ $expected_to_fail -eq "1" ]]; then
914 if [[ $withtap -eq "1" ]]; then
915 ok
$ret "Enable ust event $event_name for session $session_name failed as expected"
918 if [[ $withtap -eq "1" ]]; then
919 ok
$ret "Enable ust event $event_name for session $sess_name"
925 function enable_ust_lttng_event_ok
()
927 enable_ust_lttng_event
1 0 "$@"
930 function enable_ust_lttng_event_fail
()
932 enable_ust_lttng_event
1 1 "$@"
935 function enable_ust_lttng_event_notap
()
937 enable_ust_lttng_event
0 0 "$@"
940 function enable_jul_lttng_event
()
946 if [ -z $channel_name ]; then
947 # default channel if none specified
950 chan
="-c $channel_name"
953 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" $chan -s $sess_name -j 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
954 ok $?
"Enable JUL event $event_name for session $sess_name"
957 function enable_jul_lttng_event_loglevel
()
960 local event_name
="$2"
962 local channel_name
=$4
964 if [ -z $channel_name ]; then
965 # default channel if none specified
968 chan
="-c $channel_name"
971 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--loglevel $loglevel "$event_name" $chan -s $sess_name -j 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
972 ok $?
"Enable JUL event $event_name for session $sess_name with loglevel $loglevel"
975 function enable_log4j_lttng_event
()
981 if [ -z $channel_name ]; then
982 # default channel if none specified
985 chan
="-c $channel_name"
988 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" $chan -s $sess_name -l 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
989 ok $?
"Enable LOG4J event $event_name for session $sess_name"
992 function enable_log4j_lttng_event_loglevel
()
995 local event_name
="$2"
997 local channel_name
=$4
999 if [ -z $channel_name ]; then
1000 # default channel if none specified
1003 chan
="-c $channel_name"
1006 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--loglevel $loglevel "$event_name" $chan -s $sess_name -l 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1007 ok $?
"Enable LOG4J event $event_name for session $sess_name with loglevel $loglevel"
1010 function enable_python_lttng_event
()
1016 if [ -z $channel_name ]; then
1017 # default channel if none specified
1020 chan
="-c $channel_name"
1023 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" $chan -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1024 ok $?
"Enable Python event $event_name for session $sess_name"
1027 function enable_python_lttng_event_loglevel
()
1030 local event_name
="$2"
1032 local channel_name
=$4
1034 if [ -z $channel_name ]; then
1035 # default channel if none specified
1038 chan
="-c $channel_name"
1041 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--loglevel $loglevel "$event_name" $chan -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1042 ok $?
"Enable Python event $event_name for session $sess_name with loglevel $loglevel"
1045 function enable_ust_lttng_event_filter
()
1047 local sess_name
="$1"
1048 local event_name
="$2"
1051 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" -s $sess_name -u --filter "$filter" 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1052 ok $?
"Enable event $event_name with filtering for session $sess_name"
1055 function enable_ust_lttng_event_loglevel
()
1057 local sess_name
="$1"
1058 local event_name
="$2"
1061 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" -s $sess_name -u --loglevel $loglevel 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1062 ok $?
"Enable event $event_name with loglevel $loglevel"
1065 function enable_ust_lttng_event_loglevel_only
()
1067 local sess_name
="$1"
1068 local event_name
="$2"
1071 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" -s $sess_name -u --loglevel-only $loglevel 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1072 ok $?
"Enable event $event_name with loglevel-only $loglevel"
1075 function disable_ust_lttng_event
()
1077 local sess_name
="$1"
1078 local event_name
="$2"
1079 local channel_name
="$3"
1081 if [ -z $channel_name ]; then
1082 # default channel if none specified
1085 chan
="-c $channel_name"
1088 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name $chan -u 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1089 ok $?
"Disable event $event_name for session $sess_name"
1092 function disable_jul_lttng_event
()
1094 local sess_name
="$1"
1095 local event_name
="$2"
1097 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -j >/dev
/null
2>&1
1098 ok $?
"Disable JUL event $event_name for session $sess_name"
1101 function disable_log4j_lttng_event
()
1103 local sess_name
="$1"
1104 local event_name
="$2"
1106 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -l >/dev
/null
2>&1
1107 ok $?
"Disable LOG4J event $event_name for session $sess_name"
1110 function disable_python_lttng_event
()
1112 local sess_name
="$1"
1113 local event_name
="$2"
1115 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -p 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1116 ok $?
"Disable Python event $event_name for session $sess_name"
1119 function start_lttng_tracing_opt
()
1122 local expected_to_fail
=$2
1125 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN start
$sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1127 if [[ $expected_to_fail -eq "1" ]]; then
1130 if [ $withtap -eq "1" ]; then
1131 ok $?
"Start tracing for session $sess_name failed as expected"
1134 if [ $withtap -eq "1" ]; then
1135 ok
$ret "Start tracing for session $sess_name"
1140 function start_lttng_tracing_ok
()
1142 start_lttng_tracing_opt
1 0 "$@"
1145 function start_lttng_tracing_fail
()
1147 start_lttng_tracing_opt
1 1 "$@"
1150 function start_lttng_tracing_notap
()
1152 start_lttng_tracing_opt
0 1 "$@"
1155 function stop_lttng_tracing_opt
()
1158 local expected_to_fail
=$2
1161 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN stop
$sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1163 if [[ $expected_to_fail -eq "1" ]]; then
1166 if [ $withtap -eq "1" ]; then
1167 ok $?
"Stop lttng tracing for session $sess_name failed as expected"
1170 if [ $withtap -eq "1" ]; then
1171 ok
$ret "Stop lttng tracing for session $sess_name"
1176 function stop_lttng_tracing_ok
()
1178 stop_lttng_tracing_opt
1 0 "$@"
1181 function stop_lttng_tracing_fail
()
1183 stop_lttng_tracing_opt
1 1 "$@"
1186 function stop_lttng_tracing_notap
()
1188 stop_lttng_tracing_opt
0 0 "$@"
1191 function destroy_lttng_session
()
1194 local expected_to_fail
=$2
1197 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
$sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1199 if [[ $expected_to_fail -eq "1" ]]; then
1202 if [ $withtap -eq "1" ]; then
1203 ok
$ret "Destroy session $sess_name failed as expected"
1206 if [ $withtap -eq "1" ]; then
1207 ok
$ret "Destroy session $sess_name"
1212 function destroy_lttng_session_ok
()
1214 destroy_lttng_session
1 0 "$@"
1218 function destroy_lttng_session_fail
()
1220 destroy_lttng_session
1 1 "$@"
1223 function destroy_lttng_session_notap
()
1225 destroy_lttng_session
0 0 "$@"
1228 function destroy_lttng_sessions
()
1230 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN destroy
--all 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1231 ok $?
"Destroy all lttng sessions"
1234 function lttng_snapshot_add_output
()
1236 local expected_to_fail
=$1
1240 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN snapshot add-output
-s $sess_name $trace_path 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1242 if [[ $expected_to_fail -eq 1 ]]; then
1244 ok $?
"Added snapshot output file://$trace_path failed as expected"
1246 ok
$ret "Added snapshot output file://$trace_path"
1250 function lttng_snapshot_add_output_ok
()
1252 lttng_snapshot_add_output
0 "$@"
1255 function lttng_snapshot_add_output_fail
()
1257 lttng_snapshot_add_output
1 "$@"
1260 function lttng_snapshot_del_output
()
1262 local expected_to_fail
=$1
1266 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN snapshot del-output
-s $sess_name $id 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1268 if [[ $expected_to_fail -eq "1" ]]; then
1270 ok $?
"Deleted snapshot output id $id failed as expected"
1272 ok
$ret "Deleted snapshot output id $id"
1276 function lttng_snapshot_del_output_ok
()
1278 lttng_snapshot_del_output
0 "$@"
1281 function lttng_snapshot_del_output_fail
()
1283 lttng_snapshot_del_output
1 "$@"
1286 function lttng_snapshot_record
()
1291 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN snapshot record
-s $sess_name $trace_path 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1292 ok $?
"Snapshot recorded"
1295 function lttng_snapshot_list
()
1298 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN snapshot list-output
-s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1299 ok $?
"Snapshot list"
1302 function lttng_save
()
1307 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN save
$sess_name $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1308 ok $?
"Session saved"
1311 function lttng_load
()
1313 local expected_to_fail
=$1
1316 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN load
$opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1318 if [[ $expected_to_fail -eq "1" ]]; then
1320 ok $?
"Load command failed as expected with opts: $opts"
1322 ok
$ret "Load command with opts: $opts"
1326 function lttng_load_ok
()
1331 function lttng_load_fail
()
1336 function lttng_track
()
1338 local expected_to_fail
=$1
1340 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN track
$opts >$OUTPUT_DEST
1342 if [[ $expected_to_fail -eq "1" ]]; then
1344 ok $?
"Track command failed as expected with opts: $opts"
1346 ok
$ret "Track command with opts: $opts"
1350 function lttng_track_ok
()
1355 function lttng_track_fail
()
1360 function lttng_untrack
()
1362 local expected_to_fail
=$1
1364 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN untrack
$opts >$OUTPUT_DEST
1366 if [[ $expected_to_fail -eq "1" ]]; then
1368 ok $?
"Untrack command failed as expected with opts: $opts"
1370 ok
$ret "Untrack command with opts: $opts"
1374 function lttng_untrack_ok
()
1376 lttng_untrack
0 "$@"
1379 function lttng_untrack_fail
()
1381 lttng_untrack
1 "$@"
1384 function lttng_track_pid_ok
()
1387 "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" track
--kernel --pid=$PID 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1388 ok $?
"Lttng track pid on the kernel domain"
1391 function lttng_untrack_kernel_all_ok
()
1393 "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" untrack
--kernel --pid --all 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1394 ok $?
"Lttng untrack all pid on the kernel domain"
1397 function lttng_add_context_list
()
1399 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN add-context
--list 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1401 ok
$ret "Context listing"
1404 function add_context_lttng
()
1406 local expected_to_fail
="$1"
1408 local session_name
="$3"
1409 local channel_name
="$4"
1412 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN add-context
-s $session_name -c $channel_name -t $type $domain 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1414 if [[ $expected_to_fail -eq "1" ]]; then
1416 ok $?
"Add context command failed as expected for type: $type"
1418 ok
$ret "Add context command for type: $type"
1422 function add_context_ust_ok
()
1424 add_context_lttng
0 -u "$@"
1427 function add_context_ust_fail
()
1429 add_context_lttng
1 -u "$@"
1432 function add_context_kernel_ok
()
1434 add_context_lttng
0 -k "$@"
1437 function add_context_kernel_fail
()
1439 add_context_lttng
1 -k "$@"
1442 function validate_metadata_event
()
1445 local nr_event_id
=$2
1448 local metadata_file
=$
(find $trace_path |
grep metadata
)
1449 local metadata_path
=$
(dirname $metadata_file)
1451 which $BABELTRACE_BIN >/dev
/null
1452 skip $?
-ne 0 "Babeltrace binary not found. Skipping trace matches"
1454 local count
=$
($BABELTRACE_BIN --output-format=ctf-metadata
$metadata_path |
grep $event_name |
wc -l)
1456 if [ "$count" -ne "$nr_event_id" ]; then
1457 fail
"Metadata match with the metadata of $count event(s) named $event_name"
1458 diag
"$count matching event id found in metadata"
1460 pass
"Metadata match with the metadata of $count event(s) named $event_name"
1465 function trace_matches
()
1471 which $BABELTRACE_BIN >/dev
/null
1472 skip $?
-ne 0 "Babeltrace binary not found. Skipping trace matches"
1474 local count
=$
($BABELTRACE_BIN $trace_path |
grep $event_name |
wc -l)
1476 if [ "$count" -ne "$nr_iter" ]; then
1478 diag
"$count matching events found in trace"
1484 function trace_match_only
()
1490 which $BABELTRACE_BIN >/dev
/null
1491 skip $?
-ne 0 "Babeltrace binary not found. Skipping trace matches"
1493 local count
=$
($BABELTRACE_BIN $trace_path |
grep $event_name |
wc -l)
1494 local total
=$
($BABELTRACE_BIN $trace_path |
wc -l)
1496 if [ "$nr_iter" -eq "$count" ] && [ "$total" -eq "$nr_iter" ]; then
1497 pass
"Trace match with $total event $event_name"
1500 diag
"$total event(s) found, expecting $nr_iter of event $event_name and only found $count"
1504 function validate_trace
1509 which $BABELTRACE_BIN >/dev
/null
1510 if [ $?
-ne 0 ]; then
1511 skip
0 "Babeltrace binary not found. Skipping trace validation"
1516 for i
in $event_name; do
1517 traced
=$
($BABELTRACE_BIN $trace_path 2>/dev
/null |
grep $i |
wc -l)
1518 if [ "$traced" -ne 0 ]; then
1519 pass
"Validate trace for event $i, $traced events"
1521 fail
"Validate trace for event $i"
1522 diag
"Found $traced occurences of $i"
1530 function validate_trace_count
1534 local expected_count
=$3
1536 which $BABELTRACE_BIN >/dev
/null
1537 if [ $?
-ne 0 ]; then
1538 skip
0 "Babeltrace binary not found. Skipping trace validation"
1544 for i
in $event_name; do
1545 traced
=$
($BABELTRACE_BIN $trace_path 2>/dev
/null |
grep $i |
wc -l)
1546 if [ "$traced" -ne 0 ]; then
1547 pass
"Validate trace for event $i, $traced events"
1549 fail
"Validate trace for event $i"
1550 diag
"Found $traced occurences of $i"
1552 cnt
=$
(($cnt + $traced))
1555 test $cnt -eq $expected_count
1556 ok $?
"Read a total of $cnt events, expected $expected_count"
1559 function trace_first_line
1563 which $BABELTRACE_BIN >/dev
/null
1564 if [ $?
-ne 0 ]; then
1565 skip
0 "Babeltrace binary not found. Skipping trace validation"
1568 $BABELTRACE_BIN $trace_path 2>/dev
/null |
head -n 1
1571 function validate_trace_exp
()
1576 which $BABELTRACE_BIN >/dev
/null
1577 skip $?
-ne 0 "Babeltrace binary not found. Skipping trace validation"
1579 traced
=$
($BABELTRACE_BIN $trace_path 2>/dev
/null |
grep --extended-regexp ${event_exp} |
wc -l)
1580 if [ "$traced" -ne 0 ]; then
1581 pass
"Validate trace for expression '${event_exp}', $traced events"
1583 fail
"Validate trace for expression '${event_exp}'"
1584 diag
"Found $traced occurences of '${event_exp}'"
1590 function validate_trace_only_exp
()
1595 which $BABELTRACE_BIN >/dev
/null
1596 skip $?
-ne 0 "Babeltrace binary not found. Skipping trace matches"
1598 local count
=$
($BABELTRACE_BIN $trace_path |
grep --extended-regexp ${event_exp} |
wc -l)
1599 local total
=$
($BABELTRACE_BIN $trace_path |
wc -l)
1601 if [ "$count" -ne 0 ] && [ "$total" -eq "$count" ]; then
1602 pass
"Trace match with $total for expression '${event_exp}'"
1605 diag
"$total syscall event(s) found, only syscalls matching expression '${event_exp}' ($count occurrences) are expected"
1611 function validate_trace_empty
()
1615 which $BABELTRACE_BIN >/dev
/null
1616 if [ $?
-ne 0 ]; then
1617 skip
0 "Babeltrace binary not found. Skipping trace validation"
1620 events
=$
($BABELTRACE_BIN $trace_path 2>/dev
/null
)
1622 if [ $ret -ne 0 ]; then
1623 fail
"Failed to parse trace"
1627 traced
=$
(echo -n "$events" |
wc -l)
1628 if [ "$traced" -eq 0 ]; then
1629 pass
"Validate empty trace"
1631 fail
"Validate empty trace"
1632 diag
"Found $traced events in trace"
1638 function regenerate_metadata
()
1640 local expected_to_fail
=$1
1643 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN regenerate metadata
-s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1645 if [[ $expected_to_fail -eq "1" ]]; then
1647 ok $?
"Expected fail on regenerate metadata $sess_name"
1649 ok
$ret "Metadata regenerate $sess_name"
1653 function regenerate_metadata_ok
()
1655 regenerate_metadata
0 "$@"
1658 function regenerate_metadata_fail
()
1660 regenerate_metadata
1 "$@"
1663 function regenerate_statedump
()
1665 local expected_to_fail
=$1
1668 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN regenerate statedump
-s $sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1670 if [[ $expected_to_fail -eq "1" ]]; then
1672 ok $?
"Expected fail on regenerate statedump $sess_name"
1674 ok
$ret "Metadata regenerate $sess_name"
1678 function regenerate_statedump_ok
()
1680 regenerate_statedump
0 "$@"
1683 function regenerate_statedump_fail
()
1685 regenerate_statedump
1 "$@"
1688 function rotate_session
()
1690 local expected_to_fail
=$1
1693 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN rotate
$sess_name 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1695 if [[ $expected_to_fail -eq "1" ]]; then
1697 ok $?
"Expected fail on rotate session $sess_name"
1699 ok
$ret "Rotate session $sess_name"
1703 function rotate_session_ok
()
1705 rotate_session
0 "$@"
1708 function rotate_session_fail
()
1710 rotate_session
1 "$@"
1713 function destructive_tests_enabled
()
1715 if [ ${LTTNG_ENABLE_DESTRUCTIVE_TESTS} = "will-break-my-system" ]; then
1722 function lttng_enable_rotation_timer
()
1724 local expected_to_fail
=$1
1728 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-rotation
-s $sess_name --timer $period 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1730 if [[ $expected_to_fail -eq "1" ]]; then
1732 ok $?
"Expected fail when setting periodic rotation ($period) of session $sess_name"
1734 ok
$ret "Set periodic rotation ($period) of session $sess_name"
1738 function lttng_enable_rotation_timer_ok
()
1740 lttng_enable_rotation_timer
0 $@
1743 function lttng_enable_rotation_timer_fail
()
1745 lttng_enable_rotation_timer
1 $@
1748 function lttng_enable_rotation_size
()
1750 local expected_to_fail
=$1
1754 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-rotation
-s $sess_name --size $size 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
1756 if [[ $expected_to_fail -eq "1" ]]; then
1758 ok $?
"Expected fail on rotate session $sess_name"
1760 ok
$ret "Rotate session $sess_name"
1764 function lttng_enable_rotation_size_ok
()
1766 lttng_enable_rotation_size
0 $@
1769 function lttng_enable_rotation_size_fail
()
1771 lttng_enable_rotation_size
1 $@