SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / tests / regression / tools / notification / test_notification_kernel_instrumentation
1 #!/bin/bash
2 #
3 # Copyright (C) 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 #
5 # SPDX-License-Identifier: LGPL-2.1-only
6
7 CURDIR=$(dirname "$0")/
8 TESTDIR=$CURDIR/../../../
9
10 TMPDIR=$(mktemp -d)
11
12 TESTAPP_STATE_PATH=$(mktemp -u "$TMPDIR/application_state.XXXXXXXXXX")
13
14 NUM_TESTS=104
15
16 # shellcheck source=../../../utils/utils.sh
17 source "$TESTDIR/utils/utils.sh"
18 # shellcheck source=./util_event_generator.sh
19 source "$CURDIR/util_event_generator.sh"
20
21 function test_kernel_instrumentation_notification
22 {
23 kernel_event_generator generate_filter_events "$TESTAPP_STATE_PATH" &
24 APP_PID=$!
25
26 "$CURDIR/notification" 4 LTTNG_DOMAIN_KERNEL $APP_PID \
27 "$TESTAPP_STATE_PATH"
28
29 kill -SIGUSR2 $APP_PID
30 wait $APP_PID 2> /dev/null
31 }
32
33 if [ "$(id -u)" == "0" ]; then
34 validate_lttng_modules_present
35
36 modprobe lttng-test
37
38 start_lttng_sessiond_notap
39
40 test_kernel_instrumentation_notification
41
42 stop_lttng_sessiond_notap
43 rmmod lttng-test
44
45 else
46 # Kernel tests are skipped.
47 plan_tests $NUM_TESTS
48 skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
49 fi
50
51 rm -rf "$TMPDIR"
This page took 0.044062 seconds and 5 git commands to generate.