How do I repeat a test case or module over and over?
You can use the cdrouter-cli -repeat
option to repeat a module or list of
tests indefinitely. You can then add other options such as -rcount
,
-scount
, -until-fail
, and -duration
to further control the
looping behavior. CDRouter web UI users will find these same options in the
Run-Time Options portion of the Package Editor.
Test Repeat and Looping Options
Option | Description |
---|---|
-repeat |
This option enables the repeat (or loop) mode by default. The exact behavior can be modified using some of the other example below. |
-rcount value |
This option enables the looping of the test list a specific number of times where value is an integer. |
-scount value |
This option enables the repeating of the each test case in the list a specific number of times before moving on to the next test. So if -execute 1,2,3 is used with -sount 2 , the tests will be run in the following order 1,1,2,2,3,3. If -rcount 2 is used instead, the tests will be run in the following order 1,2,3,1,2,3. |
-until-fail |
This option will stop test execution when the first test fails. |
-duration seconds |
This option will continue repeating tests until the duration is over. The duration must be specified as the number of seconds. This can also be combined with any of the repeating options. |
Examples
# loop module forever
$ cdrouter-cli -module nat.tcl -repeat
# loop 2 modules 10 times
$ cdrouter-cli -module nat.tcl -module forward.tcl -rcount 10
# loop a single test case until it fails
$ cdrouter-cli -execute cdrouter_nat_1 -repeat -until-fail
# run each test in the nat.tcl module 3 times in a row
$ cdrouter-cli -module nat.tcl -scount 3