capabilities - SUT Capabilities

Testbed capabilities.

This module provides a protocol that defines the common attributes of test cases and suites and support for test environment capabilities.

Many test cases are testing features not available on all hardware. On the other hand, some test cases or suites may not need the most complex topology available.

The module allows developers to mark test cases or suites to require certain hardware capabilities or a particular topology.

There are differences between hardware and topology capabilities:

  • Hardware capabilities are assumed to not be required when not specified.

  • However, some topology is always available, so each test case or suite is assigned a default topology if no topology is specified in the decorator.

Examples

from framework.test_suite import TestSuite, func_test
from framework.testbed_model.capability import LinkTopology, requires_link_topology
# The whole test suite (each test case within) doesn't require any links.
@requires_link_topology(LinkTopology.NO_LINK)
@func_test
class TestHelloWorld(TestSuite):
    def hello_world_single_core(self):
    ...
from framework.test_suite import TestSuite, func_test
from framework.testbed_model.capability import NicCapability, requires_nic_capability
class TestPmdBufferScatter(TestSuite):
    # only the test case requires the SCATTERED_RX_ENABLED capability
    # other test cases may not require it
    @requires_nic_capability(NicCapability.SCATTERED_RX_ENABLED)
    @func_test
    def test_scatter_mbuf_2048(self):
class LinkTopology

Bases: IntEnum

Supported topology types.

A topology with no Traffic Generator.

A topology with one physical link between the SUT node and the TG node.

A topology with two physical links between the Sut node and the TG node.

classmethod default() LinkTopology

The default topology required by test cases if not specified otherwise.

__new__(value)
class NicCapability

Bases: IntEnum

DPDK NIC capabilities.

The capabilities are used to mark test cases or suites that require a specific DPDK NIC capability to run. The capabilities are used by the test framework to determine whether a test case or suite can be run on the current testbed.

SCATTERED_RX_ENABLED = 0

Scattered packets Rx enabled.

RX_OFFLOAD_VLAN_STRIP = 1

Device supports VLAN stripping.

RX_OFFLOAD_IPV4_CKSUM = 2

Device supports L3 checksum offload.

RX_OFFLOAD_UDP_CKSUM = 3

Device supports L4 checksum offload.

RX_OFFLOAD_TCP_CKSUM = 4

Device supports L4 checksum offload.

RX_OFFLOAD_TCP_LRO = 5

Device supports Large Receive Offload.

RX_OFFLOAD_QINQ_STRIP = 6

Device supports QinQ (queue in queue) offload.

RX_OFFLOAD_OUTER_IPV4_CKSUM = 7

Device supports inner packet L3 checksum.

RX_OFFLOAD_MACSEC_STRIP = 8

Device supports MACsec.

RX_OFFLOAD_VLAN_FILTER = 9

Device supports filtering of a VLAN Tag identifier.

RX_OFFLOAD_VLAN_EXTEND = 10

Device supports VLAN offload.

RX_OFFLOAD_SCATTER = 11

Device supports receiving segmented mbufs.

RX_OFFLOAD_TIMESTAMP = 12

Device supports Timestamp.

RX_OFFLOAD_SECURITY = 13

Device supports crypto processing while packet is received in NIC.

RX_OFFLOAD_KEEP_CRC = 14

Device supports CRC stripping.

RX_OFFLOAD_SCTP_CKSUM = 15

Device supports L4 checksum offload.

RX_OFFLOAD_OUTER_UDP_CKSUM = 16

Device supports inner packet L4 checksum.

RX_OFFLOAD_RSS_HASH = 17

Device supports RSS hashing.

RX_OFFLOAD_BUFFER_SPLIT = 18

Device supports scatter Rx packets to segmented mbufs.

RX_OFFLOAD_CHECKSUM = 19

Device supports all checksum capabilities.

RX_OFFLOAD_VLAN = 20

Device supports all VLAN capabilities.

RUNTIME_RX_QUEUE_SETUP = 21

Device supports Rx queue setup after device started.

RUNTIME_TX_QUEUE_SETUP = 22

Device supports Tx queue setup after device started.

RXQ_SHARE = 23

Device supports shared Rx queue among ports within Rx domain and switch domain.

FLOW_RULE_KEEP = 24

Device supports keeping flow rules across restart.

FLOW_SHARED_OBJECT_KEEP = 25

Device supports keeping shared flow objects across restart.

MCAST_FILTERING = 26

Device supports multicast address filtering.

FLOW_CTRL = 27

Device supports flow ctrl.

PHYSICAL_FUNCTION = 28

Device is running on a physical function.

__new__(value)

Decorator to set required topology type for a test case or test suite.

Parameters:

link_topology (LinkTopology) – The topology type the test suite or case requires.

Returns:

The decorated test case or test suite.

Return type:

Callable[[type[‘TestProtocol’]], type[‘TestProtocol’]]

requires_nic_capability(nic_capability: NicCapability) Callable[[type['TestProtocol']], type['TestProtocol']]

Decorator to add a single required NIC capability to a test case or test suite.

Parameters:

nic_capability (NicCapability) – The NIC capability that is required by the test case or test suite.

Returns:

The decorated test case or test suite.

Return type:

Callable[[type[‘TestProtocol’]], type[‘TestProtocol’]]