Timeout: timed out trying connect to multiple SSH

Hi all,

Im new into robot and Im trying to connect into a multiples devices and once I run I got a time out error, i tried to add a read until get a message from the connection but same error, find below the bloc of code

${ips}=    OperatingSystem.Get File    ${CURDIR}${/}..${/}Output_files${/}ips.txt
    @{ip_list}=    Split String    ${ips}    \n
    FOR    ${ip}    IN    @{ip_list}
        Open Connection    ${ip}    alias=${ip}_${ip_list}
        Log To Console    Loggin in ${ip}
        Login    ${user_networkcard}    ${user_networkcard_password} 
        SSHLibrary.Read Until    Logging into
        Write    ip a show dev eth0
        ${ip_eth0_avahi}=    Read Until    scope link eth0:avahi
        Log To Console    ${ip_eth0_avahi}
        Close Connection
    END

Hi Roberto,

You didn’t say which line gave you the error or what the error was, so the best we can do is guess.

  • my first guess would be the alias=${ip}_${ip_list} might be causing you issues?
    • are you sure you want the ful list of IP’s in your alias name?
    • usually alias’s are short otherwise what’s the point of them?
    • i suggest you try changing the alias to just alias=${ip}for now and see if that works

Also have you considered a test template (DataDriven Tests)?

  • put the part in the for in a keyword, this keyword becomes your test template
  • use datadriver to read ${CURDIR}${/}..${/}Output_files${/}ips.txt and create a new test for each IP
  • this way when one of the hosts fails only that test fails rather than the single test you have now failing and you have to drill down into the loop to figure out which host failed
  • also with test template all hosts will get tested and you’ll know if several hosts fail, where with your current test if the first host fails you won’t know if any of the others pass?

Hope that helps,

Dave.