Skip to main content

SSH Tunnel Library for Robot framework

Project description

# robotframework-sshtunnellibrary

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>
${SSH_SERVER}= <SSH_Server_IP/Name>
${SSH_SERVER_USERNAME}= <SSH_Server_Username>
${SSH_SERVER_PASSWORD}= <SSH_Server_Password>
${LOCAL_HOST}= localhost

${REMOTE_USERNAME}= <Remote_host_Username>
${REMOTE_PASSWORD}= <Remote_host_Password>

*** Test Cases ***
SSH Connection using SSH Tunnel
# Create Tunnel
${LOCAL_BIND_PORT}= Get Local Port

# Connection using local bind
Open Connection ${LOCAL_HOST} port=${LOCAL_BIND_PORT}

# Closing the Tunnel
Stop SSH Tunnel MySshTunnel

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page