Commit | Line | Data |
---|---|---|
51704c8e 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_instrumentation_application_state.XXXXXXXXXX") |
51704c8e FD |
11 | |
12 | NUM_TESTS=13 | |
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_instrumentation_notification | |
20 | { | |
21 | kernel_event_generator generate_filter_events "$TESTAPP_STATE_PATH" & | |
22 | APP_PID=$! | |
23 | ||
24 | "$CURDIR/notification" 4 LTTNG_DOMAIN_KERNEL $APP_PID \ | |
25 | "$TESTAPP_STATE_PATH" | |
26 | ||
27 | kill -SIGUSR2 $APP_PID | |
28 | wait $APP_PID 2> /dev/null | |
29 | } | |
30 | ||
3a174400 XC |
31 | check_skip_kernel_test && |
32 | { | |
33 | plan_skip_all "Skipping all tests." | |
34 | exit 0 | |
35 | } | |
51704c8e | 36 | |
3a174400 | 37 | validate_lttng_modules_present |
51704c8e | 38 | |
3a174400 | 39 | modprobe lttng-test |
51704c8e | 40 | |
3a174400 | 41 | start_lttng_sessiond_notap |
51704c8e | 42 | |
3a174400 | 43 | test_kernel_instrumentation_notification |
51704c8e | 44 | |
3a174400 XC |
45 | stop_lttng_sessiond_notap |
46 | rmmod lttng-test | |
51704c8e | 47 | |
33e55711 | 48 | rm -f "$TESTAPP_STATE_PATH" |