Skip to content

p4testgen producing incorrect STF test for p4c test program? #5130

Description

@jafingerhut

tmp.zip

In case the precise versions I am testing on make any difference here, the p4c source code I built was this:

commit 2776b1948529bc7e8ccfb2f6ea2a9c1ab1f68796 (HEAD, origin/main, origin/HEAD, main)
Author: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
Date:   Tue Jan 28 21:41:20 2025 -0500

Ubuntu 24.04 VM, x86_64

One of the bmv2 STF tests, in particular this one:

cd p4c/build
./testgen/testgen-p4c-bmv2-stf/gauntlet_hdr_out_in_action-bmv2.p4.test -v

caused an STF test to be created with a packet in that, when I look at the P4 program, should parse the entire packet as a header, and emit nothing, i.e. a 0-length packet with no headers and no unparsed payload data.

The STF test expects a 4-byte packet to come out. This seems like a bug in the STF test generated by p4testgen.

The attached zip file shows the p4testgen command, with all options I used, in the file cmd.sh file. The STF test that looks wrong is the one in that same zip file named gauntlet_hdr_out_in_action-bmv2_2.stf

I noticed the p4c test fail because some assertion in BMv2 code fired, causing simple_switch to abort, when it tried to send out a 0-length packet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p4toolsTopics related to the P4Tools back end

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions