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: object

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.node.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.

property ports_by_name: dict[str, framework.testbed_model.port.Port]

Ports mapped by the name assigned at configuration.

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

property node_info: OSSessionInfo

Additional node information.

property compiler_version: str | None

The node’s compiler version.

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.

Raises:

ConfigurationError – If the node’s OS is unsupported.