Gen-ust-events: use options instead of arguments
[lttng-tools.git] / tests / regression / tools / notification / test_rotation
CommitLineData
88a5c0a9
JG
1#!/bin/bash
2#
3# Copyright (C) - 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4#
5# This library is free software; you can redistribute it and/or modify it under
6# the terms of the GNU Lesser General Public License as published by the Free
7# Software Foundation; version 2.1 of the License.
8#
9# This library is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12# details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this library; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18CURDIR=$(dirname $0)/
19TESTDIR=$CURDIR/../../../
20
21TESTAPP_PATH="$TESTDIR/utils/testapp"
22TESTAPP_NAME="gen-ust-events"
23TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
24
25SESSION_NAME="my_session"
26TMP_DIR=$(mktemp -d)
27SESSION_OUTPUT_PATH=$TMP_DIR/output
28EVENT_NAME="tp:tptest"
29
30PAGE_SIZE=$(getconf PAGE_SIZE)
31SUBBUF_SIZE=$(expr $PAGE_SIZE \* 8)
32
33FILE_SYNC_AFTER_FIRST_EVENT=$(mktemp -u)
34
35NR_ITER=-1
36NR_USEC_WAIT=5
37
38DIR=$(readlink -f $TESTDIR)
39
40source $TESTDIR/utils/utils.sh
41start_lttng_sessiond_notap
42
43create_lttng_session_notap $SESSION_NAME $SESSION_OUTPUT_PATH
44
45enable_ust_lttng_channel_notap $SESSION_NAME $CHANNEL_NAME --subbuf-size=$SUBBUF_SIZE
46enable_ust_lttng_event_notap $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
47
48start_lttng_tracing_notap $SESSION_NAME
49
a4c30524 50$TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $FILE_SYNC_AFTER_FIRST_EVENT &
88a5c0a9
JG
51APP_PID=$!
52while [ ! -f "${FILE_SYNC_AFTER_FIRST_EVENT}" ]; do
53 sleep 0.5
54done
55
56# The rotation application handles the actual testing once the tracing session
57# has been setup.
58$CURDIR/rotation $SESSION_NAME $SESSION_OUTPUT_PATH
59if [ $? -ne 0 ]; then
60 diag "Failed to run rotation notification client"
61fi
62
63stop_lttng_tracing_notap $SESSION_NAME
64
65stop_lttng_sessiond_notap
66
67# On ungraceful kill the app is cleaned up via the full_cleanup call
68# Suppress kill message
69kill -9 $APP_PID
70wait $APP_PID 2> /dev/null
71
72rm -rf $TMP_DIR
73rm $FILE_SYNC_AFTER_FIRST_EVENT 2> /dev/null
This page took 0.02938 seconds and 5 git commands to generate.