opennetworkinglab / tassen

Next-generation BNG CUPS API based on P4Runtime, gNMI, and OpenConfig
Apache License 2.0
1 stars 1 forks source link

Run p4pktgen on bng.p4 to automatically generate test cases #10

Open ccascone opened 4 years ago

ccascone commented 4 years ago

https://github.com/p4pktgen/p4pktgen

Can be used to uncover bugs in translation logic

daniele-moro commented 4 years ago

Here some insights from a preliminary run of p4pktgen on bng.p4. Some modifications to the logical pipeline are needed:

Some other functionalities are not supported such as counters (for example we can't test the accounting functionality with p4pktgen), more information here: https://github.com/p4pktgen/p4pktgen/blob/master/docs/p4-language-feature-support.md

To run p4pktgen I built a Docker container from the p4lang/behavioral-model installing few other dependencies and then running the install script provided with the project. I still haven't managed to run p4pktgen completely.

ccascone commented 4 years ago

Regarding action_profiles, I think we could disable that by using a preprocessor flag (around lines 481-483 ) just for the sake of running p4pktgen. Then, we could post-process the auto-generated tests to create action profile group/member insertions equivalent to the action used in the test cases (i.e., a group with only one member).

daniele-moro commented 4 years ago

I've done as you suggested for action_profiles, plus I added some modifications to the bng.p4 pipeline. PTF tests correctly pass with the bng.p4 modifications.

Regarding p4pktgen, right now it runs and starts to generate test cases. But at some point, I got an exception and I'm not able to understand the reasons why it's happening (if it's bng.p4 problem or p4pktgen issue). This can be reproduced running make p4pktgen from util/p4pktgen folder. p4pktgen log is in util/p4pktgen/log.txt.