Fix: force _lttng python binding to be linked with g++
[lttng-tools.git] / tests / regression / tools / notification / test_notification_kernel_error
CommitLineData
069fc1c5
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
7CURDIR=$(dirname "$0")/
8TESTDIR=$CURDIR/../../../
9
069fc1c5 10TESTAPP_PATH="$TESTDIR/utils/testapp"
8d5a3312 11TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_error_application_state.XXXXXXXXXX")
069fc1c5
FD
12
13NUM_TESTS=44
14
15# shellcheck source=../../../utils/utils.sh
16source "$TESTDIR/utils/utils.sh"
7948461b
FD
17# shellcheck source=./util_event_generator.sh
18source "$CURDIR/util_event_generator.sh"
069fc1c5
FD
19
20function test_basic_error_path
21{
7948461b
FD
22 kernel_event_generator_run_once_per_transition generate_filter_events \
23 "$TESTAPP_STATE_PATH" 10 &
24 APP_PID=$!
25
26 "$CURDIR/notification" 1 LTTNG_DOMAIN_KERNEL $APP_PID \
27 "$TESTAPP_STATE_PATH"
28
29 kill -SIGUSR2 $APP_PID
30 wait $APP_PID 2> /dev/null
069fc1c5
FD
31}
32
33
34if [ "$(id -u)" == "0" ]; then
35 validate_lttng_modules_present
36
37 modprobe lttng-test
38
39 start_lttng_sessiond_notap
40
41 test_basic_error_path
42
43 stop_lttng_sessiond_notap
44 rmmod lttng-test
45
46else
47 # Kernel tests are skipped.
48 plan_tests $NUM_TESTS
49 skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS
50fi
51
33e55711 52rm -f "$TESTAPP_STATE_PATH"
This page took 0.045312 seconds and 4 git commands to generate.