File: test_notification_kernel_userspace_probe

package info (click to toggle)
ltt-control 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,860 kB
  • sloc: cpp: 192,012; sh: 28,777; ansic: 10,960; python: 7,108; makefile: 3,520; java: 109; xml: 46
file content (52 lines) | stat: -rwxr-xr-x 1,194 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
#
# SPDX-License-Identifier: LGPL-2.1-only

CURDIR=$(dirname "$0")/
TESTDIR=$CURDIR/../../../

TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_uprobe_application_state.XXXXXXXXXX")

NUM_TESTS=13

# shellcheck source=../../../utils/utils.sh
source "$TESTDIR/utils/utils.sh"
# shellcheck source=./util_event_generator.sh
source "$CURDIR/util_event_generator.sh"

function test_kernel_userspace_probe_notification
{
	kernel_event_generator_run_once_per_transition userspace_probe_testapp "$TESTAPP_STATE_PATH" 10 &
	APP_PID=$!

	"$CURDIR/notification" 6 LTTNG_DOMAIN_KERNEL \
		$APP_PID "$TESTAPP_STATE_PATH" \
		"$USERSPACE_PROBE_ELF_TESTAPP_BIN" "test_function"

	kill -SIGUSR2 $APP_PID
	wait $APP_PID 2> /dev/null
}

check_skip_kernel_test &&
{
	plan_skip_all "Skipping all tests."
	exit 0
}

if file /bin/bash | grep -q 'ELF 32-bit' && uname -n | grep -q arm ; then
	plan_skip_all "Unsupported"
	exit 0
fi

validate_lttng_modules_present
tap_disable

start_lttng_sessiond_notap

test_kernel_userspace_probe_notification

stop_lttng_sessiond_notap

rm -f "$TESTAPP_STATE_PATH"