/fabric-p4test

PTF-based data plane tests for ONOS fabric.p4

Primary LanguagePythonApache License 2.0Apache-2.0

PTF tests for ONOS fabric.p4

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

Run tests using BMv2 and Docker

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.

Steps

  1. Install Docker on your machine.

  2. Obtain the fabric.p4 pre-compiled artifacts for BMv2 (bmv2.json and p4info.txt). These files are distributed with ONOS:

    git clone https://github.com/opennetworkinglab/onos
    
  3. Set the ONOS_ROOT environment variable to the location where you just cloned the ONOS source:

    export ONOS_ROOT=<path-to-onos>
    
  4. 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 example test.FabricBridgingTest for the basic fabric profile:

    ./docker_run.sh fabric TEST=test.FabricBridgingTest
    

Run tests on other targets

To run tests on targets other than BMv2 (e.g. Tofino), check the instructions available inside the tests/ptf directory.

Status

All test cases are executed daily against the ONOS master branch using Travis CI. The current status is:

Build Status

Support

For help running the tests please write to the P4 Brigade mailing list:

https://groups.google.com/a/onosproject.org/forum/#!forum/brigade-p4