blob: ca8cb87d88ccad917aa6757c59f2df1c73b6262a [file] [log] [blame]
.. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
.. SPDX-License-Identifier: Apache-2.0
P4 Pipeline Tests (PTF)
=======================
`PTF <https://github.com/p4lang/PTF>`_ is a Python based data plane test framework.
It is based on unittest, which is included in the standard Python distribution.
To test the P4 pipeline, we are using the following components:
* PTF framework and tests
* Installs table entries to the device.
* Generate and verify the traffic.
* Stratum: the software that process P4Runtime requests from PTF and configures the device.
* The device under tests: can be software device like Tofino Model, or a hardware device.
* TRex server: for the line rate test.
.. image:: ../images/pipeline-test-arch.svg
:width: 800px
Test plans
----------
See `test plans <https://github.com/stratum/fabric-tna/tree/main/ptf#user-content-the-unary-test-plan>`_ section in the fabric-TNA repository
Run tests
---------
See `step to run tests <https://github.com/stratum/fabric-tna/tree/main/ptf#user-content-steps-to-run-tests-on-tofino-model-with-stratum>`_
section in the Fabric-TNA repository.
Test result
-----------
See `test result <https://github.com/stratum/fabric-tna/tree/main/ptf#user-content-test-result>`_
section in the Fabric-TNA repository.
Contribute new test cases
-------------------------
See `contribute new test cases <https://github.com/stratum/fabric-tna/tree/main/ptf#user-content-contribute-new-test-cases>`_
section in the Fabric-TNA repository.