3 # Copyright (C) 2015 Philippe Proulx <pproulx@efficios.com>
4 # Copyright (C) 2014 David Goulet <dgoulet@efficios.com>
6 # SPDX-License-Identifier: GPL-2.0-only
8 TEST_DESC
="Python support"
11 TESTDIR
=$CURDIR/..
/..
/..
14 TESTAPP_NAME
="gen-py-events"
15 TESTAPP_BIN
="$TESTAPP_NAME.py"
16 TESTAPP_PATH
="$TESTDIR/utils/testapp/$TESTAPP_NAME/"
17 SESSION_NAME
="python-test"
18 EVENT_NAME
="python-ev-test1"
19 EVENT_NAME2
="python-ev-test2"
20 OUTPUT_DEST
="/dev/null"
22 python_versions
=(@PYTHON2_AGENT@ @PYTHON3_AGENT@
)
23 run_test
=@RUN_PYTHON_AGENT_TEST@
25 if [[ -z "$run_test" ]]; then
28 NUM_TESTS
=$
(((199 * ${#python_versions[@]})+2))
31 source $TESTDIR/utils
/utils.sh
37 local fire_second_tp
=$3
42 if [[ -n "$debug_tp" ]] && [ "$debug_tp" -eq "1" ]; then
46 if [[ -n "$fire_second_tp" ]] && [ "$fire_second_tp" -eq "1" ]; then
50 if [[ -n "$ready_file" ]]; then
51 opt
="${opt} -r ${ready_file}"
54 if [[ -n "$go_file" ]]; then
55 opt
="${opt} -g ${go_file}"
58 $python $TESTAPP_PATH/$TESTAPP_BIN -n $NR_ITER -s $NR_SEC_WAIT $opt
61 function run_app_background
66 function enable_python_loglevel_only
()
73 if [ -z $channel_name ]; then
74 # default channel if none specified
77 chan
="-c $channel_name"
80 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--loglevel-only $loglevel "$event_name" $chan -s $sess_name -p >$OUTPUT_DEST
81 ok $?
"Enable Python event $event_name for session $sess_name with loglevel-only $loglevel"
84 function enable_python_filter
()
90 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
"$event_name" -s $sess_name -p --filter "$filter" >$OUTPUT_DEST
91 ok $?
"Enable event $event_name with filter $filter for session $sess_name"
94 function enable_python_filter_loglevel_only
()
101 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN enable-event
--loglevel-only $loglevel "$event_name" -s $sess_name -p --filter "$filter" >$OUTPUT_DEST
102 ok $?
"Enable event $event_name with filter \"$filter\" and loglevel-only $loglevel for session $sess_name"
105 # MUST set TESTDIR before calling those functions
107 function test_python_before_start
()
109 local ready_file
=$
(mktemp
--tmpdir -u)
110 local go_file
=$
(mktemp
--tmpdir -u)
112 diag
"Test Python application BEFORE tracing starts"
113 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
114 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
116 # Run 5 times with a 1 second delay
117 run_app_background
$1 "" "" $ready_file $go_file
119 # Wait for ready file
120 while [ ! -e ${ready_file} ]; do
124 start_lttng_tracing_ok
$SESSION_NAME
126 # Wait for the applications started in background
127 echo "1" > ${go_file}
130 stop_lttng_tracing_ok
$SESSION_NAME
131 destroy_lttng_session_ok
$SESSION_NAME
133 # Validate test. Expecting all events.
134 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH
135 if [ $?
-ne 0 ]; then
142 function test_python_after_start
()
144 diag
"Test Python application AFTER tracing starts"
146 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
147 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
148 start_lttng_tracing_ok
$SESSION_NAME
150 # Run 5 times with a 1 second delay
153 stop_lttng_tracing_ok
$SESSION_NAME
154 destroy_lttng_session_ok
$SESSION_NAME
156 # Validate test. Expecting all events.
157 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH
158 if [ $?
-ne 0 ]; then
163 function test_python_loglevel
()
165 diag
"Test Python application with loglevel"
167 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
168 enable_python_lttng_event_loglevel
$SESSION_NAME $EVENT_NAME "INFO"
169 start_lttng_tracing_ok
$SESSION_NAME
171 # Run 5 times with a 1 second delay
174 stop_lttng_tracing_ok
$SESSION_NAME
175 destroy_lttng_session_ok
$SESSION_NAME
177 # Validate test. Expecting all events.
178 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH
179 if [ $?
-ne 0 ]; then
183 diag
"Test Python applications with lower loglevel"
185 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
186 enable_python_lttng_event_loglevel
$SESSION_NAME $EVENT_NAME "CRITICAL"
187 start_lttng_tracing_ok
$SESSION_NAME
189 # Run 5 times with a 1 second delay
192 stop_lttng_tracing_ok
$SESSION_NAME
193 destroy_lttng_session_ok
$SESSION_NAME
195 # Validate test. Expecting 0 events.
196 trace_match_only
$EVENT_NAME 0 $TRACE_PATH
197 if [ $?
-ne 0 ]; then
201 diag
"Test Python applications with higher loglevel"
203 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
204 enable_python_lttng_event_loglevel
$SESSION_NAME $EVENT_NAME "DEBUG"
205 start_lttng_tracing_ok
$SESSION_NAME
207 # Run 5 times with a 1 second delay
210 stop_lttng_tracing_ok
$SESSION_NAME
211 destroy_lttng_session_ok
$SESSION_NAME
213 # Validate test. Expecting all events.
214 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH
218 function test_python_loglevel_multiple
()
220 diag
"Test Python application with multiple loglevel"
222 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
223 enable_python_lttng_event_loglevel
$SESSION_NAME $EVENT_NAME "INFO"
224 enable_python_lttng_event_loglevel
$SESSION_NAME $EVENT_NAME "DEBUG"
225 start_lttng_tracing_ok
$SESSION_NAME
227 # Run 5 times with a 1 second delay and fire two TP.
230 stop_lttng_tracing_ok
$SESSION_NAME
231 destroy_lttng_session_ok
$SESSION_NAME
233 # Validate test. Expecting all events times two.
234 trace_match_only
$EVENT_NAME $
(($NR_ITER * 2)) $TRACE_PATH
235 if [ $?
-ne 0 ]; then
239 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH
240 enable_python_lttng_event_loglevel
$SESSION_NAME '*' "INFO"
241 enable_python_lttng_event_loglevel
$SESSION_NAME '*' "DEBUG"
242 start_lttng_tracing_ok
$SESSION_NAME
244 # Run 5 times with a 1 second delay and fire two TP.
247 stop_lttng_tracing_ok
$SESSION_NAME
248 destroy_lttng_session_ok
$SESSION_NAME
250 # Validate test. Expecting all events times two.
251 trace_match_only
$EVENT_NAME $
(($NR_ITER * 2)) $TRACE_PATH
252 if [ $?
-ne 0 ]; then
257 function test_python_multi_session_loglevel
()
259 diag
"Test Python with multiple session"
261 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
262 enable_python_loglevel_only
$SESSION_NAME-1 '*' "INFO"
263 start_lttng_tracing_ok
$SESSION_NAME-1
265 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
266 enable_python_loglevel_only
$SESSION_NAME-2 '*' "DEBUG"
267 start_lttng_tracing_ok
$SESSION_NAME-2
269 # Run 5 times with a 1 second delay and fire second TP.
272 stop_lttng_tracing_ok
$SESSION_NAME-1
273 stop_lttng_tracing_ok
$SESSION_NAME-2
274 destroy_lttng_session_ok
$SESSION_NAME-1
275 destroy_lttng_session_ok
$SESSION_NAME-2
277 # Expecting NR_ITER events being the main event and the second tp one.
278 trace_matches
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-1
279 if [ $?
-ne 0 ]; then
282 trace_matches
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
283 if [ $?
-ne 0 ]; then
287 # Expectin NR_ITER events being the debug TP.
288 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
289 if [ $?
-ne 0 ]; then
294 function test_python_multi_session_disable
()
296 diag
"Test Python with multiple session with disabled event"
298 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
299 enable_python_lttng_event
$SESSION_NAME-1 $EVENT_NAME
300 enable_python_lttng_event
$SESSION_NAME-1 $EVENT_NAME2
301 disable_python_lttng_event
$SESSION_NAME-1 $EVENT_NAME
302 start_lttng_tracing_ok
$SESSION_NAME-1
304 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
305 enable_python_lttng_event
$SESSION_NAME-2 $EVENT_NAME2
306 start_lttng_tracing_ok
$SESSION_NAME-2
308 # Run 5 times with a 1 second delay and fire second TP.
311 stop_lttng_tracing_ok
$SESSION_NAME-1
312 stop_lttng_tracing_ok
$SESSION_NAME-2
313 destroy_lttng_session_ok
$SESSION_NAME-1
314 destroy_lttng_session_ok
$SESSION_NAME-2
316 # Validate test. Expecting one event of the second TP.
317 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
318 if [ $?
-ne 0 ]; then
322 # Validate test. Expecting one event of the second TP.
323 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
324 if [ $?
-ne 0 ]; then
329 function test_python_multi_session_disable_wildcard
()
331 diag
"Test Python with multiple session with disabled wildcard event"
333 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
334 enable_python_lttng_event
$SESSION_NAME-1 '*'
336 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
337 enable_python_lttng_event
$SESSION_NAME-2 '*'
339 disable_python_lttng_event
$SESSION_NAME-1 '*'
341 start_lttng_tracing_ok
$SESSION_NAME-1
342 start_lttng_tracing_ok
$SESSION_NAME-2
346 stop_lttng_tracing_ok
$SESSION_NAME-1
347 stop_lttng_tracing_ok
$SESSION_NAME-2
348 destroy_lttng_session_ok
$SESSION_NAME-1
349 destroy_lttng_session_ok
$SESSION_NAME-2
351 # Validate test. Expecting NO event of the first TP.
352 trace_match_only
$EVENT_NAME 0 $TRACE_PATH/$SESSION_NAME-1
353 if [ $?
-ne 0 ]; then
357 # Validate test. Expecting all events of the first TP.
358 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
359 if [ $?
-ne 0 ]; then
364 function test_python_multi_session_disable_wildcard_begin
()
367 diag
"Test Python with multiple session with disabled wildcard (at the beginning) event"
369 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
370 enable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
372 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
373 enable_python_lttng_event
$SESSION_NAME-2 "$ev_name"
375 disable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
377 start_lttng_tracing_ok
$SESSION_NAME-1
378 start_lttng_tracing_ok
$SESSION_NAME-2
382 stop_lttng_tracing_ok
$SESSION_NAME-1
383 stop_lttng_tracing_ok
$SESSION_NAME-2
384 destroy_lttng_session_ok
$SESSION_NAME-1
385 destroy_lttng_session_ok
$SESSION_NAME-2
387 # Validate test. Expecting NO event of the first TP.
388 trace_match_only
$EVENT_NAME 0 $TRACE_PATH/$SESSION_NAME-1
389 if [ $?
-ne 0 ]; then
393 # Validate test. Expecting all events of the first TP.
394 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
395 if [ $?
-ne 0 ]; then
400 function test_python_multi_session_disable_wildcard_middle
()
402 ev_name
='python-*-test1'
403 diag
"Test Python with multiple session with disabled wildcard (at the middle) event"
405 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
406 enable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
408 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
409 enable_python_lttng_event
$SESSION_NAME-2 "$ev_name"
411 disable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
413 start_lttng_tracing_ok
$SESSION_NAME-1
414 start_lttng_tracing_ok
$SESSION_NAME-2
418 stop_lttng_tracing_ok
$SESSION_NAME-1
419 stop_lttng_tracing_ok
$SESSION_NAME-2
420 destroy_lttng_session_ok
$SESSION_NAME-1
421 destroy_lttng_session_ok
$SESSION_NAME-2
423 # Validate test. Expecting NO event of the first TP.
424 trace_match_only
$EVENT_NAME 0 $TRACE_PATH/$SESSION_NAME-1
425 if [ $?
-ne 0 ]; then
429 # Validate test. Expecting all events of the first TP.
430 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
431 if [ $?
-ne 0 ]; then
436 function test_python_multi_session_disable_wildcard_end
()
439 diag
"Test Python with multiple session with disabled wildcard (at the end) event"
441 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
442 enable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
444 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
445 enable_python_lttng_event
$SESSION_NAME-2 "$ev_name"
447 disable_python_lttng_event
$SESSION_NAME-1 "$ev_name"
449 start_lttng_tracing_ok
$SESSION_NAME-1
450 start_lttng_tracing_ok
$SESSION_NAME-2
454 stop_lttng_tracing_ok
$SESSION_NAME-1
455 stop_lttng_tracing_ok
$SESSION_NAME-2
456 destroy_lttng_session_ok
$SESSION_NAME-1
457 destroy_lttng_session_ok
$SESSION_NAME-2
459 # Validate test. Expecting NO event of the first TP.
460 trace_match_only
$EVENT_NAME 0 $TRACE_PATH/$SESSION_NAME-1
461 if [ $?
-ne 0 ]; then
465 # Validate test. Expecting all events of the first TP.
466 trace_matches
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
467 if [ $?
-ne 0 ]; then
471 trace_matches
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
472 if [ $?
-ne 0 ]; then
477 function test_python_disable_all
()
479 diag
"Test Python with multiple session with disabled all event"
481 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
482 enable_python_lttng_event
$SESSION_NAME '*'
483 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
484 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME2
486 disable_python_lttng_event
$SESSION_NAME -a
488 start_lttng_tracing_ok
$SESSION_NAME
492 stop_lttng_tracing_ok
$SESSION_NAME
493 destroy_lttng_session_ok
$SESSION_NAME
495 # Validate test. Expecting NO event of the first TP and second TP.
496 trace_match_only
$EVENT_NAME 0 $TRACE_PATH/$SESSION_NAME
497 trace_match_only
$EVENT_NAME2 0 $TRACE_PATH/$SESSION_NAME
498 if [ $?
-ne 0 ]; then
503 function test_python_multi_session
()
505 diag
"Test Python with multiple session"
507 create_lttng_session_ok
$SESSION_NAME-1 $TRACE_PATH/$SESSION_NAME-1
508 enable_python_lttng_event
$SESSION_NAME-1 $EVENT_NAME
509 start_lttng_tracing_ok
$SESSION_NAME-1
511 create_lttng_session_ok
$SESSION_NAME-2 $TRACE_PATH/$SESSION_NAME-2
512 enable_python_lttng_event
$SESSION_NAME-2 $EVENT_NAME2
513 start_lttng_tracing_ok
$SESSION_NAME-2
515 # Run 5 times with a 1 second delay and fire second TP.
518 stop_lttng_tracing_ok
$SESSION_NAME-1
519 stop_lttng_tracing_ok
$SESSION_NAME-2
520 destroy_lttng_session_ok
$SESSION_NAME-1
521 destroy_lttng_session_ok
$SESSION_NAME-2
523 # Validate test. Expecting all events of first TP
524 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-1
525 if [ $?
-ne 0 ]; then
529 # Validate test. Expecting one event of the second TP.
530 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
531 if [ $?
-ne 0 ]; then
536 function test_python_destroy_session
()
538 diag
"Test Python two session with destroy"
540 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/first-sess
541 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
542 start_lttng_tracing_ok
$SESSION_NAME
544 # Run 5 times with a 1 second delay
547 stop_lttng_tracing_ok
$SESSION_NAME
548 destroy_lttng_session_ok
$SESSION_NAME
550 # Validate test. Expecting at least one event num 1
551 validate_trace
$EVENT_NAME $TRACE_PATH/first-sess
552 if [ $?
-ne 0 ]; then
556 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/second-sess
557 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME2
558 start_lttng_tracing_ok
$SESSION_NAME
562 stop_lttng_tracing_ok
$SESSION_NAME
563 destroy_lttng_session_ok
$SESSION_NAME
565 # Validate test. Expecting only one event num 2
566 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/second-sess
567 if [ $?
-ne 0 ]; then
572 function test_python_filtering
()
574 diag
"Test Python filtering"
576 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
577 # Enable all event with a filter.
578 enable_python_filter
$SESSION_NAME '*' 'msg == "python-ev-test2 fired [INFO]"'
579 start_lttng_tracing_ok
$SESSION_NAME
581 # Run 5 times with a 1 second delay and fire second TP.
584 stop_lttng_tracing_ok
$SESSION_NAME
585 destroy_lttng_session_ok
$SESSION_NAME
587 # Validate test. Expecting one event of the second TP only.
588 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
589 if [ $?
-ne 0 ]; then
593 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
594 # Enable first Logger but filter msg payload for the INFO one while
595 # triggering the debug and second TP.
596 enable_python_filter
$SESSION_NAME $EVENT_NAME 'msg == "python-ev-test1 fired [INFO]"'
597 start_lttng_tracing_ok
$SESSION_NAME
599 # Run 5 times with a 1 second delay, fire debug and second TP.
602 stop_lttng_tracing_ok
$SESSION_NAME
603 destroy_lttng_session_ok
$SESSION_NAME
605 # Validate test. Expecting NR_ITER event of the main INFO tp.
606 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
607 if [ $?
-ne 0 ]; then
612 function test_python_disable
()
614 diag
"Test Python disable event"
616 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
617 # Enable all event with a filter.
618 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
619 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME2
620 disable_python_lttng_event
$SESSION_NAME $EVENT_NAME
621 start_lttng_tracing_ok
$SESSION_NAME
623 # Run 5 times with a 1 second delay and fire second TP.
626 stop_lttng_tracing_ok
$SESSION_NAME
627 destroy_lttng_session_ok
$SESSION_NAME
629 # Validate test. Expecting one event of the second TP only.
630 trace_match_only
$EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
631 if [ $?
-ne 0 ]; then
636 function test_python_disable_enable
()
638 diag
"Test Python disable event followed by an enable"
640 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
641 # Enable all event with a filter.
642 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
643 disable_python_lttng_event
$SESSION_NAME $EVENT_NAME
644 enable_python_lttng_event
$SESSION_NAME $EVENT_NAME
645 start_lttng_tracing_ok
$SESSION_NAME
647 # Run 5 times with a 1 second delay and fire second TP.
650 stop_lttng_tracing_ok
$SESSION_NAME
651 destroy_lttng_session_ok
$SESSION_NAME
653 # Validate test. Expecting NR_ITER event of the main INFO tp.
654 trace_match_only
$EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
655 if [ $?
-ne 0 ]; then
660 function test_python_filter_loglevel
()
662 local BOGUS_EVENT_NAME
="not_a_real_event"
663 local FILTER
="int_loglevel > 30 || int_loglevel < 30"
666 diag
"Test Python a filter with a loglevel"
668 create_lttng_session_ok
$SESSION_NAME $TRACE_PATH/$SESSION_NAME
669 # Enable an event with a filter and the loglevel-only option.
670 enable_python_filter_loglevel_only
$SESSION_NAME $BOGUS_EVENT_NAME "$FILTER" "INFO"
671 disable_python_lttng_event
$SESSION_NAME $BOGUS_EVENT_NAME
672 enable_python_filter_loglevel_only
$SESSION_NAME $BOGUS_EVENT_NAME "$FILTER" "INFO"
673 start_lttng_tracing_ok
$SESSION_NAME
675 # Run 5 times with a 1 second delay and fire second TP.
678 stop_lttng_tracing_ok
$SESSION_NAME
679 destroy_lttng_session_ok
$SESSION_NAME
681 # Validate test. Expecting no events.
682 trace_match_only
$ALL_EVENTS 0 $TRACE_PATH/$SESSION_NAME
683 if [ $?
-ne 0 ]; then
688 function test_python_trigger_notify_action
691 tmp_expected_stdout
=$
(mktemp
--tmpdir -t test_list_triggers_python_cli_expected_stdout.XXXXXX
)
693 diag
"Test Python trigger with notify action"
695 lttng_add_trigger_ok
"my_python_trigger" \
696 --condition event-rule-matches
--type=python
--action notify
698 cat > "${tmp_expected_stdout}" <<- EOF
699 - name: my_python_trigger
701 condition: event rule matches
702 rule: * (type: python:logging)
710 list_triggers_matches_ok
"Python trigger listing" "${tmp_expected_stdout}"
712 lttng_remove_trigger_ok
"my_python_trigger"
714 rm -f "${tmp_expected_stdout}"
717 plan_tests
$NUM_TESTS
719 print_test_banner
"$TEST_DESC"
721 if [[ ${#python_versions[@]} -eq 0 ||
"x$run_test" != "xyes" ]]; then
727 skip
$skip_agent "Python agent test skipped." $NUM_TESTS ||
732 test_python_multi_session_disable_wildcard
733 test_python_multi_session_disable_wildcard_begin
734 test_python_multi_session_disable_wildcard_middle
735 test_python_multi_session_disable_wildcard_end
736 test_python_multi_session_disable
738 test_python_disable_enable
739 test_python_disable_all
740 test_python_filtering
741 test_python_multi_session_loglevel
742 test_python_destroy_session
744 test_python_loglevel_multiple
745 test_python_before_start
746 test_python_after_start
747 test_python_multi_session
748 test_python_filter_loglevel
749 test_python_trigger_notify_action
753 for python_version
in ${python_versions[*]};
755 for fct_test
in ${tests[@]};
757 TRACE_PATH
=$
(mktemp
--tmpdir -d tmp.test_python_logging_trace_path.XXXXXX
)
759 diag
"(Python $python_version)"
760 ${fct_test} $python_version
761 if [ $?
-ne 0 ]; then