3.2. High-Level Functions

HL-FUNC provides high-level abstraction functions on top of the object-oriented APIs in HL-API, aiming to help you simplify code logics and increase readability and maintainability. HL-FUNC consists of sub-libraries where functions are grouped based on functionalities, such as ANLT. Complex operation sequences are wrapped inside high-level functions, e.g. initiating link training, reserving ports, etc.

from xoa_driver.hlfuncs import anlt, mgmt

# Regardless of who owns the port, this function makes sure you have the ownership.
await mgmt.reserve_port(port, force=True)

# Tells the remote link training partner to increase its emphasis register value by 1 bit.
await anlt.lt_coeff_inc(port=port, lane=0, emphasis=LinkTrainCoeffs.PRE)

The object-oriented APIs in HL-API and the command classes in LL-API are one-to-one mapped, and there is no abstraction provided by the HL-API. As a test specialist, your focus is on building test logics and sequences, not spending unnecessary time on “logistics”, such as reserving ports, releasing your ports, deleting all streams on a port without resetting, etc.

To help you simplify code complexity, speed up development, increase readability and maintainability, HL-FUNC is added as the topmost layer, providing abstract functions to the frequently used operations.

3.2.2. CLI Integration

The XOA Python API allows users to interact with Xena Networks test equipment using Python code, providing an object-oriented and user-friendly interface for automating network testing tasks. It enables users to create and execute test scenarios, generate traffic, and analyze network performance using Python programming language. On the other hand, the XOA CLI allows users to configure and control Xena test equipment through command-line commands. It provides a familiar and efficient way to interact with the equipment, allowing users to perform various configuration tasks, manage ports, and execute test commands.

By leveraging both the XOA Python API and XOA CLI, users can take advantage of the best of both worlds. They can harness the power of Python for automation, scripting, and advanced data analysis while utilizing the precise control and configuration options provided by the CLI commands. With the XOA Python API, users can seamlessly work with CLI commands and port configuration files from ValkyrieManager, streamlining the configuration process. Whether users prefer a programming approach or a straightforward command-line interface, both options are available to suit different requirements and preferences when working with Xena test equipment. This synergy enhances the overall testing experience, enabling users to perform complex testing tasks efficiently and effectively.

  1. Send tester configuration from a configuration file

  2. Send module configuration from a configuration file

  3. Send port configuration from a configuration file (.xpc file)

  4. Send tester configuration from a string

  5. Send module configuration from a string

  6. Send port configuration from a string

3.2.3. Test Resource Management

As described in Test Resource Management, you need to reserve the test resource (chassis/module/port) to do set operations. In order to achieve this, you need to first check the ownership of the test resource, and relinquish it in case it is owned by someone else, and then reserve it. Such as sequence of operations can be simplified by the high-level abstraction functions in UTIL.

  1. Connect to chassis

  2. Reserve/Release/Reset ports

  3. Reserve/Release chassis (in future release)

  4. Reserve/Release module (in future release)

  5. Disconnect