X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_multi_app;h=a7156c4fea1dd31a95694476d5a86eac67fb046d;hb=3a1744008331a0604479d3d7461f77056fad3a64;hp=afac94d1042ad16e4ec68c7a31ff6ec2a2b52d18;hpb=25cb2044b0c8132fcce62783c9ab487840a001f2;p=lttng-tools.git diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app index afac94d10..a7156c4fe 100755 --- a/tests/regression/tools/notification/test_notification_multi_app +++ b/tests/regression/tools/notification/test_notification_multi_app @@ -14,7 +14,7 @@ TESTPOINT=$(readlink -f ${CURDIR}/.libs/libpause_consumer.so) TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" -TESTAPP_STATE_FILE="$(mktemp -u)" +TESTAPP_STATE_FILE="$(mktemp -u -t tmp.test_notification_multi_app_state_file.XXXXXX)" NR_ITER=1000 NR_USEC_WAIT=5 @@ -35,7 +35,7 @@ source $TESTDIR/utils/utils.sh source $CURDIR/util_event_generator.sh consumerd_pipe=() -file_sync_after_first_event=$(mktemp -u) +file_sync_after_first_event=$(mktemp -u -t tmp.test_notification_multi_app_sync_after_first.XXXXXX) # MUST set TESTDIR before calling those functions plan_tests $NUM_TESTS @@ -54,8 +54,9 @@ function start_client { local buffer_usage_threshold_type=$6 local buffer_usage_threshold_value=$7 local nr_expected_notification=$8 + local use_action_list=$9 - ${CURDIR}/base_client ${session_name} ${channel_name} ${domain_type} ${buffer_usage_type} ${buffer_usage_threshold_type} ${buffer_usage_threshold_value} ${nr_expected_notification} > ${output_file} & + ${CURDIR}/base_client ${session_name} ${channel_name} ${domain_type} ${buffer_usage_type} ${buffer_usage_threshold_type} ${buffer_usage_threshold_value} ${nr_expected_notification} ${use_action_list} > ${output_file} & pid=$! app_pids+=("$pid") @@ -134,10 +135,10 @@ function test_multi_app () local app_pids=() local low_output_file_pattern="low_app_output_file_" local high_output_file_pattern="high_app_output_file_" - local output_dir=$(mktemp -d) + local output_dir=$(mktemp -d -t "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") local testpoint_base_path=$(readlink -f "$output_dir/lttng.t_p_n_multi_app") - local testpoint_pipe_path=$(mktemp -u "${testpoint_base_path}.XXXXXX") + local testpoint_pipe_path=$(TMPDIR="$output_dir" mktemp -u -t "lttng.t_p_n_multi_app.XXXXXX") local nr_notification_expected=5 local nr_client_app=50 @@ -177,8 +178,8 @@ function test_multi_app () for (( i = 0; i < $nr_client_app; i++ )); do low_app_output_file=$output_dir/${low_output_file_pattern}${i} high_app_output_file=$output_dir/${high_output_file_pattern}${i} - start_client $low_app_output_file $SESSION_NAME $CHANNEL_NAME $domain_string LOW RATIO 0.0 $nr_notification_expected - start_client $high_app_output_file $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 $nr_notification_expected + start_client $low_app_output_file $SESSION_NAME $CHANNEL_NAME $domain_string LOW RATIO 0.0 $nr_notification_expected $(( $i % 2)) + start_client $high_app_output_file $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 $nr_notification_expected $(( $i % 2)) done wait_for_message $output_dir "${low_output_file_pattern}" "sync: ready" @@ -324,9 +325,9 @@ function test_on_register_evaluation () local app_pids=() local high_output_file_pattern="high_app_output_file_on_register_evaluation" - local output_dir=$(mktemp -d) + local output_dir=$(mktemp -d -t "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") local testpoint_base_path=$(readlink -f "$output_dir/lttng.t_p_n_register_evaluation") - local testpoint_pipe_path=$(mktemp -u "${testpoint_base_path}.XXXXXX") + local testpoint_pipe_path=$(TMPDIR="$output_dir" mktemp -u -t "lttng.t_p_n_register_evaluation.XXXXXX") local domain_string="" local event_name="" @@ -362,7 +363,7 @@ function test_on_register_evaluation () high_app_output_file=${high_output_file_pattern}.first_receiver high_app_output_path=$output_dir/${high_app_output_file} - start_client $high_app_output_path $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 1 + start_client $high_app_output_path $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 1 0 wait_for_message $output_dir "${high_app_output_file}" "sync: ready" @@ -379,7 +380,7 @@ function test_on_register_evaluation () # notification on subscription high_app_output_file=${high_output_file_pattern}.second_receiver high_app_output_path=$output_dir/${high_app_output_file} - start_client $high_app_output_path $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 1 + start_client $high_app_output_path $SESSION_NAME $CHANNEL_NAME $domain_string HIGH RATIO 0.420 1 0 wait_for_message $output_dir "${high_app_output_file}" "sync: ready" wait_for_message $output_dir "${high_app_output_file}" "notification: high 0" @@ -410,26 +411,22 @@ function test_on_register_evaluation () rm -rf "$output_dir" } - TESTS=( test_multi_app_ust test_on_register_evaluation_ust ) -if [ "$(id -u)" == "0" ]; then +check_skip_kernel_test "$NUM_TEST_KERNEL" "Skipping kernel multi-app notification tests." || { validate_lttng_modules_present TESTS+=( - test_multi_app_kernel - test_on_register_evaluation_kernel -) -else - skip 0 "Root access is needed. Skipping all kernel multi-app notification tests." $NUM_TEST_KERNEL -fi - + test_multi_app_kernel + test_on_register_evaluation_kernel + ) +} for fct_test in ${TESTS[@]}; do - TRACE_PATH=$(mktemp -d) + TRACE_PATH=$(mktemp -d -t tmp.test_notification_multi_app_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then