From 646e8a3020e8e84cbdcc3fafd15cce087fc42bec Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 13 Feb 2025 10:16:29 -0500 Subject: [PATCH] tests: Disable tap for shell scripts that only invoke the test scripts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In successful test runs there is the following line in some cases # Looks like your test died before it could output anything This happens due the test script's util.sh automatically "starting" the TAP state; however, in these cases the actual tap output is produced by other scripts or binaries. Change-Id: Iad8f74b0fc1b0a998eba3171d7a2626cd3e86824 Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- tests/regression/tools/live/test_kernel | 1 + tests/regression/tools/live/test_ust | 1 + .../tools/live/test_ust_tracefile_count | 1 + .../test_notification_kernel_buffer_usage | 2 ++ .../notification/test_notification_kernel_capture | 1 + .../notification/test_notification_kernel_error | 1 + .../test_notification_kernel_instrumentation | 1 + .../notification/test_notification_kernel_syscall | 1 + .../test_notification_kernel_userspace_probe | 1 + .../test_notification_ust_buffer_usage | 15 ++++++++++++++- .../notification/test_notification_ust_capture | 1 + .../notification/test_notification_ust_error | 3 +++ ...otification_ust_event_rule_condition_exclusion | 1 + tests/regression/tools/notification/test_rotation | 2 ++ tests/regression/tools/rotation/test_schedule_api | 1 + .../tools/trigger/hidden/test_hidden_trigger | 1 + .../name/test_trigger_name_backwards_compat | 1 + .../ust/baddr-statedump/test_baddr-statedump | 1 + tests/regression/ust/daemon/test_daemon | 1 + tests/regression/ust/exit-fast/test_exit-fast | 1 + tests/regression/ust/fork/test_fork | 1 + .../regression/ust/libc-wrapper/test_libc-wrapper | 1 + tests/regression/ust/linking/test_linking | 1 + .../ust/type-declarations/test_type_declarations | 1 + tests/regression/ust/ust-dl/test_ust-dl.in | 1 + 25 files changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/regression/tools/live/test_kernel b/tests/regression/tools/live/test_kernel index 2edba96cc..1d3645382 100755 --- a/tests/regression/tools/live/test_kernel +++ b/tests/regression/tools/live/test_kernel @@ -46,6 +46,7 @@ check_skip_kernel_test && } modprobe lttng-test +tap_disable start_lttng_sessiond_notap start_lttng_relayd_notap "-o $TRACE_PATH" diff --git a/tests/regression/tools/live/test_ust b/tests/regression/tools/live/test_ust index c3bf09345..2ce711ce3 100755 --- a/tests/regression/tools/live/test_ust +++ b/tests/regression/tools/live/test_ust @@ -26,6 +26,7 @@ DIR=$(readlink -f $TESTDIR) source $TESTDIR/utils/utils.sh echo "$TEST_DESC" +tap_disable function setup_live_tracing() { diff --git a/tests/regression/tools/live/test_ust_tracefile_count b/tests/regression/tools/live/test_ust_tracefile_count index 11c6e9431..180133c08 100755 --- a/tests/regression/tools/live/test_ust_tracefile_count +++ b/tests/regression/tools/live/test_ust_tracefile_count @@ -26,6 +26,7 @@ DIR=$(readlink -f $TESTDIR) source $TESTDIR/utils/utils.sh echo "$TEST_DESC" +tap_disable function setup_live_tracing() { diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage index dcff9e61b..4c2152a3b 100755 --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage @@ -70,6 +70,8 @@ check_skip_kernel_test && exit 0 } +tap_disable + validate_lttng_modules_present modprobe lttng-test diff --git a/tests/regression/tools/notification/test_notification_kernel_capture b/tests/regression/tools/notification/test_notification_kernel_capture index fa33b2540..e2d340f18 100755 --- a/tests/regression/tools/notification/test_notification_kernel_capture +++ b/tests/regression/tools/notification/test_notification_kernel_capture @@ -38,6 +38,7 @@ check_skip_kernel_test && } validate_lttng_modules_present +tap_disable modprobe lttng-test diff --git a/tests/regression/tools/notification/test_notification_kernel_error b/tests/regression/tools/notification/test_notification_kernel_error index 2efcb5949..40bb9c2d3 100755 --- a/tests/regression/tools/notification/test_notification_kernel_error +++ b/tests/regression/tools/notification/test_notification_kernel_error @@ -37,6 +37,7 @@ check_skip_kernel_test && } validate_lttng_modules_present +tap_disable modprobe lttng-test diff --git a/tests/regression/tools/notification/test_notification_kernel_instrumentation b/tests/regression/tools/notification/test_notification_kernel_instrumentation index 04545a17b..755ef280e 100755 --- a/tests/regression/tools/notification/test_notification_kernel_instrumentation +++ b/tests/regression/tools/notification/test_notification_kernel_instrumentation @@ -35,6 +35,7 @@ check_skip_kernel_test && } validate_lttng_modules_present +tap_disable modprobe lttng-test diff --git a/tests/regression/tools/notification/test_notification_kernel_syscall b/tests/regression/tools/notification/test_notification_kernel_syscall index ca4e89369..c15e1cce6 100755 --- a/tests/regression/tools/notification/test_notification_kernel_syscall +++ b/tests/regression/tools/notification/test_notification_kernel_syscall @@ -38,6 +38,7 @@ check_skip_kernel_test && } validate_lttng_modules_present +tap_disable start_lttng_sessiond_notap diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe index f1e3e6311..21e8a0651 100755 --- a/tests/regression/tools/notification/test_notification_kernel_userspace_probe +++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe @@ -36,6 +36,7 @@ check_skip_kernel_test && } validate_lttng_modules_present +tap_disable start_lttng_sessiond_notap diff --git a/tests/regression/tools/notification/test_notification_ust_buffer_usage b/tests/regression/tools/notification/test_notification_ust_buffer_usage index bd1c146de..c64c98870 100755 --- a/tests/regression/tools/notification/test_notification_ust_buffer_usage +++ b/tests/regression/tools/notification/test_notification_ust_buffer_usage @@ -54,21 +54,34 @@ function test_buffer_usage_notification ust_event_generator "$GEN_UST_EVENTS_TESTAPP_BIN" "$TESTAPP_STATE_PATH" & APP_PID=$! + diag "Started generator pid $APP_PID" + while pgrep notification ; do + diag "WARNING: notification already running" + kill $(pgrep notification) + sleep 1 + done + diag "$CURDIR/notification 2 LTTNG_DOMAIN_UST $APP_PID $TESTAPP_STATE_PATH $SESSION_NAME $CHANNEL_NAME ${consumerd_pipe[@]}" "$CURDIR/notification" 2 LTTNG_DOMAIN_UST $APP_PID "$TESTAPP_STATE_PATH" \ - $SESSION_NAME $CHANNEL_NAME "${consumerd_pipe[@]}" + $SESSION_NAME $CHANNEL_NAME "${consumerd_pipe[@]}" destroy_lttng_session_notap $SESSION_NAME # On ungraceful kill the app is cleaned up via the full_cleanup call # Suppress kill message kill -SIGUSR2 $APP_PID + diag "About to wait on PID $APP_PID" wait $APP_PID 2> /dev/null + diag "Wait done" # Just in case cleanup rm -rf "$TRACE_PATH" + diag "Test done" } +# Avoid spurious messages about exiting before the test output anything on cleanup +tap_disable + LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} LD_PRELOAD=${TESTPOINT}" start_lttng_sessiond_notap diff --git a/tests/regression/tools/notification/test_notification_ust_capture b/tests/regression/tools/notification/test_notification_ust_capture index bcd468e64..ef88d7685 100755 --- a/tests/regression/tools/notification/test_notification_ust_capture +++ b/tests/regression/tools/notification/test_notification_ust_capture @@ -31,6 +31,7 @@ function test_basic_error_path wait $APP_PID 2> /dev/null } +tap_disable start_lttng_sessiond_notap test_basic_error_path diff --git a/tests/regression/tools/notification/test_notification_ust_error b/tests/regression/tools/notification/test_notification_ust_error index fdfd88011..473461ced 100755 --- a/tests/regression/tools/notification/test_notification_ust_error +++ b/tests/regression/tools/notification/test_notification_ust_error @@ -31,6 +31,9 @@ function test_basic_error_path wait $APP_PID 2> /dev/null } +# Avoid spurious tap messages from the shell runner +tap_disable + start_lttng_sessiond_notap test_basic_error_path diff --git a/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion b/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion index 6a0cff484..a84bb2fb2 100755 --- a/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion +++ b/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion @@ -30,6 +30,7 @@ function test_event_rule_condition_exclusion_notification wait $APP_PID 2> /dev/null } +tap_disable start_lttng_sessiond_notap test_event_rule_condition_exclusion_notification diff --git a/tests/regression/tools/notification/test_rotation b/tests/regression/tools/notification/test_rotation index 432919349..e033c7725 100755 --- a/tests/regression/tools/notification/test_rotation +++ b/tests/regression/tools/notification/test_rotation @@ -26,7 +26,9 @@ NR_USEC_WAIT=5 DIR=$(readlink -f $TESTDIR) source $TESTDIR/utils/utils.sh + start_lttng_sessiond_notap +tap_disable create_lttng_session_notap $SESSION_NAME $SESSION_OUTPUT_PATH diff --git a/tests/regression/tools/rotation/test_schedule_api b/tests/regression/tools/rotation/test_schedule_api index a9f99f21e..89ea4850f 100755 --- a/tests/regression/tools/rotation/test_schedule_api +++ b/tests/regression/tools/rotation/test_schedule_api @@ -17,6 +17,7 @@ source $TESTDIR/utils/utils.sh print_test_banner "$TEST_DESC" start_lttng_sessiond_notap +tap_disable create_lttng_session_notap $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/tools/trigger/hidden/test_hidden_trigger b/tests/regression/tools/trigger/hidden/test_hidden_trigger index 13e9dc610..307d06f82 100755 --- a/tests/regression/tools/trigger/hidden/test_hidden_trigger +++ b/tests/regression/tools/trigger/hidden/test_hidden_trigger @@ -18,6 +18,7 @@ HIDDEN_TRIGGER_BIN="$CURDIR/hidden_trigger" # MUST set TESTDIR before calling those functions start_lttng_sessiond_notap +tap_disable $HIDDEN_TRIGGER_BIN "$TRACE_PATH" diff --git a/tests/regression/tools/trigger/name/test_trigger_name_backwards_compat b/tests/regression/tools/trigger/name/test_trigger_name_backwards_compat index 0203368a0..0e79045d7 100755 --- a/tests/regression/tools/trigger/name/test_trigger_name_backwards_compat +++ b/tests/regression/tools/trigger/name/test_trigger_name_backwards_compat @@ -17,6 +17,7 @@ TRIGGER_NAME_BIN="$CURDIR/trigger_name" # MUST set TESTDIR before calling those functions start_lttng_sessiond_notap +tap_disable $TRIGGER_NAME_BIN diff --git a/tests/regression/ust/baddr-statedump/test_baddr-statedump b/tests/regression/ust/baddr-statedump/test_baddr-statedump index 9ab5d9bf3..7848dfd58 100755 --- a/tests/regression/ust/baddr-statedump/test_baddr-statedump +++ b/tests/regression/ust/baddr-statedump/test_baddr-statedump @@ -9,6 +9,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh +tap_disable start_lttng_sessiond_notap python3 ${CURDIR}/test_baddr-statedump.py diff --git a/tests/regression/ust/daemon/test_daemon b/tests/regression/ust/daemon/test_daemon index 5c42e8cc9..7b87cdb54 100755 --- a/tests/regression/ust/daemon/test_daemon +++ b/tests/regression/ust/daemon/test_daemon @@ -10,6 +10,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_daemon.py diff --git a/tests/regression/ust/exit-fast/test_exit-fast b/tests/regression/ust/exit-fast/test_exit-fast index 1919bcc45..8941b875f 100755 --- a/tests/regression/ust/exit-fast/test_exit-fast +++ b/tests/regression/ust/exit-fast/test_exit-fast @@ -10,6 +10,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_exit-fast.py diff --git a/tests/regression/ust/fork/test_fork b/tests/regression/ust/fork/test_fork index 598308e6d..c21ce82b6 100755 --- a/tests/regression/ust/fork/test_fork +++ b/tests/regression/ust/fork/test_fork @@ -10,6 +10,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_fork.py diff --git a/tests/regression/ust/libc-wrapper/test_libc-wrapper b/tests/regression/ust/libc-wrapper/test_libc-wrapper index f80379b5d..44401ec6c 100755 --- a/tests/regression/ust/libc-wrapper/test_libc-wrapper +++ b/tests/regression/ust/libc-wrapper/test_libc-wrapper @@ -10,6 +10,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_libc-wrapper.py diff --git a/tests/regression/ust/linking/test_linking b/tests/regression/ust/linking/test_linking index 89ea46222..793df3e7d 100755 --- a/tests/regression/ust/linking/test_linking +++ b/tests/regression/ust/linking/test_linking @@ -11,6 +11,7 @@ source $TESTDIR/utils/utils.sh # Try to launch a sessiond before invoking the python test script start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_linking.py diff --git a/tests/regression/ust/type-declarations/test_type_declarations b/tests/regression/ust/type-declarations/test_type_declarations index 4559f108f..442d2e22b 100755 --- a/tests/regression/ust/type-declarations/test_type_declarations +++ b/tests/regression/ust/type-declarations/test_type_declarations @@ -12,6 +12,7 @@ TESTDIR=${CURDIR}/../../.. source $TESTDIR/utils/utils.sh +tap_disable start_lttng_sessiond_notap python3 ${CURDIR}/test_type_declarations.py diff --git a/tests/regression/ust/ust-dl/test_ust-dl.in b/tests/regression/ust/ust-dl/test_ust-dl.in index 198e4ac97..d6dcaa3a3 100644 --- a/tests/regression/ust/ust-dl/test_ust-dl.in +++ b/tests/regression/ust/ust-dl/test_ust-dl.in @@ -17,6 +17,7 @@ fi export LTTNG_TOOLS_HAVE_DLMOPEN=@HAVE_DLMOPEN@ start_lttng_sessiond_notap +tap_disable python3 ${CURDIR}/test_ust-dl.py -- 2.39.5