User
User

Reputation: 95

Parallel SSH connections to remote host with Robot

I have a simple test, using the SSHLibrary which I'd like to start and run in parallel on multiple hosts. Now I have statically set 'host1'. How would I run this on host1, host2 and host3 at the same time?

*** Settings ***
Documentation          Demo
Library                SSHLibrary
Suite Setup            Open Connection And Log In
Suite Teardown         Close All Connections

*** Variables ***
${HOST}                host1
${USERNAME}            user

*** Test Cases ***
Evaluate command status
    [Documentation]    Demo
    ${output}     Execute Command     net show version  
    Should Be True    $output

*** Keywords ***
Open Connection And Log In
   Open Connection          ${HOST}
   Login With Public Key    ${USERNAME}    /home/user/.ssh/id_rsa

Upvotes: 0

Views: 408

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385910

You can set the variable on the command line with the --variable or -V option:

robot --variable host:host1
robot --variable host:host2

For more information see Setting variables in command line in the robot framework user guide.

Robot iteself doesn't provide any features to run tests in parallel. To run them in parallel you could write a script that runs robot in the background for each host, and then combine the reports from each run into a single unified report.

Upvotes: 1

Related Questions