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"
26 SESSION_NAME
="load-42"
27 EVENT_NAME
="tp:tptest"
29 DIR
=$
(readlink
-f $TESTDIR)
33 source $TESTDIR/utils
/utils.sh
35 # MUST set TESTDIR before calling those functions
38 print_test_banner
"$TEST_DESC"
40 function disable_event
()
46 $TESTDIR/..
/src
/bin
/lttng
/$LTTNG_BIN disable-event
"$event_name" -s $sess_name -c $chan_name -u >/dev
/null
2>&1
47 ok $?
"Disable event $event_name for session $sess_name"
50 function test_basic_load
()
52 diag
"Test basic load"
54 lttng_load
"-i $CURDIR/$SESSION_NAME.lttng"
56 destroy_lttng_session
$SESSION_NAME
59 function test_complex_load
()
61 local sess
="$SESSION_NAME-complex"
62 diag
"Test complex load"
64 # Start relayd with localhost binding. The complex session uses those
66 start_lttng_relayd
"-C tcp://localhost:8172 -D tcp://localhost:9817"
68 lttng_load
"-i $CURDIR/$sess.lttng"
70 # Once loaded, we are suppose to be able to disable certain events/channels
71 # thus having a confirmation that it's valid
72 disable_event
$sess chan1 uevent1
73 disable_event
$sess chan2 uevent2
74 disable_event
$sess chan3 uevent3
*
76 disable_ust_lttng_channel
$sess chan1
77 disable_ust_lttng_channel
$sess chan2
78 disable_ust_lttng_channel
$sess chan3
80 destroy_lttng_session
$sess
82 stop_lttng_relayd_nocheck
85 function test_all_load
()
87 diag
"Test load all sessions"
89 # Start relayd with localhost binding. The complex session uses those
91 start_lttng_relayd
"-C tcp://localhost:8172 -D tcp://localhost:9817"
93 lttng_load
"-a -i $CURDIR"
95 destroy_lttng_session
$SESSION_NAME
96 destroy_lttng_session
"$SESSION_NAME-complex"
98 stop_lttng_relayd_nocheck
101 function test_overwrite
()
103 diag
"Test load overwrite"
105 lttng_load
"-i $CURDIR/$SESSION_NAME.lttng"
107 # This one should succeed
108 lttng_load
"-f -i $CURDIR $SESSION_NAME"
110 destroy_lttng_session
$SESSION_NAME
122 for fct_test
in ${TESTS[@]};
124 TRACE_PATH
=$
(mktemp
-d)
127 if [ $?
-ne 0 ]; then
130 # Only delete if successful