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