IBM
Contents Index Previous Next



TTCN Exerciser Commands


The TTCN Exerciser operates through a command line interface (which can be encapsulated by for instance the SDL and TTCN Integrated Simulator user interface).

Example 223 : General syntax of the command input

CommandInput::= {CommandLine} EOF
CommandLine::= Comment|Command
Comment::= <Non Alpha Character> <Free Text>
Command::= <Recognized command or '+'> <Parameters> <NewLine>


It is permitted to have any amount of spaces or tabs before the command start. In general, the assembler code modes of some editors works quite well for composing command files.

Example 224 : A command file

;;;
;;; File Name: example
;;; This is an example command file, uses ; for command delim.
;;;


;; Initialisation (see command descriptions below)
cl	 	 	 ; Set command line log mode
loglevel 2	 	 ; Set log level to 2
nomsc	 	 	 ; Disable MSC generation
nopoll	 	 	 ; Disable command polling
discrete	 	 ; Use discrete time sim

;; Now run a test case
step TestCase1	 	 ; Will create context
receive Lower ConnectInd { Address 3 }
run	 	 	 ; Will actually run till idle
timeout	 	 	 ; Do a timeout when idle

;;; End of this file...


These are the available commands when a tester built with the TTCN Exerciser is run from the command line or with a batch script. The commands may be abbreviated, as long as the abbreviation yields one unique command name. For instance, the command cancel may be abbreviated with ca but not with c, since that would also match the cmdlog command.

The command listing below has the following information:

General Commands

Help

<command-name>

The unique name of the command.

<states>

The set of states where the command is applicable:

  • S - Stopped, no test case is running.
  • R - Running, as test case is in progress.
<debug>

Denotes if the tester needs to be generated with the line information for the command to be running correctly:

  • D - Requires line-number information.
  • * - Available with or without line-number information.
<description>

A brief summary of the command functionality.


The help command will automatically transition the tester to a Paused state if it is in running state.

Example 225


-	 Command?
help


Quit

Example 226

-	 Command?
quit


Include

Example 227

-	 Command?
include setup.ics
-	 Command?
+setup.ics


Test Management Commands

List

Example 228


	 Command?
list
MyTest1
MyTest2
MyTest3[N/S]


Glist

Example 229


-	 Command?
glist
MyGroup1
MyGroup2


Run

Example 230


-	 Command?
run MyTest1
-
-	 Line: MyTest1 1
-	 Line: MyTest1 2
-	 Line: MyTest1 3
-	 Line: MyTest1 4
-	 At breakpoint MyTest1 5
-	 Line: MyTest1 5
-	 Command?
run


Step

Example 231


-	 Command?
step MyTest1
-
-	 Line: MyTest1 1
-	 Command?
step
-	 Line: MyTest1 2
-	 Command?
step
-	 Line: MyTest1 3
-	 Command?


Stop

Example 232


-	 Command?
run MyTest1
-	 Line:	 MyTest1 1
-	 Line:	 MyTest1 2
stop
-	 Command?
step
-	 Line:	 MyTest1 3
-	 Command?


Cancel

Example 233


- run test1


Loglevel

0

Only verdicts

1

Level 0 + PTCs, PCOs and TIMERS (default level)

2

Level 1 + matched lines and test trees

3

Level 2 + non-matched lines and defaults

If no level is supplied, the default level will be used.

Example 234


-	 Command?
loglevel 3
-	 Set conformance log level = 3
-	 Command?


Savestats

Example 235

-	 Command?
savestats testresults.txt
-	 Command?
# Just list the contents of the file
system cat testresults.txt
Test	 	 	 	 Verdict
MyTest1	 	 	 	 PASS
MyTest2	 	 	 	 FAIL
MyTest1	 	 	 	 INCONCLUSIVE


Liststats

Example 236

-	 Command?
liststats
- Listing test statistics:
- MyTest1	 	 	 	 PASS
- MyTest2	 	 	 	 FAIL
- MyTest1	 	 	 	 INCONCLUSIVE
-	 Command?


Clearstats

Example 237

-	 Command?
clearstats
-	 Clearing test statistics.
-	 Command?


Test Debugging Commands

Most of these test debugging commands require the tester to be built with line debugging information for correct operation.

Breakpoints

Example 238


-	 Command?
breakpoints
MyTest1	 	 	 5
-	 Command?


Breakpoint

Example 239


-	 Command?
breakpoints
-	 Command?
step MyTest1
-	 Line: MyTest1 1
-	 Command?
breakpoint
-	 Breakpoint set at MyTest1 1
-	 Command?
breakpoint 4
-	 Breakpoint set at MyTest1 4
-	 Command?
breakpoint MyTest2 2
-	 Breakpoint set at MyTest2 2
breakpoints
-	 MyTest1 1
-	 MyTest1 4
-	 MyTest2 2
-	 Command?


Delete

Example 240


