Commit | Line | Data |
---|---|---|
aab0598f FD |
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 | ||
8d5a3312 | 10 | TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_syscall_application_state.XXXXXX") |
aab0598f FD |
11 | |
12 | NUM_TESTS=25 | |
13 | ||
14 | # shellcheck source=../../../utils/utils.sh | |
15 | source "$TESTDIR/utils/utils.sh" | |
16 | # shellcheck source=./util_event_generator.sh | |
17 | source "$CURDIR/util_event_generator.sh" | |
18 | ||
19 | function test_kernel_syscall_notification | |
20 | { | |
21 | kernel_event_generator_run_once_per_transition generate_syscalls \ | |
22 | "$TESTAPP_STATE_PATH" 10 /proc/cpuinfo /proc/cmdline & | |
23 | APP_PID=$! | |
24 | ||
25 | # Pass the syscall_generator_file for filtering | |
26 | "$CURDIR/notification" 5 LTTNG_DOMAIN_KERNEL $APP_PID \ | |
27 | "$TESTAPP_STATE_PATH" | |
28 | ||
29 | ||
30 | kill -SIGUSR2 $APP_PID | |
31 | wait $APP_PID 2> /dev/null | |
32 | } | |
33 | ||
3a174400 XC |
34 | check_skip_kernel_test && |
35 | { | |
36 | plan_skip_all "Skipping all tests." | |
37 | exit 0 | |
38 | } | |
aab0598f | 39 | |
3a174400 | 40 | validate_lttng_modules_present |
aab0598f | 41 | |
3a174400 | 42 | start_lttng_sessiond_notap |
aab0598f | 43 | |
3a174400 | 44 | test_kernel_syscall_notification |
aab0598f | 45 | |
3a174400 | 46 | stop_lttng_sessiond_notap |
aab0598f | 47 | |
33e55711 | 48 | rm -f "$TESTAPP_STATE_PATH" |