Fix all -Wdiscarded-qualifiers warning instances
[lttng-tools.git] / tests / regression / tools / live / test_lttng_ust
CommitLineData
1b368955
JD
1#!/bin/bash
2#
9d16b343
MJ
3# Copyright (C) 2013 Julien Desfossez <julien.desfossez@efficios.com>
4# Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
1b368955 5#
9d16b343 6# SPDX-License-Identifier: LGPL-2.1-only
1b368955
JD
7
8TEST_DESC="Live - User space tracing"
9
10CURDIR=$(dirname $0)/
11TESTDIR=$CURDIR/../../../
1b368955
JD
12NR_ITER=1
13NR_USEC_WAIT=1
14DELAY_USEC=2000000
15TESTAPP_PATH="$TESTDIR/utils/testapp"
16TESTAPP_NAME="gen-ust-events"
17TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
18
19SESSION_NAME="live"
20EVENT_NAME="tp:tptest"
21
22TRACE_PATH=$(mktemp -d)
23
24DIR=$(readlink -f $TESTDIR)
25
a9c920d9 26NUM_TESTS=11
1b368955
JD
27
28source $TESTDIR/utils/utils.sh
29
30# MUST set TESTDIR before calling those functions
31plan_tests $NUM_TESTS
32
33print_test_banner "$TEST_DESC"
34
1a241656
DG
35function test_custom_url()
36{
37 # Create session with custom URL
38 $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME --live $DELAY_USEC \
39 -C tcp://localhost:1819 -D tcp://localhost:9187 >/dev/null 2>&1
40 ok $? "Create session in live mode with delay $DELAY_USEC and custom URLs"
41}
42
1b368955
JD
43function setup_live_tracing()
44{
45 # Create session with default path
46 $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME --live $DELAY_USEC \
47 -U net://localhost >/dev/null 2>&1
48 ok $? "Create session in live mode with delay $DELAY_USEC"
49
c4926bb5 50 enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
e563bbdb 51 start_lttng_tracing_ok $SESSION_NAME
1b368955
JD
52}
53
54function clean_live_tracing()
55{
96340a01 56 stop_lttng_tracing_ok $SESSION_NAME
67b4c664 57 destroy_lttng_session_ok $SESSION_NAME
1b368955
JD
58}
59
60start_lttng_sessiond
61start_lttng_relayd "-o $TRACE_PATH"
62
63setup_live_tracing
64
65# Run app in background
6c4a91d6 66$TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT >/dev/null 2>&1
1b368955
JD
67
68clean_live_tracing
69
d53addeb 70trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
1b368955 71rm -rf $TRACE_PATH
1b368955 72stop_lttng_relayd
1a241656
DG
73
74test_custom_url
1a241656 75
1b368955 76stop_lttng_sessiond
This page took 0.040475 seconds and 4 git commands to generate.