-	 Command?
breakpoint MyTest1 3
-	 Breakpoint set at MyTest1 3
-	 Command?
breakpoint MyTest1 5
-	 Breakpoint set at MyTest1 5
run
-	 Line:	 MyTest1 1
-	 Line:	 MyTest1 2
-	 Breakpoint reached: MyTest1 3
-	 Line:	 MyTest1 3
-	 Command?
delete
-	 Breakpoint deleted: MyTest1 3
-	 Command?
delete MyTest1 5
-	 Breakpoint deleted: MyTest1 5
-	 Command?
breakpoints
-	 Command?


Disable

Example 241


-	 Command?
disable
-	 Breakpoints disabled
-	 Command?


Enable

Example 242


-	 Command?
disable
-	 Breakpoints disabled
-	 Command?
enable
-	 Breakpoints enabled
-	 Command?


Timers

PTC

The PTC to which the timer belongs

Timer Name

The TTCN name of the timer

Id

The GCI timer identifier

Remaining (s)

The remaining time to timeout in seconds

Example 243


-	 Command?
timers
-	 PTC	 Timer Name	 	 Id	 Remaining (s)
-	 MTC	 Tms	 	 	 210	    0.400000000
-	 MTC	 TWatchDog	 	 211	   59.600000000
-	 PTC1	 Tms	 	 	 214	    0.400000000
-
-	 Command?


Pcos

Example 244


-	 Command?
step MyTest1
-	 Line: MyTest1 1
-	 Command?
receive LowerPCO ConnectReq { 6 "Peer1" }
-	 Command?
receive LowerPCO ConnectReq { 7 "Peer2" }	 
-	 Command?
pcos
-	 PCO UpperPCO
-	      <empty input queue>
-	 PCO LowerPCO
-	      1:  ConnectReq { 6 "Peer1" } 
-	      2:  ConnectReq { 7 "Peer2" }
-
-	 Command?


Ptcs

Name

The name of the test component

Id

The GCI id of the test component

Thr

The host operating system thread id of the component

Table

The table name of the last matched TTCN line

Line

The last matched line number

Also, the currently active test component will be indicated with an arrow (->) in the output of this command.

Example 245


-	 Command?
ptcs
-	 Name	 	 Id	 Thr	 	 Table Line
-	 MTC	 	 124	 0	       MyTest1 5
-    ->	 PTC1	 	 125	 13	       MyStep1 3
-
-	 Command?


Gett

Example 246


-	 Command?
gett MTC TsvFoo
-	 TsvFoo: 4711
-	 Command?
gett PTC1 TsvFoo
-	 TsvFoo: 1234
-	 Command?


Test Simulation Commands

Discrete

Example 247


*	 Line:	 Table1 3
*	 Line:	 Table1 4
*	 Line:	 Table1 5
discrete
*	 Discrete time simulation is now used.
-	 Command?


Realtime

Example 248


-	 Line:	 Table1 1
-	 Command?
step
-	 Line:	 Table1 2
realtime
-	 Realtime simulation is now used
*	 Line:	 Table1 3
*	 MTC	 	 SEND	 ASP1
*	 MTC	 	 START	 Tms(200)
*	 Line:	 Table1 4
*	 MTC	 	 TIMEOUT Tms
*	 Line:	 Table1 5
*	 FINAL VERDICT: PASS
*	 Command?


Timeout

Example 249


-	 Command?
realtime
*	 Command?
run Test1
*	 Line:	 Test1 1
*	 MTC	 	 START TWatchDog(60)
timeout
-	 Discrete time simulation is now used
-	 Command?
run
-	 Line:	 Default1 1
-	 MTC	 	 TIMEOUT TWatchDog
-	 FINAL VERDICT:  FAIL
-	 Command?


Receive

Example 250


-	 Command?
pcos
-	 PCO UpperPCO
-	     <empty input queue>
-	 PCO LowerPCO
-	     <empty input queue>
-
-	 Command?
receive UpperPCO AcceptCall { 1, TRUE, { 34, 13, 99, '5'B } }
-	 Command?
pcos
-	 PCO UpperPCO
-	     1:  AcceptCall { 1, TRUE, { 34, 13, 99, '5'B } }
-	 PCO LowerPCO
-	     <empty input queue>
-	 Command?


MSC Generation Commands

Nomsc

Example 251


-	 Command?
nomsc
-	 MSC generation disabled
-	 Command?


Decomposed

Example 252


-	 Command?
decomposed
-	 Decomposed MSC generation enabled
-	 Command?


Composed

Example 253


-	 Command?
composed
-	 Composed MSC generation enabled
-	 Command?


Mscsystem

Example 254


-	 Command?
mscsystem env_0
-	 IUT Name for composed MSC generation defined.
-	 Command?

Mscprefix

Example 255


-	 Command?
mscprefix /tmp/traces/trace_
-	 Path/file prefix defined for MSC generation.
-	 Command?
#	 
#	 All test traces will be saved in the named directory
#


Test Validation Commands

Clearreports

Example 256


-	 Command?
clearreports
-	 Reports cleared.
-	 Command?


Listreports

Example 257


-	 Command?
listreports
-	 Listing reports:
-	 Report  1:	 	 TestCase1 7: Missing ?DONE in MTC
-	 Report  2:	 	 TestCase2 3: Incomplete test case
-	 Command?


