softnic Test Suite

Softnic test suite.

Create a softnic virtual device and verify it successfully forwards packets.

class TestSoftnic

Bases: TestSuite

Softnic test suite.

NUMBER_OF_PACKETS_TO_SEND = 10

The total number of packets to generate and send for forwarding.

PAYLOAD_SIZE = 100

The payload size to use for the generated packets in bytes.

set_up_suite() → None

Set up the test suite.

Setup:

Generate the random packets that will be sent and create the softnic config files.

prepare_softnic_files() → PurePath

Creates the config files that are required for the creation of the softnic.

The config files are created at runtime to accommodate paths and device addresses.

softnic() → None

Softnic test.

Steps:

Start Testpmd with a softnic vdev using the provided config files. Testpmd forwarding is disabled, instead configure softnic to forward packets from port 0 to port 1 of the physical device. Send generated packets from the TG.

Verify:

The packets that are received are the same as the packets sent.

required_capabilities: ClassVar[set[Capability]] = {NicCapability.PHYSICAL_FUNCTION}

The capabilities the test case or suite requires in order to be executed.