SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / tests / regression / tools / notification / test_notification_kernel_syscall
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_syscall_notification
22 {
23 kernel_event_generator_run_once_per_transition generate_syscalls \
24 "$TESTAPP_STATE_PATH" 10 /proc/cpuinfo /proc/cmdline &
25 APP_PID=$!
26
27 # Pass the syscall_generator_file for filtering
28 "$CURDIR/notification" 5 LTTNG_DOMAIN_KERNEL $APP_PID \
29 "$TESTAPP_STATE_PATH"
30
31
32 kill -SIGUSR2 $APP_PID
33 wait $APP_PID 2> /dev/null
34 }
35
36 if [ "$(id -u)" == "0" ]; then
37 validate_lttng_modules_present
38
39 start_lttng_sessiond_notap
40
41 test_kernel_syscall_notification
42
43 stop_lttng_sessiond_notap
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 # Just in case cleanup
52 rm -rf "$TMPDIR"
This page took 0.044641 seconds and 5 git commands to generate.