remote_session - Node Connections Package

Remote interactive and non-interactive sessions.

This package provides modules for managing remote connections to a remote host (node).

The non-interactive sessions send commands and return their output and exit code.

The interactive sessions open an interactive shell which is continuously open, allowing it to send and receive data within that particular shell.

create_remote_session(node_config: NodeConfiguration, name: str, logger: DTSLogger) RemoteSession

Factory for non-interactive remote sessions.

The function returns an SSH session, but will be extended if support for other protocols is added.

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.

Returns:

The SSH remote session.

Return type:

RemoteSession

create_interactive_session(node_config: NodeConfiguration, logger: DTSLogger) InteractiveRemoteSession

Factory for interactive remote sessions.

The function returns an interactive SSH session, but will be extended if support for other protocols is added.

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

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

Returns:

The interactive SSH remote session.

Return type:

InteractiveRemoteSession