port: add support for BSD mktemp
[lttng-tools.git] / tests / regression / tools / notification / test_notification_ust_error
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
11 TESTAPP_PATH="$TESTDIR/utils/testapp"
12
13 GEN_UST_EVENTS_TESTAPP_NAME="gen-ust-events"
14 GEN_UST_EVENTS_TESTAPP_BIN="$TESTAPP_PATH/$GEN_UST_EVENTS_TESTAPP_NAME/$GEN_UST_EVENTS_TESTAPP_NAME"
15
16 TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_ust_error_application_state.XXXXXX")
17
18 # shellcheck source=../../../utils/utils.sh
19 source "$TESTDIR/utils/utils.sh"
20 # shellcheck source=./util_event_generator.sh
21 source "$CURDIR/util_event_generator.sh"
22
23 function test_basic_error_path
24 {
25 ust_event_generator_run_once_per_transition "$GEN_UST_EVENTS_TESTAPP_BIN" "$TESTAPP_STATE_PATH" 5 5 &
26 APP_PID=$!
27
28 "$CURDIR/notification" 1 LTTNG_DOMAIN_UST $APP_PID "$TESTAPP_STATE_PATH"
29
30 kill -SIGUSR2 $APP_PID
31 wait $APP_PID 2> /dev/null
32 }
33
34 start_lttng_sessiond_notap
35
36 test_basic_error_path
37
38 stop_lttng_sessiond_notap
39
40 rm -f $TESTAPP_STATE_PATH
This page took 0.031605 seconds and 5 git commands to generate.