SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / tests / regression / tools / notification / test_notification_kernel_error
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_PATH="$TESTDIR/utils/testapp"
13 TESTAPP_STATE_PATH=$(mktemp -u "$TMPDIR/application_state.XXXXXXXXXX")
14
15 NUM_TESTS=104
16
17 # shellcheck source=../../../utils/utils.sh
18 source "$TESTDIR/utils/utils.sh"
19 # shellcheck source=./util_event_generator.sh
20 source "$CURDIR/util_event_generator.sh"
21
22 function test_basic_error_path
23 {
24 kernel_event_generator_run_once_per_transition generate_filter_events \
25 "$TESTAPP_STATE_PATH" 10 &
26 APP_PID=$!
27
28 "$CURDIR/notification" 1 LTTNG_DOMAIN_KERNEL $APP_PID \
29 "$TESTAPP_STATE_PATH"
30
31 kill -SIGUSR2 $APP_PID
32 wait $APP_PID 2> /dev/null
33 }
34
35
36 if [ "$(id -u)" == "0" ]; then
37 validate_lttng_modules_present
38
39 modprobe lttng-test
40
41 start_lttng_sessiond_notap
42
43 test_basic_error_path
44
45 stop_lttng_sessiond_notap
46 rmmod lttng-test
47
48 else
49 # Kernel tests are skipped.
50 plan_tests $NUM_TESTS
51 skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
52 fi
53
54 # Just in case cleanup
55 rm -rf "$TMPDIR"
This page took 0.049314 seconds and 5 git commands to generate.