dsatest is a Linux user space network testing framework for Ethernet switches driven by the kernel space DSA framework. It provides an extensive list of test cases, a command line to access the test bench and run the tests, as well as a Python API. It supports many Ethernet switch chips and target machines.
These instructions will get you a copy of the project up and running on your local test bench.
The framework depends on python
, python-setuptools
, and python-paramiko
.
dsatest might be compatible with your installation of Python 2.7 with python-configparser
as additional dependency.
To get the source code of the dsatest framework, follow these steps:
git clone git@github.com:netdsa/dsatest.git
cd dsatest/
Ensure that the framework is functional by listing the tests and running the sanity tests:
./dsatest -l -f bench.cfg.example
./dsatest --dry-run -t sanity -f bench.cfg.example
Configuration files are usually found in the conf/
directory provided with the dsatest package.
One can use out-of-tree configuration files by using the -C
or --conf-dir
flags from the command line.
The specified directory must have the same layout as the default conf/
directory.
Files found in this alternate directory will have precedence over the default ones.
All configuration files use the INI format. Three kind of files need to be populated in order to run tests on the bench. From a bottom-up approach:
- switch
-
Describe a switch and how its kernel driver exposes some information. This file can be shared and used in several test benches. They are located in the
switch/
configuration directory. See the switch documentation. - target
-
Describe the machine being tested, the switches that are on it, and the interfaces that the test bench will be able to use. This file can also be shared. They are located in the
target/
configuration directory. See the target documentation. - bench
-
Describe how the host machine and the target machine are connected to one another. This file is specific to each bench. See the bench documentation.
Note
|
Take a look at the example in the documentation for a complete test bench. |
Copy the example bench configuration file and describe your links and how to control your target. You may have to provide configuration files for your target and switch(es) if they don’t exist yet.
cp bench.cfg.example bench.cfg
# edit bench.cfg...
Important
|
You need the NET_CAP_ADMIN capability in order to configure network interfaces.
|
Test cases are usually found in the tests/
directory provided with the dsatest package.
One can use out-of-tree test files by using the -T
or --test-dir
flags from the command line.
The specified directory must have the same layout as the default tests/
directory.
Files found in this alternate directory will have precedence over the default ones.
By default, the dsatest
command runs all the tests found in the test directory.
Run all tests whose method names are prefixed with test_port_ping:
./dsatest -t port_ping
For details about command line options, see the help message:
./dsatest -h
dsatest was written by Damien Riegel and other contributors. It was inspired by dsa-tests, written by Andrew Lunn.