Charles Chan | fcfe890 | 2022-02-02 17:06:27 -0800 | [diff] [blame] | 1 | .. SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org> |
| 2 | .. SPDX-License-Identifier: Apache-2.0 |
| 3 | |
Yi Tseng | 1da30b6 | 2021-09-30 17:39:14 -0700 | [diff] [blame] | 4 | P4 Pipeline Tests (PTF) |
| 5 | ======================= |
| 6 | |
| 7 | `PTF <https://github.com/p4lang/PTF>`_ is a Python based data plane test framework. |
| 8 | It is based on unittest, which is included in the standard Python distribution. |
| 9 | |
| 10 | To test the P4 pipeline, we are using the following components: |
| 11 | |
| 12 | * PTF framework and tests |
| 13 | |
| 14 | * Installs table entries to the device. |
| 15 | * Generate and verify the traffic. |
| 16 | |
| 17 | * Stratum: the software that process P4Runtime requests from PTF and configures the device. |
| 18 | * The device under tests: can be software device like Tofino Model, or a hardware device. |
| 19 | * TRex server: for the line rate test. |
| 20 | |
| 21 | .. image:: ../images/pipeline-test-arch.svg |
| 22 | :width: 800px |
| 23 | |
| 24 | Test plans |
| 25 | ---------- |
| 26 | |
| 27 | See `test plans <https://github.com/stratum/fabric-tna/tree/main/ptf#the-unary-test-plan>`_ section in the fabric-TNA repository |
| 28 | |
| 29 | Run tests |
| 30 | --------- |
| 31 | |
| 32 | See `step to run tests <https://github.com/stratum/fabric-tna/tree/main/ptf#steps-to-run-tests-on-tofino-model-with-stratum>`_ |
| 33 | section in the Fabric-TNA repository. |
| 34 | |
| 35 | Test result |
| 36 | ----------- |
| 37 | |
| 38 | See `test result <https://github.com/stratum/fabric-tna/tree/main/ptf#test-result>`_ |
| 39 | section in the Fabric-TNA repository. |
| 40 | |
| 41 | |
| 42 | Contribute new test cases |
| 43 | ------------------------- |
| 44 | |
| 45 | See `contribute new test cases <https://github.com/stratum/fabric-tna/tree/main/ptf#contribute-new-test-cases>`_ |
| 46 | section in the Fabric-TNA repository. |