3 # Copyright (C) - 2014 David Goulet <dgoulet@efficios.com>
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.
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
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
18 TEST_DESC
="Load session(s)"
21 TESTDIR
=$CURDIR/..
/..
/..
/
22 SESSIOND_BIN
="lttng-sessiond"
23 RELAYD_BIN
="lttng-relayd"
25 export LTTNG_SESSION_CONFIG_XSD_PATH
=${TESTDIR}..
/src
/common
/config
/
27 SESSION_NAME
="load-42"
28 EVENT_NAME
="tp:tptest"
30 DIR
=$
(readlink
-f $TESTDIR)
34 source $TESTDIR/utils
/utils.sh
36 # MUST set TESTDIR before calling those functions
39 print_test_banner
"$TEST_DESC"
41 function disable_event
()
47 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -c $chan_name -u >/dev
/null
2>&1
48 ok $?
"Disable event $event_name for session $sess_name"
51 function test_basic_load
()
53 diag
"Test basic load"
55 lttng_load
"-i $CURDIR/$SESSION_NAME.lttng"
57 destroy_lttng_session
$SESSION_NAME
60 function test_complex_load
()
62 local sess
="$SESSION_NAME-complex"
63 diag
"Test complex load"
65 # Start relayd with localhost binding. The complex session uses those
67 start_lttng_relayd
"-C tcp://localhost:8172 -D tcp://localhost:9817"
69 lttng_load
"-i $CURDIR/$sess.lttng"
71 # Once loaded, we are suppose to be able to disable certain events/channels
72 # thus having a confirmation that it's valid
73 disable_event
$sess chan1 uevent1
74 disable_event
$sess chan2 uevent2
75 disable_event
$sess chan3 uevent3
*
77 disable_ust_lttng_channel
$sess chan1
78 disable_ust_lttng_channel
$sess chan2
79 disable_ust_lttng_channel
$sess chan3
81 destroy_lttng_session
$sess
83 stop_lttng_relayd_nocheck
86 function test_all_load
()
88 diag
"Test load all sessions"
90 # Start relayd with localhost binding. The complex session uses those
92 start_lttng_relayd
"-C tcp://localhost:8172 -D tcp://localhost:9817"
94 lttng_load
"-a -i $CURDIR"
96 destroy_lttng_session
$SESSION_NAME
97 destroy_lttng_session
"$SESSION_NAME-complex"
99 stop_lttng_relayd_nocheck
102 function test_overwrite
()
104 diag
"Test load overwrite"
106 lttng_load
"-i $CURDIR/$SESSION_NAME.lttng"
108 # This one should succeed
109 lttng_load
"-f -i $CURDIR $SESSION_NAME"
111 destroy_lttng_session
$SESSION_NAME
123 for fct_test
in ${TESTS[@]};
125 TRACE_PATH
=$
(mktemp
-d)
128 if [ $?
-ne 0 ]; then
131 # Only delete if successful