Appendix A: Creating a Sample TestComposer Script
This appendix describes a sample operations sequence for defining a TestComposer test script.
This appendix covers a TestComposer script creation example. For instructions on creating sample Response Templates, refer to Response Templates Creation Samples.
Test Overview
For the purpose of our example, we are considering a TestComposer test script that runs against a router DUT that is connected to a test port.
Initially the test script verifies that the DUT has uplink by using a cmd session, executing ping commands. The Execute step has two events embedded:
If the command response of the ping command contains the word "Reply", then the DUT_config procedure is called. If the DUT port is down, the test will then execute a procedure that will warn the user and abort the execution.
For while loop, if the DUT is up, the test runs continuously configuring the port with an IP address.
This scenario is useful when running a long duration test and when using a shared DUT because the script assures that at every 10 seconds the port is configured.
Figure:Sample Test Overview
Creating the Composer Test
To create the test script described in Test Overview proceed as follows:
While in the TestComposer plugin, click the Append Last Step button and configure the Assign step. Configure a maxtime timeout value using the following Tcl expression inside an Assign statement:
Assign maxtime [expr [clock seconds] + 10].
Add an endless While loop (the loop always evaluates as true) which is the core of the execution.
In the While loop, add a Sleep step; avoiding the loop steps to be executed too fast, thus flooding the application.
Add an If conditional comparing the clock time with the assigned variable: maxtime. This step is evaluated as true after 10 seconds.
Start a cmd session from the Console Button that pings the DUT router.
The steps is traced from the Console area to Test Composer. Right click on the Execute step and select Properties. In Match Options menu, configure the step events.
The first event verifies if any replies are found in the response to the ping step. If so, the DUT_config procedure is triggered.
The DUT_config procedure is created as following: Open from the Console a telent session and configure the DUT. Place the session steps inside a procedure and then edit its Command String to give a name to the added procedure.
The second event is triggered when the ping command has no replies. The script displays a warning message to you with the Trace command. After, the execution is aborted by the Exit step.
Click the Save button. The TestComposer script is saved into the IxLoad configuration after selecting a desired script name.
IxLoad TestComposer │ User Guide |