lttng add-trigger: rename on-event condition to event-rule-matches
[lttng-tools.git] / tests / regression / tools / notification / test_rotation
CommitLineData
88a5c0a9
JG
1#!/bin/bash
2#
9d16b343 3# Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
88a5c0a9 4#
9d16b343 5# SPDX-License-Identifier: LGPL-2.1-only
88a5c0a9
JG
6
7CURDIR=$(dirname $0)/
8TESTDIR=$CURDIR/../../../
9
10TESTAPP_PATH="$TESTDIR/utils/testapp"
11TESTAPP_NAME="gen-ust-events"
12TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
13
14SESSION_NAME="my_session"
15TMP_DIR=$(mktemp -d)
16SESSION_OUTPUT_PATH=$TMP_DIR/output
17EVENT_NAME="tp:tptest"
18
19PAGE_SIZE=$(getconf PAGE_SIZE)
20SUBBUF_SIZE=$(expr $PAGE_SIZE \* 8)
21
22FILE_SYNC_AFTER_FIRST_EVENT=$(mktemp -u)
23
24NR_ITER=-1
25NR_USEC_WAIT=5
26
27DIR=$(readlink -f $TESTDIR)
28
29source $TESTDIR/utils/utils.sh
30start_lttng_sessiond_notap
31
32create_lttng_session_notap $SESSION_NAME $SESSION_OUTPUT_PATH
33
34enable_ust_lttng_channel_notap $SESSION_NAME $CHANNEL_NAME --subbuf-size=$SUBBUF_SIZE
35enable_ust_lttng_event_notap $SESSION_NAME $EVENT_NAME $CHANNEL_NAME
36
37start_lttng_tracing_notap $SESSION_NAME
38
6c4a91d6 39$TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $FILE_SYNC_AFTER_FIRST_EVENT &
88a5c0a9
JG
40APP_PID=$!
41while [ ! -f "${FILE_SYNC_AFTER_FIRST_EVENT}" ]; do
42 sleep 0.5
43done
44
45# The rotation application handles the actual testing once the tracing session
46# has been setup.
47$CURDIR/rotation $SESSION_NAME $SESSION_OUTPUT_PATH
48if [ $? -ne 0 ]; then
49 diag "Failed to run rotation notification client"
50fi
51
52stop_lttng_tracing_notap $SESSION_NAME
53
54stop_lttng_sessiond_notap
55
56# On ungraceful kill the app is cleaned up via the full_cleanup call
57# Suppress kill message
58kill -9 $APP_PID
59wait $APP_PID 2> /dev/null
60
61rm -rf $TMP_DIR
62rm $FILE_SYNC_AFTER_FIRST_EVENT 2> /dev/null
This page took 0.045093 seconds and 5 git commands to generate.