X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_kernel_buffer_usage;h=17b8d765d3043b43b71bf805b5c58c8113028ad1;hb=38eb8a68a2817b040e31c577a9e3a81b52897816;hp=904212f396c0d7ef318a57c241ab468c084b886f;hpb=069fc1c5abf8a9ce01feab82906faf6d02b95c97;p=lttng-tools.git diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage index 904212f39..17b8d765d 100755 --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage @@ -19,40 +19,12 @@ TESTAPP_STATE_PATH=$(mktemp -u "$TMPDIR/application_state.XXXXXXXXXX") SESSION_NAME="my_session" CHANNEL_NAME="my_channel" -NUM_TESTS=104 +NUM_TESTS=99 # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" - -function kernel_event_generator_toggle_state -{ - kernel_event_generator_suspended=$((kernel_event_generator_suspended==0)) -} - -function generate_filter_events -{ - /bin/echo -n "10" > /proc/lttng-test-filter-event 2> /dev/null -} - -function kernel_event_generator -{ - command_to_run=$1 - state_file=$2 - kernel_event_generator_suspended=0 - trap kernel_event_generator_toggle_state SIGUSR1 - - while (true); do - if [[ $kernel_event_generator_suspended -eq "1" ]]; then - touch $state_file - sleep 0.5 - else - if [[ -f $state_file ]]; then - rm $state_file 2> /dev/null - fi - $command_to_run - fi - done -} +# shellcheck source=./util_event_generator.sh +source "$CURDIR/util_event_generator.sh" function test_buffer_usage_notification { @@ -79,12 +51,12 @@ function test_buffer_usage_notification consumerd_pipe+=("$f") done - "$CURDIR/notification" 2 LTTNG_DOMAIN_KERNEL $SESSION_NAME $CHANNEL_NAME \ - $APP_PID $TESTAPP_STATE_PATH ${consumerd_pipe[@]} + "$CURDIR/notification" 2 LTTNG_DOMAIN_KERNEL $APP_PID "$TESTAPP_STATE_PATH" \ + $SESSION_NAME $CHANNEL_NAME "${consumerd_pipe[@]}" destroy_lttng_session_notap $SESSION_NAME - kill -9 $APP_PID + kill -SIGUSR2 $APP_PID wait $APP_PID 2> /dev/null }