Browse files

driver/xenadriver: Add driver to interact with Xena network testing e…


Using the xenacalkyrie interface library to interact with the Xena test equipment.

Signed-off-by: Kasper Revsbech <>
  • Loading branch information...
Kasper Revsbech authored and jluebbe committed Aug 9, 2018
1 parent 03a16f2 commit 010e137bb0ff5f2b7a1d10233a07ac4e2d8a40e6
@@ -10,4 +10,5 @@ yapf==0.20.1
-r crossbar-requirements.txt
-r onewire-requirements.txt
-r modbus-requirements.txt
-r snmp-requirements.txt
-r snmp-requirements.txt
-r xena-requirements.txt
@@ -468,6 +468,19 @@ NetworkUSBTMC
A :any:`NetworkUSBTMC` resource describes a :any:`USBTMC` resource available
on a remote computer.
A XenaManager resource describe a Xena Manager instance which is the instance the
Xena Driver must connect to in order to configure a Xena chassis.
.. code-block:: yaml
hostname: ""
Used by:
- `XenaDriver`_
A RemotePlace describes a set of resources attached to a labgrid remote place.
@@ -1312,6 +1325,18 @@ but more devices can be added by extending `on_activate()` in
``labgrid/driver/`` and writing a corresponding backend in
The XenaDriver allows to use Xena networking tests equipment. Using the xenavalkyrie library
a full API to control the tester is available.
Binds to:
- `XenaManager`_
The driver is supposed to work with all Xena products from the "Valkyrie Layer 2-3 Test platform"
Currently tested on a `XenaCompact` chassis equipped with a `1 GE test module`.
@@ -24,3 +24,4 @@
from .networkusbstoragedriver import NetworkUSBStorageDriver
from .resetdriver import DigitalOutputResetDriver
from .serialdigitaloutput import SerialPortDigitalOutputDriver
from .xenadriver import XenaDriver
@@ -0,0 +1,35 @@
import logging
from importlib import import_module
import attr
from ..factory import target_factory
from .common import Driver
from ..resource.xenamanager import XenaManager
class XenaDriver(Driver):
Xena Driver
bindings = {"xena_manager": XenaManager}
def __attrs_post_init__(self):
self._xena_app = import_module('xenavalkyrie.xena_app')
self._tgn_utils = import_module('trafficgenerator.tgn_utils')
self._logger = logging.getLogger("{}".format(self))
self._xm = None
def on_activate(self):
self._xm = self._xena_app.init_xena(self._tgn_utils.ApiType.socket, self._logger, 'labgrid')
def on_deactivate(self):
if self._xm:
self._xm = None
def get_session(self):
return self._xm.session
@@ -11,3 +11,4 @@
from .udev import USBPowerPort
from .common import Resource, ResourceManager, ManagedResource
from .ykushpowerport import YKUSHPowerPort
from .xenamanager import XenaManager
@@ -0,0 +1,10 @@
import attr
from ..factory import target_factory
from .common import Resource
class XenaManager(Resource):
""" Hostname/IP identifying the manageent address of the xena tester """
hostname = attr.ib(validator=attr.validators.instance_of(str))
@@ -0,0 +1 @@

0 comments on commit 010e137

Please sign in to comment.