config - Configuration Package

Testbed configuration and test suite specification.

This package offers classes that hold real-time information about the testbed, hold test run configuration describing the tested testbed and a loader function, load_config(), which loads the YAML configuration files and validates them against the Configuration Pydantic model, which fields are directly mapped.

The configuration files are split in:

  • A list of test run which are represented by TestRunConfiguration defining what tests are going to be run and how DPDK will be built. It also references the testbed where these tests and DPDK are going to be run,

  • A list of the nodes of the testbed which ar represented by NodeConfiguration.

The real-time information about testbed is supposed to be gathered at runtime.

The classes defined in this package make heavy use of pydantic. Nearly all of them are frozen:

  • Frozen makes the object immutable. This enables further optimizations, and makes it thread safe should we ever want to move in that direction.

class Configuration

Bases: FrozenModel

DTS testbed and test configuration.

test_runs: list[framework.config.test_run.TestRunConfiguration]

Test run configurations.

nodes: list[framework.config.node.NodeConfiguration]

Node configurations.

validate_node_names() typing_extensions.Self

Validate that the node names are unique.

Validate that all the test runs’ port links are valid.

validate_test_runs_against_nodes() typing_extensions.Self

Validate the test runs to nodes associations.

load_config(ctx: ValidationContext) Configuration

Load the DTS configuration from files.

Load the YAML configuration files, validate them, and create a configuration object.

Parameters:

ctx (ValidationContext) – The context required for validation.

Returns:

The parsed test run configuration.

Raises:

ConfigurationError – If the supplied configuration files are invalid.

Return type:

Configuration