XOA Driver is a Python library providing user-friendly communication interfaces to Xena Traffic Generation test equipment. It provides a rich collection of programming interfaces that can be used to either write test scripts or develop applications.
Project description
XOA Driver
XOA Driver is a standalone Python library that provides a user-friendly and powerful interface for automating network testing tasks using Xena Networks test equipment. Xena test equipment is a high-performance network test device designed for testing and measuring the performance of network equipment and applications.
Introduction
The XOA Driver is designed to be easy to use and integrate with other automation tools and frameworks. It provides a comprehensive set of methods and classes for interacting with Xena test equipment, including the ability to create and run complex test scenarios, generate and analyze traffic at line rate, and perform detailed analysis of network performance and behavior.
The XOA Driver simplifies the process of automating network testing tasks using Xena test equipment. It provides a simple, yet powerful, interface for interacting with Xena test equipment using the Python programming language. With the XOA Driver, network engineers and testing professionals can easily create and execute test scenarios, generate and analyze traffic, and perform detailed analysis of network performance and behavior, all while leveraging the power and flexibility of the Python programming language.
Overall, the XOA Driver is a valuable tool for anyone looking to automate their network testing tasks using Xena test equipment. With its simple, yet powerful, interface and support for the Python programming language, the XOA Driver provides a flexible and extensible framework for automating network testing tasks and improving the quality of network infrastructure.
Documentation
The user documentation is hosted: XOA Driver Documentation
Key Features
- Objected-oriented, high-level abstraction, to help users save time on parsing command responses.
- Supporting sending commands in batches to increase code execution efficiency.
- Automatically matching command requests and server response, providing clear information in case a command gets an error response.
- Supporting server-to-client push notification, and event subscription, to reduce user code complexity.
- Covering commands of Xena testers, including Xena Valkyrie, Vulcan, and Chimera.
- Supporting IDE auto-complete with built-in class/function/API use manual, to increase development efficiency.
Installation
Install Using pip
Make sure Python pip is installed on you system. If you are using virtualenv, then pip is already installed into environments created by virtualenv, and using sudo is not needed. If you do not have pip installed, download this file: https://bootstrap.pypa.io/get-pip.py and run python get-pip.py.
To install the latest, use pip to install from pypi:
~/> pip install tdl-xoa-driver
To upgrade to the latest, use pip to upgrade from pypi:
~/> pip install tdl-xoa-driver --upgrade
Install From Source Code
Make sure these packages are installed wheel, setuptools on your system.
Install setuptools using pip:
~/> pip install wheel setuptools
To install source of python packages:
/xoa_driver> python setup.py install
To build .whl file for distribution:
/xoa_driver> python setup.py bdist_wheel
Quick Start
-
Get Python pip if not already installed (Download https://bootstrap.pypa.io/get-pip.py):
python get-pip.py -
Install the latest tdl-xoa-driver:
pip install tdl-xoa-driver -U -
Write Python code to manage with Xena testers:
import asyncio
from xoa_driver import testers
from xoa_driver import modules
from xoa_driver import ports
from xoa_driver import enums
from xoa_driver import utils
async def my_awesome_func():
# Establish connection with a Valkyrie tester
async with testers.L23Tester("10.10.10.10", "JonDoe") as tester:
# Get the port 0/0 (module 0)
port = await tester.modules.obtain(0).ports.obtain(0)
# Reserve the port
await port.reservation.set_reserve()
# Reset the port
await port.reset.set()
# Create a stream on the port
stream = await port.streams.create()
# Prepare stream header protocol
header_protocol = [enums.ProtocolOption.ETHERNET, enums.ProtocolOption.IP]
# Batch configure the stream
await utils.apply(
stream.tpld_id.set(0), # Create the TPLD index of stream
stream.packet.length.set(*size), # Configure the packet size
stream.packet.header.protocol.set(header_protocol), # Configure the packet type
stream.packet.header.data.set(header), # Configure the packet header
stream.enable.set_on(), # Enable streams
stream.rate.fraction.set(1000000) # Configure the stream rate 100%
)
# Clear statistics
await utils.apply(
port.statistics.tx.clear.set(),
port.statistics.rx.clear.set()
)
# Start traffic on the port
await port.traffic.state.set_start()
# Test duration 10 seconds
await asyncio.sleep(10)
# Query TX statistics
tx_result = await port.statistics.tx.total.get()
print(f"bit count last second: {tx_result.bit_count_last_sec}")
print(f"packet count last second: {tx_result.packet_count_last_sec}")
print(f"byte count since cleared: {tx_result.byte_count_since_cleared}")
print(f"packet count since cleared: {tx_result.packet_count_since_cleared}")
# Stop traffic on the port
await port.traffic.state.set_stop()
# Release the port
await port.reservation.set_release()
def main():
try:
loop = asyncio.get_event_loop()
loop.create_task(my_awesome_func())
loop.run_forever()
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tdl_xoa_driver-1.0.0.tar.gz.
File metadata
- Download URL: tdl_xoa_driver-1.0.0.tar.gz
- Upload date:
- Size: 319.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19b24aa43104c888ddbd30d8eb598f08ac27b44ff0cf589d8b63931874c40d96
|
|
| MD5 |
03f50093b6c80ca0286fb16ffeaf982a
|
|
| BLAKE2b-256 |
b9329b10fa03893c92b1ab0ba6cd199ae5c6e449c073ad1025ed8e7555fd3b7e
|
File details
Details for the file tdl_xoa_driver-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tdl_xoa_driver-1.0.0-py3-none-any.whl
- Upload date:
- Size: 462.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbeab95b89d6ded1c41026276253e72b7b0658531acb6a65dc6b82a9cfb90f86
|
|
| MD5 |
0221ac4f77f6e555399b2d2a21088cd9
|
|
| BLAKE2b-256 |
dbef9d4183808df9b4791ad789d32cad133ecde21652ef91aee47ad5d37b2782
|