![]() |
![]() |
![]() |
![]() |
![]() |
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} EOFCommandLine::= Comment|CommandComment::= <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.
;;;;;; File Name: example;;; This is an example command file, uses ; for command delim.;;;;; Initialisation (see command descriptions below)cl ; Set command line log modeloglevel 2 ; Set log level to 2nomsc ; Disable MSC generationnopoll ; Disable command pollingdiscrete ; Use discrete time sim;; Now run a test casestep TestCase1 ; Will create contextreceive Lower ConnectInd { Address 3 }run ; Will actually run till idletimeout ; 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:
- Command name
- Aliases
- Alternative command names that may be handy if running from a command line interface. These are often common names for similar operations in debuggers. A hyphen indicates that the command has no aliases apart from any possible abbreviations. Aliases may also be abbreviated, for instance, the alias rts for the realtime command can be abbreviated rt.
- Synopsis
- The command with "symbolic" parameters. If a parameter is surrounded by square brackets "[ ]", it is optional. If a parameter is surrounded by curly brackets "{ }", it indicates that a list may be accepted. If the parameter is surrounded by angle brackets "< >", it means that the name should be substituted by an identifier of an object of an appropriate type.
- Description
- Example
General Commands
Help
<command-name> <states> <debug>Denotes if the tester needs to be generated with the line information for the command to be running correctly:
<description>
- The help command will automatically transition the tester to a Paused state if it is in running state.
- Command?help
Quit
- Command?quit
Include
- Command name: include
- Aliases: -
- Synopsis: include <filepath>
+filepath- Description:
- Enqueue all the commands from the file named by file path. The file path can be relative to the current working directory of the tester, or it may be absolute. Also, the shortcut + may be used for simpler access to common scripts. It is recommended but not required that scripts have a file extension of .ics (ISM Command Script).
- It is sometimes desirable to use the command nopoll in conjunction with script reading, in particular when running test cases from scripts. The nopoll command gives a more synchronous behavior.
- Command?include setup.ics- Command?+setup.ics
Test Management Commands
List
Command?listMyTest1MyTest2MyTest3[N/S]
Glist
- Command?glistMyGroup1MyGroup2
Run
- 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
- Command name: step
- Aliases: line
- Synopsis: step {<TestCaseOrGroupNames>}
- Description:
- Start the execution of the named test cases or groups. The test cases will run until a breakpoint is reached, the test case terminates, or until another command is entered.
- As opposed to the run command, the test execution will also stop if a line is matched, or if a snapshot (idle) state is reached. This command requires that the tester has been built with line debug information for correct operation.
- If a test is already in progress, this command will continue the test execution until one of the above conditions are met.
- This command will toggle the timer mode to Discrete, since it is not possible to use real-time and line stepping in conjunction.
- Command?step MyTest1-- Line: MyTest1 1- Command?step- Line: MyTest1 2- Command?step- Line: MyTest1 3- Command?
Stop
- Command?run MyTest1- Line: MyTest1 1- Line: MyTest1 2stop- Command?step- Line: MyTest1 3- Command?
Cancel
- run test1
Loglevel
- If no level is supplied, the default level will be used.
- Command?loglevel 3- Set conformance log level = 3- Command?
Savestats
- Command name: savestats
- Aliases: ss
- Synopsis: savestats [<file path>]
- Description:
- Save a simple tabulated file with a list of what tests have been executed and what their verdicts were. This is useful for tracking test results over time, typically by loading the result file in some type of information management program. If the file path is omitted, the default file path results.txt will be used.
- Command?savestats testresults.txt- Command?# Just list the contents of the filesystem cat testresults.txtTest VerdictMyTest1 PASSMyTest2 FAILMyTest1 INCONCLUSIVE
Liststats
- Command?liststats- Listing test statistics:- MyTest1 PASS- MyTest2 FAIL- MyTest1 INCONCLUSIVE- Command?
Clearstats
- 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
- Command?breakpointsMyTest1 5- Command?
Breakpoint
- 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 2breakpoints- MyTest1 1- MyTest1 4- MyTest2 2- Command?
Delete
- Command?breakpoint MyTest1 3- Breakpoint set at MyTest1 3- Command?breakpoint MyTest1 5- Breakpoint set at MyTest1 5run- 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
- Command?disable- Breakpoints disabled- Command?
Enable
- Command?disable- Breakpoints disabled- Command?enable- Breakpoints enabled- Command?
Timers
- 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
- 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
- Also, the currently active test component will be indicated with an arrow (->) in the output of this command.
- Command?ptcs- Name Id Thr Table Line- MTC 124 0 MyTest1 5- -> PTC1 125 13 MyStep1 3-- Command?
Gett
- Command?gett MTC TsvFoo- TsvFoo: 4711- Command?gett PTC1 TsvFoo- TsvFoo: 1234- Command?
Test Simulation Commands
Discrete
* Line: Table1 3* Line: Table1 4* Line: Table1 5discrete* Discrete time simulation is now used.- Command?
Realtime
- Line: Table1 1- Command?step- Line: Table1 2realtime- 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
- 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
- Command name: receive
- Aliases: input
- Synopsis: receive <PCOId> <ISMValueEncoding>
- Description:
- Enqueue the message defined by ISMValueEncoding in the PCO input queue connected to the named PCO.
- It is possible to use input values of types SEQUENCE OF, SET and SET OF. The left/right braces syntax should be:
- SEQUENCE - '{' and '}'
- SEQUENCE OF - '[' and ']',
- SET - '{.' and '.}'
- SET OF - '[.' and '.]'
- The field's names are mandatory for SET values and optional for SEQUENCE values.
- For an alternative form, see Messageinput.
- 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
- Command?nomsc- MSC generation disabled- Command?
Decomposed
- Command name: decomposed
- Aliases: -
- Synopsis: decomposed
- Description:
- Enable MSC generation with decomposed MSCs. For more information, see The TTCN to C Compiler (in Windows) and The TTCN to C Compiler (on UNIX).
- The command is only available when the tester is stopped.
- Command?decomposed- Decomposed MSC generation enabled- Command?
Composed
- Command name: composed
- Aliases: -
- Synopsis: composed
- Description:
- Enable MSC generation with composed MSCs. For more information, see The TTCN to C Compiler (in Windows) and The TTCN to C Compiler (on UNIX).
- The command is only available when the tester is stopped.
- Command?composed- Composed MSC generation enabled- Command?
Mscsystem
- Command name: mscsystem
- Aliases: -
- Synopsis: mscsystem [<system-name>]
- Description:
- Define the name of the IUT instance in the composed MSC generation. This is for making it easier to generate MSCs which should later be reused in a system verification with an MSC verification tool such as the SDL Explorer, as well as for test re-generation with a tool such as Autolink.
- If the system-name parameter is omitted, a default system name will be used (by default IUT).
- Command?mscsystem env_0- IUT Name for composed MSC generation defined.- Command?Mscprefix
- 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
- Command?clearreports- Reports cleared.- Command?
Listreports
- Command name: listreports
- Aliases: lr
- Synopsis: listreports
- Description:
- List all the reports of dynamic errors encountered so far in test runs. The reports are in the following general format:
Report <index>: [<table>] <line>: <description>- The <table> field is optional. If it is not present, it implies that the report was not detected in the context of a running test component. If the <line> field is 0, there is a context available, but the context is not executing.
- Also, if no line debug information is available, the table and line will be omitted and 0 respectively.
- Command?listreports- Listing reports:- Report 1: TestCase1 7: Missing ?DONE in MTC- Report 2: TestCase2 3: Incomplete test case- Command?
Savereports
- Command?listreports- Listing reports:- report 1: TestCase1 7: Missing ?DONE in MTC- report 2: TestCase2 3: Incomplete test case- Command?
Messagefile
- Command name: messagefile
- Aliases: mf
- Synopsis: messagefile <filename>
- Description:
- Append the message definitions in the messagefile to the list of input messages that can be used with the messageinput command, and also for selection of messages with the randomwalk command.
- The syntax of the file named by filename is:
MessageFile ::= MessageLine | CommentLine;MessageLine ::= PcoId ISMValueEncoding NL;CommentLine ::= NonAlphaChar Any NL;- Example message file:
# This is an example message file named file1.msgPCO1 ASP1 { 1 2 FALSE '1234'O }PCO2 ASP3 { 4 2 TRUE '3123'H }# end of example file- Also note that messages can be added with the command messageadd. The messagefile is mainly intended for message lists generated by other means than with this tool.
- Command?messagefile file1.msg- Adding message definitions:- PCO1 ASP1 { 1 2 FALSE '1234'O }- PCO2 ASP3 { 4 2 TRUE '3123'H }- Command?
Messageadd
- Command name: messageadd
- Aliases: ma
- Synopsis: messageadd <pconame> ISMValueEncoding
- Description:
- 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
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
- 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?messagelistmessagelist- Listing message definitions- Command?
Messageinput
- 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
- Command name: randomwalk
- Aliases: rw
- Synopsis: randomwalk [<repetitions>] {<testcaselist>}
- Description:
- 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
- Command?maxdepth 10- Defined max depth for random walk- Command?
Kernel Management Commands
Cl
<VERDICT>- FINAL VERDICT: PASS</VERDICT><MESSAGE UI::READY>- Command?</MESSAGE UI::READY>cl- Output tagging disabled- Command?list- TestCase1- TestCase2- Command?
Ui
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
- Command?poll- Command?
Nopoll
- Command?nopoll- Command?
Cmdlog
- 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
- Command?status- Tester status: STOPPED- Time Mode: Discrete Time Simulation- Logging level: 2- Breakpoints: Disabled- Command Log: Disabled- Logging Mode: Command Line-- Command?
System
- Command?system mkdir ./msctraces- Command?mscprefix ./msctraces/trace_- Command?composed- Command?run tc1 tc2 tc3 tc4[snip]- Command?system ls ./msctracestrace_tc1.mpr trace_tc2.mpr trace_tc3.mpr trace_tc4.mpr- Command?
Log
- Command name: log
- Aliases: -
- Synopsis: log [<filepath>]
- Description:
- Start or stop a total log. If the <filepath> argument is supplied, the named file will be opened for writing. All commands from the command line or included scripts, conformance log and messages from ETS will be written to the file. If no file name is supplied, the file will be closed and logging disabled.
- Command?log mylog.txt- Command?receive pco1 asp1 { '10'B FALSE '11'B }- Command?run- Command?log
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |