interactive_remote_session - SSH Interactive Remote Session
Handler for an SSH session dedicated to interactive shells.
- class InteractiveRemoteSession
Bases:
object
SSH connection dedicated to interactive applications.
The connection is created using paramiko and is a persistent connection to the host. This class defines the methods for connecting to the node and configures the connection to send “keep alive” packets every 30 seconds. Because paramiko attempts to use SSH keys to establish a connection first, providing a password is optional. This session is utilized by InteractiveShells and cannot be interacted with directly.
- hostname
The hostname that will be used to initialize a connection to the node.
- Type:
str
- ip
A subsection of hostname that removes the port for the connection if there is one. If there is no port, this will be the same as hostname.
- Type:
str
- port
Port to use for the ssh connection. This will be extracted from hostname if there is a port included, otherwise it will default to
22
.- Type:
int
- username
User to connect to the node with.
- Type:
str
- password
Password of the user connecting to the host. This will default to an empty string if a password is not provided.
- Type:
str
- session
The underlying paramiko connection.
- Type:
paramiko.SSHClient
- Raises:
SSHConnectionError – There is an error creating the SSH connection.
- __init__(node_config: NodeConfiguration, logger: DTSLogger) None
Connect to the node during initialization.
- Parameters:
node_config (NodeConfiguration) – The test run configuration of the node to connect to.
logger (DTSLogger) – The logger instance this session will use.