SSHTunnelLibrary is a Robotframework library to support SSHTunnels. It will help to connect to remote host using SSH Local Forwarding.
## Usage
Install robotframework-sshtunnellibrary and its dependencies via pip
```
pip install -U sshtunnel
pip install -U robotframework-sshtunnellibrary
```
## Example
SSH Tunnel Library can be used with libraries like SSHLibrary, RequestLibrary, DatabaseLibrary, SeleniumLibrary to make connection to ssh, rest api, database connection, web application respectively.
Here is an example to make SSH connection using request library via SSH Server.
``` robotframework
*** Settings ***
Library SSHTunnelLibrary
Library SSHLibrary
*** Variables ***
${REMOTE_HOST}= <Remote_IP/Name>
${REMOTE_PORT}= 22
${SSH_SERVER}= <SSH_Server_IP/Name>
${SSH_SERVER_PORT}= 22
${SSH_SERVER_USERNAME}= <SSH_Server_Username>
${SSH_SERVER_PASSWORD}= <SSH_Server_Password>
${LOCAL_HOST}= localhost
${LOCAL_PORT}= 0
${REMOTE_USERNAME}= <Remote_host_Username>
${REMOTE_PASSWORD}= <Remote_host_Password>
*** Test Cases ***
SSH Connection using SSH Tunnel
# Create Tunnel
Start SSH Tunnel MySshTunnel ${REMOTE_HOST} ${REMOTE_PORT} ${SSH_SERVER} ${SSH_SERVER_PORT} ${SSH_SERVER_USERNAME} ${SSH_SERVER_PASSWORD} ${LOCAL_HOST} ${LOCAL_PORT}
${LOCAL_BIND_PORT}= Get Local Port
# Connection using local bind
Open Connection ${LOCAL_HOST} port=${LOCAL_BIND_PORT}
Login ${REMOTE_USERNAME} ${REMOTE_PASSWORD}
# Closing the Tunnel
Stop SSH Tunnel MySshTunnel
```
Metadata
Release files for robotframework-sshtunnellibrary 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| robotframework_sshtunnellibrary-1.0.0-py2-none-any.whl | Python 2 | none | any | Details for robotframework_sshtunnellibrary-1.0.0-py2-none-any.whl |
Release files / robotframework_sshtunnellibrary-1.0.0-py2-none-any.whl
| Download URL | robotframework_sshtunnellibrary-1.0.0-py2-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
6277824f13b0f27a31fe96fdfedbcadc5eca7d0f2515c8b6a029a9c065de0d4c
|
|
BLAKE2b-256 checksum How to use checksums |
20de78dd4d852b65f266316d38ea2a99fa9e07c8654073e9eeeb37541f1c267a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for robotframework-sshtunnellibrary 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.