Test Combiner keywords

Keyword

Explanation and usage examples

title

Describes the test case. This is mandatory for every test case and must be the first keyword. The description is placed after the keyword.

title Create, print, run example and delete
timeout

Used to give a timeout value for a test case. The timeout value is given in milliseconds. For example, timeout of 10 seconds would be marked as:

timeout 10000
priority

The priority value of the test case is either an integer or the string (high, normal or low). Negative values are low and positive values are high.

For example, –100 is low, 0 is normal, 100 is high, 1000 is very high:

priority high
priority 100
priority –100
priority 0
print

Can be used to print, for example, progress information to the UI. The printed description is placed after the print keyword, as in the example in Test scripts.

canceliferror

Used to cancel the execution of the remaining test cases if one of the executed test cases has failed. This keyword is normally used to stop the test case execution when some of the test cases are long running.

[Test]
title Simple test case with canceliferror keyword
canceliferror
run testmodule1 myConfig.cfg 1 // test case fails
run testmodule2 mySecondConfig.cfg 2 // long running test case
[Endtest]
pausecombiner

Used to pause test combiner for a specified time. The keyword has one mandatory argument, which is the timeout for the pause (in milliseconds).

For example, to pause for ten seconds:

pausecombiner 10000
run

Used to start a specified test case. It has several mandatory and optional arguments. The mandatory arguments are:

  • testmodule: The test module name.
  • configfile: The test case configuration file.
  • test case number: The test case number to be executed from configfile.

Optional arguments contain, for example, testid (identification for the test case), ini (initialization file for the test module) and category (normal, leave, panic, exception or timeout).

For example:

run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt

run netmodule net.cfg -1 testid=test1 “title=My test case example”
cancel

Used to cancel a started test case. The test case is cancelled by immediately killing the thread that executes the test case. The keyword has one mandatory argument, the test ID.

cancel test1
pause

Used to pause a test case. The test case is paused by pausing the thread that executes the test case. The pause keyword has one mandatory argument, the test ID.

Optionally, the timeout (in milliseconds) can also be given. After this time, resume is called automatically (if not given, resume needs to be called explicitly).

pause test1 time=10
resume

Used to resume a paused test case. Has one mandatory argument, the test ID.

resume test1
complete

Used to have a started test case wait to complete and blocks until the test case has finished. Has one mandatory argument, the test ID.

complete test1
testmeasurement

Used for test measurement testing. It can take the following arguments:

  • Command (start or stop)
  • Type
  • parameters
testmeasurement start stifmeasurementplugin02 c:\ConfigurationInfo.txt
. . .
testmeasurement stop stifmeasurementplugin02
loop
endloop

Used to repeat a section of the test case file for the specified number of iterations. The section to be repeated is enclosed with the loop and endloop keywords. Nested loops are not supported. Available arguments are:

  • Loop times: The loop count, that is, the number of times that the loop is executed.
  • msec (optional): This keyword indicates that ‘Loop times’ argument stands for the time in milliseconds during which loop will be repeated.
  • passlimit (optional): turns on passlimit (endurance) feature.
  • passlimit value (only when passlimit is enabled): defines how many iterations must pass to let pass the whole loop

For example, to execute a loop for 5 times:

loop 5 // execute this 5 times
run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt
complete test1
endloop

loop 5 passlimit 3
//execute something for 5 times
endloop
request

Used to request an event. If someone wants to use an event, it must first be requested, and after that it can be waited. After the event is not used anymore, it must be released. The event name is a mandatory parameter.

request Event1
wait

Used to wait for an event. A request must be called before wait, and wait blocks until the requested event is set. wait may proceed immediately if the requested event is a state event and already pending (for example, a phone call is already active). It has one mandatory argument, which is the event name.

wait Event1
release

Used to release an event. Every requested event must be released explicitly when it is not used anymore. It has one mandatory argument, which is the event name.

release Event1
set

Used to set an event. Every set state event must be explicitly unset. The arguments are:

  • Event: The event name.
  • State (Optional): If set to 1, indicates that this is a state event, i.e. it remains set until it is unset explicitly with the unset keyword. If set to 0, indicates that the event is an indication, so it is set only once to every requester and implicitly unset after that.

For example:

set Event1
set Event2 state
unset

Used to unset a state event. Every set state event must be unset. Indication events cannot be unset. unset blocks until everyone who has requested the specified event has released the event. The mandatory argument is the event name.

unset Event1
allocate

Used to allocate a slave, for example for running a test case on a remote phone. It uses Remote Control Protocol (RPC). The slave must always be allocated first before it can be used.

  • Slave type: The type of the slave. STIF only supports slave phone. phone indicates that slave phone is also running STIF. Other types must be handled by the slave implementation, that is, when implementing separate support for external network simulator.
  • Slave name: A unique name for the slave.

For example:

allocate phone MySlave
free

Every allocated slave must be freed with free when it becomes unused. It has one mandatory argument, the slave name.

free MySlave
remote

Used to start the execution of a test case in a slave and also to request and release events from the slave. Other test case controlling for remote test cases is done with the same keywords as for the local test cases.

  • Slave name: The slave name, the same that was given for allocate.
  • Command name : The remote command name (supported: run, request, wait, set, unset, release).

For example:

remote MySlave run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt
remote MySlave request Event1
remote MySlave wait Event1
remote MySlave set Event1
remote MySlave unsetEvent1
remote MySlave release Event1