X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_kernel_userspace_probe;fp=tests%2Fregression%2Ftools%2Fnotification%2Ftest_notification_kernel_userspace_probe;h=6a50869f0ad842263ef4378e508607db5e7acfab;hp=0000000000000000000000000000000000000000;hb=2463b7879c00298daa79744cdaae82ac061a4ed8;hpb=3a4595c2469472dee1656cde5f8882c2123efd3c diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe new file mode 100755 index 000000000..6a50869f0 --- /dev/null +++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Copyright (C) 2017 Jonathan Rajotte-Julien +# +# SPDX-License-Identifier: LGPL-2.1-only + +CURDIR=$(dirname "$0")/ +TESTDIR=$CURDIR/../../../ + +TMPDIR=$(mktemp -d) + +TESTAPP_STATE_PATH=$(mktemp -u "$TMPDIR/application_state.XXXXXXXXXX") + +NUM_TESTS=104 + +# shellcheck source=../../../utils/utils.sh +source "$TESTDIR/utils/utils.sh" +# shellcheck source=./util_event_generator.sh +source "$CURDIR/util_event_generator.sh" + +function test_kernel_userspace_probe_notification +{ + kernel_event_generator_run_once_per_transition userspace_probe_testapp "$TESTAPP_STATE_PATH" 10 & + APP_PID=$! + + "$CURDIR/notification" 6 LTTNG_DOMAIN_KERNEL \ + $APP_PID "$TESTAPP_STATE_PATH" \ + "$USERSPACE_PROBE_ELF_TESTAPP_BIN" "test_function" + + kill -SIGUSR2 $APP_PID + wait $APP_PID 2> /dev/null +} + +if [ "$(id -u)" == "0" ]; then + validate_lttng_modules_present + + start_lttng_sessiond_notap + + test_kernel_userspace_probe_notification + + stop_lttng_sessiond_notap +else + # Kernel tests are skipped. + plan_tests $NUM_TESTS + skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS +fi + +# Just in case cleanup +rm -rf "$TMPDIR"