####################################################################
# Copyright (c) 2012 Ericsson
#
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the Eclipse Public License 2.0 which
# accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
#    Bernd Hufmann - Initial API and implementation
####################################################################
####################################################################
# Scenario: Initialize
####################################################################
<SCENARIO>
Initialize
<COMMAND_INPUT>
lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
lttng version 2.0.0 - Annedd'ale
Web site: http://lttng.org/

lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Currently no available tracing session
</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list -k
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Kernel events
-------------
      sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
      sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
      sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list -k --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
System calls:
-------------
      read [32/64-bit]
      write [32/64-bit]
      open [32/64-bit]

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list -u
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
UST events:
-------------

PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)

PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
    ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
    ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)

</COMMAND_OUTPUT>
</SCENARIO>

####################################################################
# Scenario: Test "lttng create <session> with LTTng 2.1 options
####################################################################
##################################################################
<SCENARIO>
CreateSessionFileProto
<COMMAND_INPUT>
lttng create mysession -U file:///tmp
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession created.
Traces will be written in file:///tmp
</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Tracing session mysession: [inactive]
    Trace path: file:///tmp

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng destroy mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession destroyed.
</COMMAND_OUTPUT>
</SCENARIO>

##################################################################
<SCENARIO>
CreateSessionControlData
<COMMAND_INPUT>
lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession created.
Control URL tcp://172.0.0.1 set for session mysession
Data URL tcp://172.0.0.1:5343 set for session mysession
</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Tracing session mysession: [inactive]
    Trace path: tcp://172.0.0.1:5342 [data: 5343]

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng destroy mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession destroyed.
</COMMAND_OUTPUT>
</SCENARIO>

##################################################################
<SCENARIO>
CreateSessionNetwork
<COMMAND_INPUT>
lttng create mysession -U net://172.0.0.1:1234:2345
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession created.
Traces will be written in net://172.0.0.1:1234:2345
</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Tracing session mysession: [inactive]
    Trace path: net://172.0.0.1:1234 [data: 2345]

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng destroy mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession2 destroyed.
</COMMAND_OUTPUT>

</SCENARIO>

##################################################################
<SCENARIO>
CreateSessionNetwork2
<COMMAND_INPUT>
lttng create mysession -U net6://[ffff::eeee:dddd:cccc:0]
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession created.
Traces will be written in net6://[ffff::eeee:dddd:cccc:0]
</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng list mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Tracing session mysession: [inactive]
    Trace path:  net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]

</COMMAND_OUTPUT>

<COMMAND_INPUT>
lttng destroy mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
</COMMAND_RESULT>
<COMMAND_OUTPUT>
Session mysession2 destroyed.
</COMMAND_OUTPUT>

</SCENARIO>