This project contains PTF-based tests for fabric.p4, a P4 program distributed as part of ONOS, designed to work with Trellis, a set of SDN applications running on top of ONOS that provide the control plane for an IP fabric based on MPLS segment-routing.
PTF is a framework for data plane testing: https://github.com/p4lang/PTF
We provide a Docker image with everything needed to run the PTF tests using the
BMv2 simple_switch_grpc
target.
Test cases are defined inside the directory tests/ptf/fabric.ptf
. To run the
tests use the following steps.
-
Install Docker on your machine.
-
Obtain the
fabric.p4
pre-compiled artifacts for BMv2 (bmv2.json
andp4info.txt
). These files are distributed with ONOS:git clone https://github.com/opennetworkinglab/onos
-
Set the
ONOS_ROOT
environment variable to the location where you just cloned the ONOS source:export ONOS_ROOT=<path-to-onos>
-
Run PTF tests:
./docker_run.sh <profile-or-test-case>
To learn more about fabric.p4 "profiles" check these instructions.
For example, to run all test cases for all profiles:
./docker_run.sh all
To run all test cases for the
fabric-spgw
profile:./docker_run.sh fabric-spgw
To run a specific test case against a specific fabric profile (or
all
), for exampletest.FabricBridgingTest
for the basicfabric
profile:./docker_run.sh fabric TEST=test.FabricBridgingTest
To run tests on targets other than BMv2 (e.g. Tofino), check the instructions
available inside the tests/ptf
directory.
All test cases are executed daily against the ONOS master branch using Travis CI. The current status is:
For help running the tests please write to the P4 Brigade mailing list:
https://groups.google.com/a/onosproject.org/forum/#!forum/brigade-p4