Command Syntax

The CLI commands are simple lines of text exchanged between a client and a Xena tester. An example command to the chassis is:

0/5 PS_RATEPPS [3] 500000

This goes to Module 0, Port 5, and sets stream #3’s rate to 500,000 frames per second, and the tester responds with:

<OK>

You would query for the current parameter this way:

0/5 PS_RATEPPS [3] ?

And the tester would respond in exactly the same way that you set the parameter yourself:

0/5 PS_RATEPPS [3] 500000

Note

ValkyrieManager saves test port configurations (.xpc file) in the exact same CLI command format as used by XOA CLI. This makes it very easy to go back and forth between a ValkyrieManager environment and a XOA CLI environment. For example, exporting a port configuration from ValkyrieCLIManager generates a configuration file in a simple text format that can be edited using a text editing tool such as Microsoft Notepad. It can then be imported back into ValkyrieManager.

The seamless interaction between port configuration files and XOA CLI accelerates your scripting learning curve, letting you get more done quicker as complex test port configurations can easily be defined in ValkyrieManager, and then exported to a text based configuration file, which in turn can be cut & pasted into your scripting tool environment.

In the following sections, you will find the basics of Xena’s scripting mechanism, followed by reference sections describing each group of scriptable commands in detail. There are a few hundred commands in total, but only a handful is required for typical simple tasks.

Tip

To set up basic traffic patterns and obtain traffic statistics, use the port commands (starting with P_…), the stream commands (starting with PS_…), and the transmit/receive statistics commands (starting with PT_… and PR_…).

In the last section Sample XOA CLI Script, you will find an example of how to use a collection of XOA CLI commands to define and execute some simple operations on a Valkyrie tester.

The XOA CLI has similar syntax for setting and getting parameters of individual commands of the chassis resources. Some commands, such as inter-frame gap, support both set and get actions; others, like physical port type, support only get; and a few, like injecting errors, support only set.

set Syntax

You change parameters or states of the test resources using:

<module-index>/<port-index> <command> [<indices>] <parameters>
  • <module-index> and <port-index> are the numeric sub-indices for locating a particular module or a port.

    • For chassis-level commands, neither of these are present.

    • For module-level commands only <module-index> is present.

    • Both <module-index> and <port-index> are 8-bit long.

    • The value range of <module-index> and <port-index> is 0 - 255.

  • <command> is one of the names specified later in this document in CLI Reference.

  • <indices> are possible sub-indices of the command, e.g. identifying a stream, a Serdes, a modifier, etc.

    • <indices> must be placed inside [ ].

    • Multiple <indices> must be separated by comma, e.g. [0, 1, 2].

    • All <indices> start at zero.

    • All <indices> are 32-bit long, but it doesn’t mean they can be any value between 0 and 2^32-1. Usually the maximum value of an index is limited by the capabilities of the chassis/module/port, for example the number of streams on a port, or the number of modifiers on a stream.

  • <parameters> specify the values appropriate for the particular command.

    • Multiple parameters are separated by space.

    • A parameter is specified using one of the formats defined in Parameter Data Types.

Examples:

C_OWNER "username"
0 M_COMMENT "module description"
0/5 P_RESERVATION RESERVE
0/5 PS_RATEPPS [3] 500000

get Syntax

You can query the current parameters of test resources using:

<module-index>/<port-index> <command> [<indices>] ?

The chassis responds with a line using identical syntax to the change-command, containing the current parameters. These responses can, therefore, be ‘’replayed’’ back to the chassis to re-establish the parameter from a previous query.

This is actually the core of the load/save mechanism of the ValkyrieManager, as you can see by using an ordinary text editor to inspect the local files produced by saving. You can also change the content if you want to; it is not interpreted by the Manager applications.

Note

Some queries, like P_INFO ? and P_CONFIG ?, are special in that they do not refer to one particular command, but rather to a collection of commands. The response is multiple lines containing the current parameter of each of these commands.

Examples:

C_OWNER ?
0 M_COMMENT ?
0 P_RESERVEDBY ?
0/5 PS_RATEPPS [3] ?