PacketExpert™ APIs for Test Automation and Remote Access
Command Line Interface (CLI)
MAPS™ CLI server interfaces with PacketExpert™ hardware
PacketExpert™ supports Command line Interface (CLI)to access all the functionalities remotely such as Bert, Loopback, RFC 2544, Record Playback, IPNetSim™, ExpertSAM™, PacketBroker, and Multi Stream Traffic Generator and Analyzer using TCL, Python, C# and MAPS™ CLI Client/Server architecture.
PacketExpert™ can be configured as server-side application using the GL’s MAPS™ Client-Server architecture, to provide the capability of remote operation, automation, and multi-site connectivity, using any client-side scripting tools such as the Python, C#, and TCL (Tool Command Language). On the client side, the packaged library file is provided which allows the client interface to communicate with the MAPS™ CLI Server to perform PacketExpert™ specific functionalities.
The client scripting library enables communication with the MAPS™ CLI Server using TCP/IP socket from a client environment. The MAPS™ CLI server interfaces with the PacketExpert™ hardware through the USB. The MAPS™ CLI Server developed specifically for PacketExpert™ runs (*.gls) scripts that can control the PacketExpert™ hardware. The advantage of such communication enables user to control PacketExpert™ by sending commands and receiving responses in a scripting language such as TCL, Python, C# that is already familiar with many users.
- Capability of remote operation, automation and multi-site connectivity using TCL/Python/C# client and MAPS™ CLI server.
- Scripts for MAC, VLAN, MPLS, IP and UDP layers testing
- Multiple PacketExpert™ can be controlled remotely from single client application via MAPS™ CLI server.
- Scripts for Bert, Loopback, RFC 2544, Record Playback, IPLinkSim™, PacketBroker, and ExpertSAM™ testing
Working Principle of MAPS™ CLI
Shown below is the working principle of the MAPS™ CLI Test System.
- Client user (TCL, Python, C#) run client scripts which executes the command that instructs the MAPS™ CLI Server.
- MAPS™ Client interface interprets the User Events from Client user to MAPS™ CLI Server and vice versa.
- MAPS™ CLI Server runs the CLI script to perform the particular PacketExpert™ test like BERT, RFC 2544 etc.
MAPS™ CLI Working Principle
This application consists of 3 functional modules. All these modules interact with each other to perform as a single entity. (Note: “User” refers to client TCL, Python, C#)
- Client Environment – client environment acts as a user interface, which includes predefined scripts, that can be used by user to access various PacketExpert functionalities. Client API uses the library file to communicate with the server and translate the high-level API into low level APIs. It can be any scripting tool (automation tool) like C#, Python, and TCL, which provides simple scripting language with programming facilities such as looping/procedures/variables/For and While loops, making task execution simpler.
The Client script contains built-in commands which instruct MAPS™ CLI Server to Start/Stop Testbed, Start/Stop Scripts, Apply User Events, Apply Global Variables, Load Profiles, Passing values to the variables, and similarly others.
- MAPS Client Interface (IFC) – acts as an interface between MAPS™ CLI Server and its client TCL, C#, Python. The Client application includes a packaged library that enables communication with the MAPS™ Server from the client environment. MAPS Client IFC provides added benefits of a fully capable flow control engine with built commands.
- It interprets the client Commands and forms the appropriate command as understood by MAPS™ CLI Server and vice versa.
- It also stores the MAPS™ CLI Server responses into Script Information Storage in a variable which can be accessed by the client script.
- Stores the information from MAPS™ Server in a variable which can be accessed by the client script
- Client fetches the report using the get command
- MAPS™ CLI Server –MAPS™ CLI Server is a scripting based frame work which controls the PacketExpert hardware using proprietary MAPS™ scripts which has list of instructions to perform actions such as,
- Storing/retrieving configuration to/from hardware,
- Start/stop BERT/RFC 2544 etc.,
- Timer related instruction,
- Conditional statements,
- Control statements.
TCL Client and Scripting
TCL Client application includes a command-line interface (TClsh85.exe) into which client users may key in commands or load commands from previously saved files.
TCL provides a simple scripting language, with programming facilities such as looping, procedures, and variables. The TCL Client application includes a MapsTclIfc.dll file, a packaged library that enables communication with the Server from a TCL environment.
MAPS™ TCL Client Interface (MAPS Client IFC) application includes a MapsClientIfc.dll file, a packaged library that enables communication with the MAPS™ Server from a TCL environment. The advantage of such communication enables user to control MAPS™ by sending commands and receiving responses in a scripting language already familiar with many users.
A sample TCL script (User_Bert.tcl) can be downloaded from here.
Command-Line based TCL Client
MAPS CLI Server
MAPS™ CLI Server is an executable which inherits all features of MAPS™ without GUI. It listens to a TCP message socket to receive and execute commands from client and sends the responses back to client.
GL’s proprietary MAPS™ CLI Server scripts (*.gls files) developed specifically for PacketExpert™ implements various PacketExpert™ functionalities like BERT, RFC 2544, and others. It includes XML files which contain the configuration information required for the test such as MAC Addresses, IP Addresses, BERT parameters, RFC 2544 parameters, and others, which are created using a Profile Editor. MAPS™ CLI Server interfaces internally with low level PacketExpert™ APIs to access PacketExpert™ hardware and to perform tasks.
Components of MAPS™ CLI Server for PacketExpert™
CLI Server script execution is Event Driven, i.e., Server detects the Events such as InsertStatus, InterfaceStatus, IsRunning, LoadProfileStatus, RFC2544Init, RFC2544TestConfig, TestDirection and others.
A sample CLI Server script (PEX_Init.gls) and (PEX_BERT_Main.gls) can be downloaded here.
MAPS™ CLI Server for PacketExpert™
Python Client and Scripting
Python client consists of python API scripts, that provide High Level APIs, using which all the PacketExpert functionalities are accessible to the users. These APIs in turn use a low level library to communicate with the PacketExpert MAPS server.
MAPS™ CLI Server for PacketExpert™
The Python interface developed for PacketExpert™ allows users to control all features of PacketExpert™ through Python APIs. The Python interface is implemented based on a client-server model. The server is the MAPS™ CLI server, which interfaces with the PacketExpert™ hardware through the USB. The client consists of a Python API dll and Python API scripts, which allows user to control the MAPS™ CLI server, issue commands and get back results.
The MAPS Python Interface (MAPS Client IFC) application includes a PythonMapsCliIfc.pyd file, a packaged library that enables communication with the MAPS™ CLI Server from a Python environment. The advantage of such communication enables user to control MAPS™ by sending commands and receiving responses using the familiar programming language.
MAPS Client IFC provides added benefits of a fully capable flow control engine with built commands.
Executing the Client script in “Python Shell” console