private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors";
protected static final String SCEN_CREATE_LIVE_SESSION = "CreateSessionLive";
private static final String SCEN_CREATE_LIVE_SESSION_ERRORS = "CreateSessionLiveErrors";
+ private static final String SCEN_SESSION_PROFILES = "SessionProfile";
+
// ------------------------------------------------------------------------
}
}
+ @Test
+ public void testSessionProfile() {
+ fShell.setScenario(SCEN_SESSION_PROFILES);
+ final String profile = "/home/user/.lttng/sessions/mysession.lttng";
+ try {
+ fService.loadSession(profile, false, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("load session failed: " + e);
+ }
+
+ try {
+ fService.loadSession(profile, true, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("load session failed: " + e);
+ }
+
+ try {
+ fService.saveSession(null, null, false, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("save session failed: " + e);
+ }
+
+ final String sessionName = "mysession";
+ try {
+ fService.saveSession(sessionName, null, false, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("save session failed: " + e);
+ }
+
+ try {
+ fService.saveSession(sessionName, null, true, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("save session failed: " + e);
+ }
+
+ try {
+ fService.saveSession(sessionName, "/tmp/test", true, new NullProgressMonitor());
+ } catch (ExecutionException e) {
+ fail("save session failed: " + e);
+ }
+ }
+
private static void enableVerbose() {
// verbose
ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), false);
</command>
</COMMAND_OUTPUT>
</SCENARIO>
+####################################################################
+# Scenario: Test "lttng load [OPTIONS] [SESSION]"
+# "lttng save [OPTIONS] [SESSION]"
+# (LTTng 2.5)
+####################################################################
+<SCENARIO>
+SessionProfile
+<COMMAND_INPUT>
+lttng --mi xml load -i /home/user/.lttng/sessions/mysession.lttng
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>load</name><output><load><session><name>*</name></session><path>.lttng/sessions/seqSession2.lttng</path></load></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+<SCENARIO>
+SessionProfile
+<COMMAND_INPUT>
+lttng --mi xml load -i /home/user/.lttng/sessions/mysession.lttng -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>load</name><output><load><session><name>*</name></session><path>.lttng/sessions/seqSession2.lttng</path></load></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng --mi xml save
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>save</name><output><save><session><name>*</name></session></save></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng --mi xml save mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>save</name><output><save><session><name>seqSession2</name></session></save></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng --mi xml save -f mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>save</name><output><save><session><name>seqSession2</name></session></save></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng --mi xml save -o /tmp/test -f mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+<command><name>save</name><output><save><session><name>seqSession2</name></session></save></output><success>true</success></command>
+</COMMAND_OUTPUT>
+
+</SCENARIO>
<COMMAND_OUTPUT>
Snapshot recorded successfully for session mysession
</COMMAND_OUTPUT>
-#------------------------------------------------------------------------------
+#-----------------------------------------------------------------------------
<COMMAND_INPUT>
lttng destroy mysession
</COMMAND_INPUT>
<COMMAND_OUTPUT>
Session mysession destroyed.
</COMMAND_OUTPUT>
+
</SCENARIO>
+
+####################################################################
+# Scenario: Test "lttng load [OPTIONS] [SESSION]"
+# "lttng save [OPTIONS] [SESSION]"
+# (LTTng 2.5)
+####################################################################
+<SCENARIO>
+SessionProfile
+<COMMAND_INPUT>
+lttng load -i /home/user/.lttng/sessions/mysession.lttng
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All sessions have been loaded successfully.
+</COMMAND_OUTPUT>
+
+<SCENARIO>
+SessionProfile
+<COMMAND_INPUT>
+lttng load -i /home/user/.lttng/sessions/mysession.lttng -f
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All sessions have been loaded successfully.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng save
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+All sessions have been saved successfully.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng save mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession saved successfully.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng save -f mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession saved successfully.
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
+lttng save -o /tmp/test -f mysession
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Session mysession saved successfully.
+</COMMAND_OUTPUT>
+
+</SCENARIO>
\ No newline at end of file