Savereports

Example 258


-	 Command?
listreports
-	 Listing reports:
-	 report  1:	 	 TestCase1 7: Missing ?DONE in MTC
-	 report  2:	 	 TestCase2 3: Incomplete test case
-	 Command?


Messagefile

Example 259


-	 Command?
messagefile file1.msg
-	 Adding message definitions:
-	 PCO1 ASP1 { 1 2 FALSE '1234'O }
-	 PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 Command?


Messageadd

Example 260


-	 Command?
messagelist
-	 Listing message definitions
-	 1  : PCO1 ASP1 { 1 2 FALSE '1234'O }
-	 2  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 Command?
messageadd PCO1 ASP2 ( FALSE TRUE )
-	 Command?
messagelist
-	 Listing message definitions
-	 1  : PCO1 ASP1 { 1 2 FALSE '1234'O }
-	 2  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 3  : PCO1 ASP2 ( FALSE TRUE )
-	 Command?


Messagelist

Example 261


messagelist
-	 Listing message definitions
-	 1  : PCO1 ASP1 { 1 2 FALSE '1234'O }
-	 2  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 3  : PCO1 ASP2 ( FALSE TRUE )
-	 Command?


Messageclear

Example 262

-	 Command?
messagelist
-	 Listing message definitions
-	 1  : PCO1 ASP1 { 1 2 FALSE '1234'O }
-	 2  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 3  : PCO1 ASP2 ( FALSE TRUE )
-	 Command?
messageclear 1
-	 Cleared message definition.
-	 Command?	 
messagelist
-	 Listing message definitions
-	 1  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 2  : PCO1 ASP2 ( FALSE TRUE )
-	 Command?
messageclear
-	 Clearing all message definitions
-	 Command?
messagelist
messagelist
-	 Listing message definitions
-	 Command?	 


Messageinput

Example 263


-	 Command?	 
messagelist
-	 Listing message definitions
-	 1  : PCO2 ASP3 { 4 2 TRUE '3123'H }
-	 2  : PCO1 ASP2 ( FALSE TRUE )
-	 Command?
messageinput 2
-	 Command?
step
-	 MTC	 RECEIVE	 	 PCO1 ? ASP2
-	 MTC	 STARTTIMER	 Timer1


Randomwalk

Example 264


-	 Command?

# This is a command for running the test case MyTestCase 100
# times while providing random inputs from the message list
# and also timeouts.

randomwalk 100 MyTestCase

-	 Starting random walk...

[some logging of verdicts and selected path]

-	 Random walk completed
-	 Command?
listreports
-	 Listing reports:
-	 report  1: 	 MyTestCase 4: READTIMER: Timer not running
-	 Command?


Maxdepth

Example 265


-	 Command?
maxdepth 10
-	 Defined max depth for random walk
-	 Command?


Kernel Management Commands

Cl

Example 266


<VERDICT>
-	 FINAL VERDICT:	 PASS
</VERDICT>
<MESSAGE UI::READY>
-	 Command?
</MESSAGE UI::READY>
cl
-	 Output tagging disabled
-	 Command?
list
-	 TestCase1
-	 TestCase2
-	 Command?


Ui

Example 267


cl
-	 Output tagging disabled
-	 Command?
list
-	 TestCase1
-	 TestCase2
-	 Command?
ui
<LOG>
-	 Using simulator ui output tagging
</LOG>
<MESSAGE UI::READY>
-	 Command?
</MESSAGE UI::READY>


Poll

Example 268


-	 Command?
poll
-	 Command?


Nopoll

Example 269


-	 Command?
nopoll
-	 Command?


Cmdlog

Example 270


-	 Command?
cmdlog	 asp1
-	 Command?
receive pco1 asp1 { '10'B FALSE '11'B }
-	 Command?
run
-	 Command?
cmdlog
-	 Command?
+asp1
-	 Command?
+asp1
-	 Command?
pcos
-	 PCO pco1
-	     1: asp1 { '10'B FALSE '11'B }
-	     2: asp1 { '10'B FALSE '11'B }
-	     3: asp1 { '10'B FALSE '11'B }


Status

Example 271


-	 Command?
status
-       Tester status: STOPPED
-       Time Mode:     Discrete Time Simulation
-       Logging level: 2
-       Breakpoints:   Disabled
-       Command Log:   Disabled
-       Logging Mode:  Command Line	 
-	 
-	 Command?


System

Example 272


-	 Command?
system mkdir ./msctraces
-	 Command?
mscprefix ./msctraces/trace_
-	 Command?
composed
-	 Command?
run tc1 tc2 tc3 tc4

	 [snip]

-	 Command?
system ls ./msctraces
trace_tc1.mpr	 trace_tc2.mpr	 trace_tc3.mpr	 trace_tc4.mpr
-	 Command?


Log

Example 273


-	 Command?
log mylog.txt
-	 Command?
receive pco1 asp1 { '10'B FALSE '11'B }
-	 Command?
run
-	 Command?
log



http://www.ibm.com/rational
Contents Index Previous Next