Package: robotframework-sshlibrary
ContentsIntroductionDocumentationInstallationDockerUsageSupportIntroductionSSHLibraryis aRobot Frameworktest
library for SSH and SFTP.  The project is hosted onGitHuband downloads can be found fromPyPI.SSHLibrary is operating system independent and supports Python 2.7 as well
as Python 3.4 or newer. In addition to the normalPythoninterpreter,
it also works withJython 2.7.The library has the following main usages:Executing commands on the remote machine, either with blocking or
non-blocking behavior.Writing and reading in an interactive shell.Transferring files and directories over SFTP.Ensuring that files and directories exist on the remote machine.DocumentationSeekeyword documentationfor available keywords and more information
about the library in general.For general information about using test libraries with Robot Framework, seeRobot Framework User Guide.InstallationThe recommended installation method is usingpip:pip install --upgrade robotframework-sshlibraryRunning this command installs also the latest Robot Framework,paramikoandscpversions. The minimum supported paramiko version is1.15.3and
minimum supported scp version is0.13.0.
The--upgradeoption can be omitted when installing the library for the
first time.With recent versions ofpipit is possible to install directly from theGitHubrepository. To install latest source from the master branch, use
this command:pip install git+https://github.com/robotframework/SSHLibrary.gitAlternatively you can download the source distribution fromPyPI, extract
it, and install it using one of the following depending are you using
Python or Jython:python setup.py install
jython setup.py installA benefit of using pip is that it automatically installs scp, paramiko
andCryptographymodules (orPyCryptoif paramiko version < 2.0)
that SSHLibrary requires on Python.On Jython, SSHLibrary requires Trilead SSH JAR distribution. You need to downloadTrilead SSH JAR distributionand add it to CLASSPATH.On Windows operating system, when using Python version < 3.0, SSHLibrary will
requirewin_inet_pton. The minimum supported win_inet_pton version is1.1.0.For creating SSH tunnelsrobotbackgroundlogger> 1.2 is also a requirement.DockerWhen installing SSHLibrary in a container (eg. Alpine Linux) there are more dependencies
that must be installed:gcc,make,openssl-dev,musl-devandlibffi-dev. These
packages can be installed using:apk add gcc make openssl-dev musl-dev libffi-devUsageTo use SSHLibrary in Robot Framework tests, the library needs to first be
imported using the Library setting as any other library.When using Robot Framework, it is generally recommended to write as
easy-to-understand tests as possible. The keywords provided by
SSHLibrary are pretty low level and it is typically a good idea to
write tests using Robot Framework’s higher level keywords that utilize
SSHLibrary keywords internally. This is illustrated by the following example
where SSHLibrary keywords likeOpen ConnectionandLoginare grouped
together in a higher level keyword likeOpen Connection And Log In.*** Settings ***DocumentationThis example demonstrates executing a command on a remote machine...and getting its output....
...Notice how connections are handled as part of the suite setup and...teardown. This saves some time when executing several test cases.LibrarySSHLibrarySuite SetupOpen Connection And Log InSuite TeardownClose All Connections*** Variables ***${HOST}localhost${USERNAME}test${PASSWORD}test*** Test Cases ***Execute Command And Verify Output[Documentation]Execute Command can be used to run commands on the remote machine....The keyword returns the standard output by default.${output}=Execute Commandecho Hello SSHLibrary!Should Be Equal${output}Hello SSHLibrary!*** Keywords ***Open Connection And Log InOpen Connection${HOST}Login${USERNAME}        ${PASSWORD}SupportIf the provided documentation is not enough, there are various support forums
available:robotframework-usersmailing list#sshlibraryand#sshlibrary-devchannels in
Robot FrameworkSlack communitySSHLibraryissue trackerfor bug reports and concrete enhancement
requestsOther support forumsincluding paid support