Registry / testing / robotframework-sshlibrary

robotframework-sshlibrary

JSON →
library3.8.0pypypiunverified

Robot Framework SSHLibrary is a test library for SSH and SFTP operations. It provides keywords for executing commands, interacting with interactive shells, transferring files and directories via SFTP, and asserting the existence of files and directories on remote machines. The library is operating system independent and currently supports Python 3.6 or newer (older versions like 3.8.0 also supported Python 2.7 and 3.4+). It maintains an active release cadence with regular updates and enhancements.

pip install robotframework-sshlibrary
INSTALL
IMPORT
SIG · ROBOTFRAMEWORK-SSH
R
robotframework-sshlibrary
testingpythonv3.8.0
Install
4.3s avg
Import
Disk
48MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 49.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.3s · import 0.000s · 50MB
48MB installed
● package 48MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SSHLibrary
*** Settings *** Library SSHLibrary
from SSHLibrary import SSHLibrary
Robot Framework libraries are imported using the 'Library' setting in the Settings section of a .robot file, not with Python-style 'from import'.

This example connects to a remote SSH server using environment variables for credentials, executes a simple `ls -l /tmp` command, logs the output, asserts a part of the output, and then closes the connection. Set `SSH_HOST`, `SSH_PORT`, `SSH_USERNAME`, and `SSH_PASSWORD` environment variables before running.

*** Settings *** Documentation Demonstrates SSHLibrary connection and command execution. Library SSHLibrary *** Variables *** ${SSH_HOST} ${OS_ENVIRONMENT_SSH_HOST} ${SSH_PORT} ${OS_ENVIRONMENT_SSH_PORT} ${SSH_USERNAME} ${OS_ENVIRONMENT_SSH_USERNAME} ${SSH_PASSWORD} ${OS_ENVIRONMENT_SSH_PASSWORD} *** Test Cases *** Execute Remote Command [Tags] SSH Open Connection ${SSH_HOST} port=${SSH_PORT} Login ${SSH_USERNAME} ${SSH_PASSWORD} ${output}= Execute Command ls -l /tmp Log To Console Command Output: ${output} Should Contain ${output} total Close Connection
Debug
Known issues
breakingSSHLibrary 3.0.0 introduced Python 3 support (Python 2.7, 3.4+). Older versions of SSHLibrary may not be compatible with newer Python 3 versions, and newer SSHLibrary versions (e.g., 3.8.0 onwards) officially support Python 3.6+.
fix
Ensure your Python environment matches the SSHLibrary version's requirements. Upgrade SSHLibrary and Python if necessary.
affects: < 3.0.0 for Python 3; < 3.8.0 for Python 3.6+
breakingIn SSHLibrary 3.0.0, the `Login with Public Key` keyword arguments changed. Specifically, the `delay` argument must now be provided as a named argument (e.g., `delay=1s`).
fix
Update calls to `Login with Public Key` to use named arguments for `delay`.
affects: >= 3.0.0
breakingPrior to SSHLibrary 3.1.0, all non-empty strings, including 'no' and 'none', were considered `True` for boolean arguments. This behavior was aligned with Robot Framework 3.0.3, where 'none' is considered `False`.
fix
If using string boolean arguments (e.g., 'True', 'False', 'yes', 'no'), ensure to upgrade to SSHLibrary 3.1.0 or newer for correct boolean evaluation, especially for 'no'/'none' values.
affects: < 3.1.0
gotchaConnections or command executions can hang or time out (e.g., 'SSHLibrary Exception: Timeout opening tunnel') due to insufficient default timeouts or network latency.
fix
Explicitly set timeouts. Use `Library SSHLibrary    timeout=30s` during import, `Open Connection    host=${HOST}    timeout=1min`, `Login    username=${USER}    password=${PASS}    delay=1s`, and `Execute Command    command    timeout=30s`.
affects: All versions
gotchaThe `path_separator` argument (used by keywords like `Get File`, `Put Directory`) defaults to '/' (Unix-like). On Windows SSH servers, this may need to be explicitly set to '\\' (doubled backslash in Robot Framework data) if the server uses backslashes.
fix
Configure the `path_separator` during library import or using `Set Default Configuration` or `Open Connection`: `Library    SSHLibrary    path_separator=\\\` or `Open Connection    ${HOST}    path_separator=\\\`.
affects: All versions
Upgrade
Version history
3.8.0latest on PyPI · released Nov 18, 2021
Audit
Dependencies
paramikorequiredCore dependency for SSH communication in Python.
scprequiredCore dependency for SCP/SFTP file transfers in Python.
cryptographyrequiredRequired by Paramiko for cryptographic operations (or PyCrypto for older Paramiko versions).
robotbackgroundloggeroptionalRequired for creating SSH tunnels (version > 1.2).
Trilead SSH libraryrequiredRequired when using SSHLibrary with Jython.
win_inet_ptonoptionalRequired on Windows operating systems when using Python versions older than 3.0.
Agent activity
8 hits · last 30 days
node
8
Resources
robotframework-sshlibrary — pip install robotframework-sshlibrary · libregistry