port_control Test Suite

Port Control Testing Suite.

This test suite serves to show that ports within testpmd support basic configuration functions. Things such as starting a port, stopping a port, and closing a port should all be supported by the device. Additionally, after each of these configuration steps (outside of closing the port) it should still be possible to start the port again and verify that the port is able to forward a large amount of packets (100 are sent in the test cases).

class TestPortControl

Bases: TestSuite

DPDK Port Control Testing Suite.

send_packets_and_verify() None

Send 100 packets and verify that all packets were forwarded back.

Packets sent are identical and are all ethernet frames with a payload of 30 “X” characters. This payload is used to differentiate noise on the wire from packets sent by this framework.

test_start_ports() None

Start all ports and send a small number of packets.

Steps:

Start all ports Start forwarding in MAC mode Send 100 generic packets to the SUT

Verify:

Check that all the packets sent are sniffed on the TG receive port.

test_stop_ports() None

Stop all ports, then start all ports, amd then send a small number of packets.

Steps:

Stop all ports Start all ports Start forwarding in MAC mode Send 100 generic packets to the SUT

Verify:

Check that stopping the testpmd ports brings down their links Check that all the packets sent are sniffed on the TG receive port.

test_close_ports() None

Close all the ports via testpmd.

Steps:

Close all the testpmd ports

Verify:

Check that testpmd no longer reports having any ports

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

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