Skip to content

xenanetworks/open-automation-script-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xena OpenAutomation Script Example Library

Introduction

This repository includes examples of using XOA Python API, aka. xoa-driver

Script Description

Quick Start


Async Wrapper for Non-Async Python

  • async_wrapper: The APIs provided by xoa-driver are async functions. This means any function that uses the xoa-driver must be declared as async. This might be a problem for you if your existing framework doesn't support async functions. To solve this "incompatibility" issue, we have made an async wrapper class XenaAsyncWrapper for you to wrap xoa-driver's async function inside and use it as a regular Python function.

Automated Test Suite


Port Configuration and CLI

  • xpc_cli_integration: XenaManager's port configuration (.xpc) and CLI integration with XOA Python API. Demonstrates how to load .xpc file or send CLI commands via XOA Python API.
  • cli_wrappers: different language wrapper for CLI commands, e.g. Java, Tcl, Perl, etc.

Various Statistics


Port and Stream Configuration

  • modifier: how to add modifiers on a stream.
  • filter: how to add filters on a port.
  • freya_tx_tap_tuning: set and get the port TX taps in three different format, applicable to Z800 Freya only.
  • header_builder: use the headers module to build packet headers.
  • ip_streams_arp_ndp_table: configure port's ARP/NDP table based on the IP streams configured on it.
  • simple_arp: simple ARP example to resolve the MAC address of a port.
  • pcap_replay_capture: how to replay frames from a pcap and capture traffic into another pcap file.
  • thor_ppm_anlt_stream: demonstrates how to change media configuration, perform PPM sweep and AN&LT on Thor modules.
  • stream_sync: how to synchronize the streams on a port to the script client cache.
  • chassis_uptime: read system uptime.

Emulate Various Scenarios

  • dhcp: how to create a DHCP stream
  • ip_fragmented: emulate IP fragmentation.
  • tcp_handshake: how to emulate a TCP 3-way handshake.
  • oran_dos: DoS attack emulation for ORAN.
  • rocev2: emulate RoCEv2 flow for AI performance test.

Transceiver Access


Misc.

What Example Folder Contains

Each folder contains at least three files:

  • Python script file - this is where the example code locates
  • requirements.txt - dependencies to run the code. You should pip install -r requirements.txt to update your Python environment (either global or virtual) to have the necessary dependencies.

Installing XOA Driver

This section details how to install xoa-driver. Installation is necessary to execute scripts that use XOA Python API.

Before installing xoa-driver, please make sure your environment has installed python>=3.10 and pip.

You can install the xoa-driver to your global or virtual environment for Windows, macOS, and Linux using the commands below.

pip install xoa-driver -U            # latest version

Once the xoa-driver is installed, you can execute your script.

For the most detailed instructions on how to install the XOA driver, visit our Getting Started section of our official XOA documentation here: https://docs.xenanetworks.com/projects/xoa-python-api/en/latest/getting_started/installation.html