p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
670 stars 441 forks source link

P4TC is missing a push-button packet-test runner #4944

Open fruffy opened 1 week ago

fruffy commented 1 week ago

The BMv2 and eBPF test back ends have push-button test scripts such as run-bmv2-test.py or run-ebpf-test.py. These scripts allow sending a packet with a corresponding control-plane configuration and checking whether the resulting packet is as expected.

These push-button scripts can then be used by tools such as P4Testgen for automated compiler and target test. These scripts are also useful in showing how a particular target can be instrumented and used.

P4TC is missing such a script and workflow, which makes it harder to use or study. It would be great to add such a runner and extend run-tc-test.

@jhsmt

jhsmt commented 1 week ago

On Fri, Oct 4, 2024 at 2:50 PM Fabian Ruffy @.***> wrote:

The BMv2 and eBPF test back ends have push-button test scripts such as run-bmv2-test.py or run-ebpf-test.py. These scripts allow sending a packet with a corresponding control-plane configuration and checking whether the resulting packet is as expected.

These push-button scripts can then be used by tools such as P4Testgen for automated compiler and target test. These scripts are also useful in showing how a particular target can be instrumented and used.

P4TC is missing such a script and workflow, which makes it harder to use or study. It would be great to add such a runner and extend run-tc-test https://github.com/p4lang/p4c/blob/main/backends/tc/run-tc-test.py.

@jhsmt https://github.com/jhsmt

@Victor Nogueira @.***> @vbnogueira please look at this. Seems like something simple like arp responder maybe useful to kick it?

cheers, jamal

Message ID: @.***>

vbnogueira commented 1 week ago

@victor Nogueira @.***> @vbnogueira please look at this. Seems like something simple like arp responder maybe useful to kick it? cheers, jamal

Yes, I think arp responder could be an initial example I'll look and sync with Komal on this