Robot Framework SSH Library
SSHLibrary.abstractclient.AbstractSSHClient Class Reference

Base class for the SSH client implementation. More...

Inheritance diagram for SSHLibrary.abstractclient.AbstractSSHClient:
SSHLibrary.javaclient.JavaSSHClient SSHLibrary.pythonclient.PythonSSHClient

Public Member Functions

def __init__ (self, host, alias=None, port=22, timeout=3, newline='LF', prompt=None, term_type='vt100', width=80, height=24, path_separator='/', encoding='utf8', escape_ansi=False, encoding_errors='strict')
 
def close (self)
 Closes the connection. More...
 
def login (self, username=None, password=None, allow_agent=False, look_for_keys=False, delay=None, proxy_cmd=None, read_config=False, jumphost_connection=None, keep_alive_interval='0 seconds')
 Logs into the remote host using password authentication. More...
 
def login_with_public_key (self, username, keyfile, password, allow_agent=False, look_for_keys=False, delay=None, proxy_cmd=None, jumphost_connection=None, read_config=False, keep_alive_interval='0 seconds')
 Logs into the remote host using the public key authentication. More...
 
def get_banner (self)
 
def execute_command (self, command, sudo=False, sudo_password=None, timeout=None, output_during_execution=False, output_if_timeout=False, invoke_subsystem=False, forward_agent=False)
 Executes the command on the remote host. More...
 
def start_command (self, command, sudo=False, sudo_password=None, invoke_subsystem=False, forward_agent=False)
 Starts the execution of the command on the remote host. More...
 
def read_command_output (self, timeout=None, output_during_execution=False, output_if_timeout=False)
 Reads the output of the previous started command. More...
 
def write (self, text, add_newline=False)
 Writes text in the current shell. More...
 
def read (self, delay=None)
 Reads all output available in the current shell. More...
 
def read_char (self)
 Reads a single Unicode character from the current shell. More...
 
def read_until (self, expected)
 Reads output from the current shell until the expected text is encountered or the timeout expires. More...
 
def read_until_newline (self)
 Reads output from the current shell until a newline character is encountered or the timeout expires. More...
 
def read_until_prompt (self, strip_prompt=False)
 Reads output from the current shell until the prompt is encountered or the timeout expires. More...
 
def read_until_regexp (self, regexp)
 Reads output from the current shell until the regexp matches or the timeout expires. More...
 
def read_until_regexp_with_prefix (self, regexp, prefix)
 Read and return from output until regexp matches prefix + output. More...
 
def write_until_expected (self, text, expected, timeout, interval)
 Writes text repeatedly in the current shell until the expected appears in the output or the timeout expires. More...
 
