node - Base Node

Common functionality for node management.

A node is any host/server DTS connects to.

The base class, Node, provides features common to all nodes and is supposed to be extended by subclasses with features specific to each node type. The skip_setup() decorator can be used without subclassing.

class Node

Bases: ABC

The base class for node management.

It shouldn’t be instantiated, but rather subclassed. It implements common methods to manage any node:

  • Connection to the node,

  • Hugepages setup.

main_session

The primary OS-aware remote session used to communicate with the node.

Type:

framework.testbed_model.os_session.OSSession

config

The node configuration.

Type:

framework.config.NodeConfiguration

name

The name of the node.

Type:

str

lcores

The list of logical cores that DTS can use on the node. It’s derived from logical cores present on the node and the test run configuration.

Type:

list[framework.testbed_model.cpu.LogicalCore]

ports

The ports of this node specified in the test run configuration.

Type:

list[framework.testbed_model.port.Port]

__init__(node_config: NodeConfiguration)

Connect to the node and gather info during initialization.

Extra gathered information:

  • The list of available logical CPUs. This is then filtered by the lcores configuration in the YAML test run configuration file,

  • Information about ports from the YAML test run configuration file.

Parameters:

node_config (NodeConfiguration) – The node’s test run configuration.

set_up_test_run(test_run_config: TestRunConfiguration, dpdk_build_config: framework.config.DPDKPrecompiledBuildConfiguration | framework.config.DPDKUncompiledBuildConfiguration) None

Test run setup steps.

Configure hugepages on all DTS node types. Additional steps can be added by extending the method in subclasses with the use of super().

Parameters:
tear_down_test_run() None

Test run teardown steps.

There are currently no common execution teardown steps common to all DTS node types. Additional steps can be added by extending the method in subclasses with the use of super().

create_session(name: str) OSSession

Create and return a new OS-aware remote session.

The returned session won’t be used by the node creating it. The session must be used by the caller. The session will be maintained for the entire lifecycle of the node object, at the end of which the session will be cleaned up automatically.

Note

Any number of these supplementary sessions may be created.

Parameters:

name (str) – The name of the session.

Returns:

A new OS-aware remote session.

Return type:

OSSession

filter_lcores(filter_specifier: framework.testbed_model.cpu.LogicalCoreCount | framework.testbed_model.cpu.LogicalCoreList, ascending: bool = True) list[framework.testbed_model.cpu.LogicalCore]

Filter the node’s logical cores that DTS can use.

Logical cores that DTS can use are the ones that are present on the node, but filtered according to the test run configuration. The filter_specifier will filter cores from those logical cores.

Parameters:
  • filter_specifier (framework.testbed_model.cpu.LogicalCoreCount | framework.testbed_model.cpu.LogicalCoreList) – Two different filters can be used, one that specifies the number of logical cores per core, cores per socket and the number of sockets, and another one that specifies a logical core list.

  • ascending (bool) – If True, use cores with the lowest numerical id first and continue in ascending order. If False, start with the highest id and continue in descending order. This ordering affects which sockets to consider first as well.

Returns:

The filtered logical cores.

Return type:

list[framework.testbed_model.cpu.LogicalCore]

close() None

Close all connections and free other resources.

create_session(node_config: NodeConfiguration, name: str, logger: DTSLogger) OSSession

Factory for OS-aware sessions.

Parameters:
  • node_config (NodeConfiguration) – The test run configuration of the node to connect to.

  • name (str) – The name of the session.

  • logger (DTSLogger) – The logger instance this session will use.