def put_file (self, source, destination='.', mode='0o744', newline='', scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.put_file` with the given arguments. More...
 
def put_directory (self, source, destination='.', mode='0o744', newline='', recursive=False, scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.put_directory with the given arguments and the connection specific path separator. More...
 
def get_file (self, source, destination='.', scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.get_file with the given arguments. More...
 
def get_directory (self, source, destination='.', recursive=False, scp='OFF', scp_preserve_times=False)
 Calls :py:meth:AbstractSFTPClient.get_directory with the given arguments and the connection specific path separator. More...
 
def list_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:.AbstractSFTPClient.list_dir with the given arguments. More...
 
def list_files_in_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:AbstractSFTPClient.list_files_in_dir with the given arguments. More...
 
def list_dirs_in_dir (self, path, pattern=None, absolute=False)
 Calls :py:meth:AbstractSFTPClient.list_dirs_in_dir with the given arguments. More...
 
def is_dir (self, path)
 Calls :py:meth:AbstractSFTPClient.is_dir with the given path. More...
 
def is_file (self, path)
 Calls :py:meth:AbstractSFTPClient.is_file with the given path. More...
 

Static Public Member Functions

def enable_logging (path)
 Enables logging of SSH events to a file. More...
 
def get_banner_without_login (host, port=22)
 

Public Attributes

 config
 
 client
 
 width
 
 height
 

Properties

 sftp_client = property
 Gets the SFTP client for the connection. More...
 
 scp_transfer_client = property
 Gets the SCP client for the file transfer. More...
 
 scp_all_client = property
 Gets the SCP client for the file transfer. More...
 
 shell = property
 Gets the shell for the connection. More...
 

Private Member Functions

def _get_client (self)
 
def sftp_client (self)
 
def scp_transfer_client (self)
 
def scp_all_client (self)
 
def shell (self)
 
def _create_sftp_client (self)
 
def _create_scp_transfer_client (self)
 
def _create_scp_all_client (self)
 
def _create_shell (self)
 
def _encode (self, text)
 
def _decode (self, bytes)
 
def _login (self, username, password, allow_agent, look_for_keys, proxy_cmd, read_config, jumphost_connection, keep_alive_interval)
 
def _read_login_output (self, delay)
 
def _verify_key_file (self, keyfile)
 
def _login_with_public_key (self, username, keyfile, password, allow_agent, look_for_keys, proxy_cmd, jumphost_index_or_alias, read_config, keep_alive_interval)
 
def _start_command (self, command, sudo=False, sudo_password=None, invoke_subsystem=False, forward_agent=False)
 
def _delayed_read (self, delay)
 
def _read_until (self, matcher, expected, timeout=None)
 
def _strip_prompt (self, output)
 
def _get_files_for_scp_all (self, source)
 
def _create_client (self, scp)
 

Private Attributes

 _sftp_client
 
 _scp_transfer_client
 
 _scp_all_client
 
 _shell
 
 _started_commands
 

Detailed Description

Base class for the SSH client implementation.

This class defines the public API. Subclasses (:py:class:`pythonclient.
PythonSSHClient` and :py:class:`javaclient.JavaSSHClient`) provide the
language specific concrete implementations.

Definition at line 64 of file abstractclient.py.

Constructor & Destructor Documentation

◆ __init__()

def SSHLibrary.abstractclient.AbstractSSHClient.__init__ (   self,
  host,
  alias = None,
  port = 22,
  timeout = 3,
  newline = 'LF',
  prompt = None,
  term_type = 'vt100',
  width = 80,
  height = 24,
  path_separator = '/',
  encoding = 'utf8',
  escape_ansi = False,
  encoding_errors = 'strict' 
)

Definition at line 65 of file abstractclient.py.

Member Function Documentation

◆ _create_client()

def SSHLibrary.abstractclient.AbstractSSHClient._create_client (   self,
  scp 
)
private

Definition at line 766 of file abstractclient.py.

◆ _create_scp_all_client()

def SSHLibrary.abstractclient.AbstractSSHClient._create_scp_all_client (   self)
private

◆ _create_scp_transfer_client()

def SSHLibrary.abstractclient.AbstractSSHClient._create_scp_transfer_client (   self)
private

◆ _create_sftp_client()

def SSHLibrary.abstractclient.AbstractSSHClient._create_sftp_client (   self)
private

◆ _create_shell()

def SSHLibrary.abstractclient.AbstractSSHClient._create_shell (   self)
private

◆ _decode()

def SSHLibrary.abstractclient.AbstractSSHClient._decode (   self,
  bytes 
)
private

Definition at line 233 of file abstractclient.py.

◆ _delayed_read()

def SSHLibrary.abstractclient.AbstractSSHClient._delayed_read (   self,
  delay 
)
private

Definition at line 432 of file abstractclient.py.

◆ _encode()

def SSHLibrary.abstractclient.AbstractSSHClient._encode (   self,
  text 
)
private

Definition at line 226 of file abstractclient.py.

◆ _get_client()

def SSHLibrary.abstractclient.AbstractSSHClient._get_client (   self)
private

◆ _get_files_for_scp_all()

def SSHLibrary.abstractclient.AbstractSSHClient._get_files_for_scp_all (   self,
  source 
)
private

Definition at line 668 of file abstractclient.py.

◆ _login()

def SSHLibrary.abstractclient.AbstractSSHClient._login (   self,
  username,
  password,
  allow_agent,
  look_for_keys,
  proxy_cmd,
  read_config,
  jumphost_connection,
  keep_alive_interval 
)
private

◆ _login_with_public_key()

def SSHLibrary.abstractclient.AbstractSSHClient._login_with_public_key (   self,
  username,
  keyfile,
  password,
  allow_agent,
  look_for_keys,
  proxy_cmd,
  jumphost_index_or_alias,
  read_config,
  keep_alive_interval 
)
private

◆ _read_login_output()

def SSHLibrary.abstractclient.AbstractSSHClient._read_login_output (   self,
  delay 
)
private

Definition at line 240 of file abstractclient.py.

◆ _read_until()

def SSHLibrary.abstractclient.AbstractSSHClient._read_until (   self,
  matcher,
  expected,
  timeout = None 
)
private

Definition at line 481 of file abstractclient.py.

◆ _start_command()

def SSHLibrary.abstractclient.AbstractSSHClient._start_command (   self,
  command,
  sudo = False,
  sudo_password = None,
  invoke_subsystem = False,
  forward_agent = False 
)
private

◆ _strip_prompt()

def SSHLibrary.abstractclient.AbstractSSHClient._strip_prompt (   self,
  output 
)
private

Definition at line 540 of file abstractclient.py.

◆ _verify_key_file()

def SSHLibrary.abstractclient.AbstractSSHClient._verify_key_file (   self,
  keyfile 
)
private

Definition at line 304 of file abstractclient.py.

◆ close()

def SSHLibrary.abstractclient.AbstractSSHClient.close (   self)

Closes the connection.

Reimplemented in SSHLibrary.pythonclient.PythonSSHClient.

Definition at line 161 of file abstractclient.py.

◆ enable_logging()

def SSHLibrary.abstractclient.AbstractSSHClient.enable_logging (   path)
static

Enables logging of SSH events to a file.

    :param str path: Path to the file the log is written to.

    :returns: `True`, if logging was successfully enabled. False otherwise.

Reimplemented in SSHLibrary.pythonclient.PythonSSHClient, and SSHLibrary.javaclient.JavaSSHClient.

Definition at line 90 of file abstractclient.py.

◆ execute_command()

def SSHLibrary.abstractclient.AbstractSSHClient.execute_command (   self,
  command,
  sudo = False,
  sudo_password = None,
  timeout = None,
  output_during_execution = False,
  output_if_timeout = False,
  invoke_subsystem = False,
  forward_agent = False 
)

Executes the command on the remote host.

    This method waits until the output triggered by the execution of the
    `command` is available and then returns it.

    The `command` is always executed in a new shell, meaning that changes to
    the environment are not visible to the subsequent calls of this method.

    :param str command: The command to be executed on the remote host.

    :param sudo
     and
    :param sudo_password are used for executing commands within a sudo session.

    :param invoke_subsystem will request a subsystem on the server.

    :returns: A 3-tuple (stdout, stderr, return_code) with values
        `stdout` and `stderr` as strings and `return_code` as an integer.

Definition at line 344 of file abstractclient.py.

◆ get_banner()

def SSHLibrary.abstractclient.AbstractSSHClient.get_banner (   self)

Reimplemented in SSHLibrary.pythonclient.PythonSSHClient.

Definition at line 322 of file abstractclient.py.

◆ get_banner_without_login()

def SSHLibrary.abstractclient.AbstractSSHClient.get_banner_without_login (   host,
  port = 22 
)
static

Reimplemented in SSHLibrary.pythonclient.PythonSSHClient.

Definition at line 319 of file abstractclient.py.

◆ get_directory()

def SSHLibrary.abstractclient.AbstractSSHClient.get_directory (   self,
  source,
  destination = '.',
  recursive = False,
  scp = 'OFF',
  scp_preserve_times = False 
)

Calls :py:meth:AbstractSFTPClient.get_directory with the given arguments and the connection specific path separator.

The connection specific path separator is set when calling :py:meth:open_connection.

See :py:meth:AbstractSFTPClient.get_directory for more documentation.

Definition at line 682 of file abstractclient.py.

◆ get_file()

def SSHLibrary.abstractclient.AbstractSSHClient.get_file (   self,
  source,
  destination = '.',
  scp = 'OFF',
  scp_preserve_times = False 
)

Calls :py:meth:AbstractSFTPClient.get_file with the given arguments.

See :py:meth:AbstractSFTPClient.get_file for more documentation.

Definition at line 661 of file abstractclient.py.

◆ is_dir()

def SSHLibrary.abstractclient.AbstractSSHClient.is_dir (   self,
  path 
)

Calls :py:meth:AbstractSFTPClient.is_dir with the given path.

    :param str path: Path to check for directory. Supports GLOB Patterns.

    :returns: Boolean indicating is the directory is present or not.

    :rtype: bool

    See :py:meth:`AbstractSFTPClient.is_dir` for more documentation.

Definition at line 735 of file abstractclient.py.

◆ is_file()

def SSHLibrary.abstractclient.AbstractSSHClient.is_file (   self,
  path 
)

Calls :py:meth:AbstractSFTPClient.is_file with the given path.

    :param str path: Path to check for file. Supports GLOB Patterns.

    :returns: Boolean indicating is the file is present or not.

    :rtype: bool

    See :py:meth:`AbstractSFTPClient.is_file` for more documentation.

Definition at line 755 of file abstractclient.py.

◆ list_dir()

def SSHLibrary.abstractclient.AbstractSSHClient.list_dir (   self,
  path,
  pattern = None,
  absolute = False 
)

Calls :py:meth:.AbstractSFTPClient.list_dir with the given arguments.

See :py:meth:AbstractSFTPClient.list_dir for more documentation.

:returns: A sorted list of items returned by :py:meth:AbstractSFTPClient.list_dir.

Definition at line 697 of file abstractclient.py.

◆ list_dirs_in_dir()

def SSHLibrary.abstractclient.AbstractSSHClient.list_dirs_in_dir (   self,
  path,
  pattern = None,
  absolute = False 
)

Calls :py:meth:AbstractSFTPClient.list_dirs_in_dir with the given arguments.

See :py:meth:AbstractSFTPClient.list_dirs_in_dir for more documentation.

:returns: A sorted list of items returned by :py:meth:AbstractSFTPClient.list_dirs_in_dir.

Definition at line 721 of file abstractclient.py.

◆ list_files_in_dir()

def SSHLibrary.abstractclient.AbstractSSHClient.list_files_in_dir (   self,
  path,
  pattern = None,
  absolute = False 
)

Calls :py:meth:AbstractSFTPClient.list_files_in_dir with the given arguments.

See :py:meth:AbstractSFTPClient.list_files_in_dir for more documentation.

:returns: A sorted list of items returned by :py:meth:AbstractSFTPClient.list_files_in_dir.

Definition at line 709 of file abstractclient.py.

◆ login()

def SSHLibrary.abstractclient.AbstractSSHClient.login (   self,
  username = None,
  password = None,
  allow_agent = False,
  look_for_keys = False,
  delay = None,
  proxy_cmd = None,
  read_config = False,
  jumphost_connection = None,
  keep_alive_interval = '0 seconds' 
)

Logs into the remote host using password authentication.

    This method reads the output from the remote host after logging in,
    thus clearing the output. If prompt is set, everything until the prompt
    is read (using :py:meth:`read_until_prompt` internally).
    Otherwise everything on the output is read with the specified `delay`
    (using :py:meth:`read` internally).

    :param keep_alive_interval: Set the transport keepalive interval.

    :param str username: Username to log in with.

    :param str password: Password for the `username`.

    :param bool allow_agent: enables the connection to the SSH agent.
        This option does not work when using Jython.

    :param bool look_for_keys: Whether the login method should look for
        available public keys for login. This will also enable ssh agent.
        This option is ignored when using Jython.

    :param str proxy_cmd: Proxy command
    :param str delay: The `delay` passed to :py:meth:`read` for reading
        the output after logging in. The delay is only effective if
        the prompt is not set.

    :param read_config: reads or ignores host entries from ``~/.ssh/config`` file. This parameter will read the hostname,
    port number, username and proxy command.

    :param PythonSSHClient jumphost_connection : An instance of
        PythonSSHClient that will be used as an intermediary jump-host
        for the SSH connection being attempted.

    :raises SSHClientException: If logging in failed.

    :returns: The read output from the server.

Definition at line 209 of file abstractclient.py.

◆ login_with_public_key()

def SSHLibrary.abstractclient.AbstractSSHClient.login_with_public_key (   self,
  username,
  keyfile,
  password,
  allow_agent = False,
  look_for_keys = False,
  delay = None,
  proxy_cmd = None,
  jumphost_connection = None,
  read_config = False,
  keep_alive_interval = '0 seconds' 
)

Logs into the remote host using the public key authentication.

    This method reads the output from the remote host after logging in,
    thus clearing the output. If prompt is set, everything until the prompt
    is read (using :py:meth:`read_until_prompt` internally).
    Otherwise everything on the output is read with the specified `delay`
    (using :py:meth:`read` internally).

    :param str username: Username to log in with.

    :param str keyfile: Path to the valid OpenSSH private key file.

    :param str password: Password (if needed) for unlocking the `keyfile`.

    :param boolean allow_agent: enables the connection to the SSH agent.
        This option does not work when using Jython.

    :param boolean look_for_keys: enables the searching for discoverable
        private key files in ~/.ssh/. This option also does not work when
        using Jython.

    :param str delay: The `delay` passed to :py:meth:`read` for reading
        the output after logging in. The delay is only effective if
        the prompt is not set.

    :param str proxy_cmd : Proxy command

    :param PythonSSHClient jumphost_connection : An instance of
        PythonSSHClient that is will be used as an intermediary jump-host
        for the SSH connection being attempted.

    :param read_config: reads or ignores entries from ``~/.ssh/config`` file. This parameter will read the hostname,
    port number, username, identity file and proxy command.

    :raises SSHClientException: If logging in failed.

    :returns: The read output from the server.

Definition at line 285 of file abstractclient.py.

◆ put_directory()

def SSHLibrary.abstractclient.AbstractSSHClient.put_directory (   self,
  source,
  destination = '.',
  mode = '0o744',
  newline = '',
  recursive = False,
  scp = 'OFF',
  scp_preserve_times = False 
)

Calls :py:meth:AbstractSFTPClient.put_directory with the given arguments and the connection specific path separator.

The connection specific path separator is set when calling :py:meth:open_connection.

See :py:meth:AbstractSFTPClient.put_directory for more documentation.

Definition at line 650 of file abstractclient.py.

◆ put_file()

def SSHLibrary.abstractclient.AbstractSSHClient.put_file (   self,
  source,
  destination = '.',
  mode = '0o744',
  newline = '',
  scp = 'OFF',
  scp_preserve_times = False 
)

Calls :py:meth:AbstractSFTPClient.put_file` with the given arguments.

See :py:meth:AbstractSFTPClient.put_file for more documentation.

Definition at line 636 of file abstractclient.py.

◆ read()

def SSHLibrary.abstractclient.AbstractSSHClient.read (   self,
  delay = None 
)

Reads all output available in the current shell.

    Reading always consumes the output, meaning that after being read,
    the read content is no longer present in the output.

    :param str delay: If given, this method reads again after the delay
        to see if there is more output is available. This wait-read cycle is
        repeated as long as further reads return more output or the
        configured timeout expires. The timeout is set when calling
        :py:meth:`open_connection`. The delay can be given as an integer
        (the number of seconds) or in Robot Framework's time format, e.g.
        `4.5s`, `3 minutes`, `2 min 3 sec`.

    :returns: The read output from the remote host.

Definition at line 426 of file abstractclient.py.

◆ read_char()

def SSHLibrary.abstractclient.AbstractSSHClient.read_char (   self)

Reads a single Unicode character from the current shell.

    Reading always consumes the output, meaning that after being read,
    the read content is no longer present in the output.

    :returns: A single char read from the output.

Definition at line 451 of file abstractclient.py.

◆ read_command_output()

def SSHLibrary.abstractclient.AbstractSSHClient.read_command_output (   self,
  timeout = None,
  output_during_execution = False,
  output_if_timeout = False 
)

Reads the output of the previous started command.

    The previous started command, started with :py:meth:`start_command`,
    is popped out of the stack and its outputs (stdout, stderr and the
    return code) are read and returned.

    :raises SSHClientException: If there are no started commands to read
        output from.

    :returns: A 3-tuple (stdout, stderr, return_code) with values
        `stdout` and `stderr` as strings and `return_code` as an integer.

Definition at line 389 of file abstractclient.py.

◆ read_until()

def SSHLibrary.abstractclient.AbstractSSHClient.read_until (   self,
  expected 
)

Reads output from the current shell until the expected text is encountered or the timeout expires.

The timeout is set when calling :py:meth:open_connection.

Reading always consumes the output, meaning that after being read, the read content is no longer present in the output.

:param str expected: The text to look for in the output.

:raises SSHClientException: If expected is not found in the output when the timeout expires.

:returns: The read output, including the encountered expected text.

Definition at line 478 of file abstractclient.py.

◆ read_until_newline()

def SSHLibrary.abstractclient.AbstractSSHClient.read_until_newline (   self)

Reads output from the current shell until a newline character is encountered or the timeout expires.

The newline character and the timeout are set when calling :py:meth:open_connection.

Reading always consumes the output, meaning that after being read, the read content is no longer present in the output.

:raises SSHClientException: If the newline character is not found in the output when the timeout expires.

:returns: The read output, including the encountered newline character.

Definition at line 509 of file abstractclient.py.

◆ read_until_prompt()

def SSHLibrary.abstractclient.AbstractSSHClient.read_until_prompt (   self,
  strip_prompt = False 
)

Reads output from the current shell until the prompt is encountered or the timeout expires.

The prompt and timeout are set when calling :py:meth:open_connection.

Reading always consumes the output, meaning that after being read, the read content is no longer present in the output.

:param bool strip_prompt: If 'True' then the prompt is removed from the resulting output

:raises SSHClientException: If prompt is not set or is not found in the output when the timeout expires.

:returns: The read output, including the encountered prompt.

Definition at line 528 of file abstractclient.py.

◆ read_until_regexp()

def SSHLibrary.abstractclient.AbstractSSHClient.read_until_regexp (   self,
  regexp 
)

Reads output from the current shell until the regexp matches or the timeout expires.

The timeout is set when calling :py:meth:open_connection.

Reading always consumes the output, meaning that after being read, the read content is no longer present in the output.

:param regexp: Either the regular expression as a string or a compiled Regex object.

:raises SSHClientException: If no match against regexp is found when the timeout expires.

:returns: The read output up and until the regexp matches.

Definition at line 565 of file abstractclient.py.

◆ read_until_regexp_with_prefix()

def SSHLibrary.abstractclient.AbstractSSHClient.read_until_regexp_with_prefix (   self,
  regexp,
  prefix 
)

Read and return from output until regexp matches prefix + output.

:param regexp: a pattern or a compiled regexp object used for matching :raises SSHClientException: if match is not found in prefix+output when timeout expires.

timeout is defined with :py:meth:open_connection()

Definition at line 579 of file abstractclient.py.

◆ scp_all_client()

def SSHLibrary.abstractclient.AbstractSSHClient.scp_all_client (   self)
private

Definition at line 127 of file abstractclient.py.

◆ scp_transfer_client()

def SSHLibrary.abstractclient.AbstractSSHClient.scp_transfer_client (   self)
private

Definition at line 114 of file abstractclient.py.

◆ sftp_client()

def SSHLibrary.abstractclient.AbstractSSHClient.sftp_client (   self)
private

Definition at line 101 of file abstractclient.py.

◆ shell()

def SSHLibrary.abstractclient.AbstractSSHClient.shell (   self)
private

Definition at line 140 of file abstractclient.py.

◆ start_command()

def SSHLibrary.abstractclient.AbstractSSHClient.start_command (   self,
  command,
  sudo = False,
  sudo_password = None,
  invoke_subsystem = False,
  forward_agent = False 
)

Starts the execution of the command on the remote host.

    The started `command` is pushed into an internal stack. This stack
    always has the latest started `command` on top of it.

    The `command` is always started in a new shell, meaning that changes to
    the environment are not visible to the subsequent calls of this method.

    This method does not return anything. Use :py:meth:`read_command_output`
    to get the output of the previous started command.

    :param str command: The command to be started on the remote host.

    :param sudo
     and
    :param sudo_password are used for executing commands within a sudo session.

    :param invoke_subsystem will request a subsystem on the server.

Definition at line 369 of file abstractclient.py.

◆ write()

def SSHLibrary.abstractclient.AbstractSSHClient.write (   self,
  text,
  add_newline = False 
)

Writes text in the current shell.

    :param str text: The text to be written.

    :param bool add_newline: If `True`, the configured newline will be
        appended to the `text` before writing it on the remote host.
        The newline is set when calling :py:meth:`open_connection`

Definition at line 405 of file abstractclient.py.

◆ write_until_expected()

def SSHLibrary.abstractclient.AbstractSSHClient.write_until_expected (   self,
  text,
  expected,
  timeout,
  interval 
)

Writes text repeatedly in the current shell until the expected appears in the output or the timeout expires.

:param str text: Text to be written. Uses :py:meth:write_bare internally so no newline character is appended to the written text.

:param str expected: Text to look for in the output.

:param int timeout: The timeout during which expected must appear in the output. Can be given as an integer (the number of seconds) or in Robot Framework's time format, e.g. 4.5s, 3 minutes, 2 min 3 sec.

:param int interval: Time to wait between the repeated writings of text.

:raises SSHClientException: If expected is not found in the output before the timeout expires.

:returns: The read output, including the encountered expected text.

Definition at line 616 of file abstractclient.py.

Member Data Documentation

◆ _scp_all_client

SSHLibrary.abstractclient.AbstractSSHClient._scp_all_client
private

Definition at line 73 of file abstractclient.py.

◆ _scp_transfer_client

SSHLibrary.abstractclient.AbstractSSHClient._scp_transfer_client
private

Definition at line 72 of file abstractclient.py.

◆ _sftp_client

SSHLibrary.abstractclient.AbstractSSHClient._sftp_client
private

Definition at line 71 of file abstractclient.py.

◆ _shell

SSHLibrary.abstractclient.AbstractSSHClient._shell
private

Definition at line 74 of file abstractclient.py.

◆ _started_commands

SSHLibrary.abstractclient.AbstractSSHClient._started_commands
private

Definition at line 75 of file abstractclient.py.

◆ client

SSHLibrary.abstractclient.AbstractSSHClient.client

Definition at line 76 of file abstractclient.py.

◆ config

SSHLibrary.abstractclient.AbstractSSHClient.config

Definition at line 68 of file abstractclient.py.

◆ height

SSHLibrary.abstractclient.AbstractSSHClient.height

Definition at line 78 of file abstractclient.py.

◆ width

SSHLibrary.abstractclient.AbstractSSHClient.width

Definition at line 77 of file abstractclient.py.

Property Documentation

◆ scp_all_client

SSHLibrary.abstractclient.AbstractSSHClient.scp_all_client = property
static

Gets the SCP client for the file transfer.

    :returns: An object of the class type
        :py:class:`SCPClient`.

Definition at line 125 of file abstractclient.py.

◆ scp_transfer_client

SSHLibrary.abstractclient.AbstractSSHClient.scp_transfer_client = property
static

Gets the SCP client for the file transfer.

    :returns: An object of the class that inherits from
        :py:class:`SFTPClient`.

Definition at line 112 of file abstractclient.py.

◆ sftp_client

SSHLibrary.abstractclient.AbstractSSHClient.sftp_client = property
static

Gets the SFTP client for the connection.

    :returns: An object of the class that inherits from
        :py:class:`AbstractSFTPClient`.

Definition at line 99 of file abstractclient.py.

◆ shell

SSHLibrary.abstractclient.AbstractSSHClient.shell = property
static

Gets the shell for the connection.

    :returns: An object of the class that inherits from
        :py:class:`AbstractShell`.

Definition at line 138 of file abstractclient.py.


The documentation for this class was generated from the following file: