X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fssh_lib.robot;h=23e5ae491072f00e19703834f0aadb46491c4481;hb=69b532b05f993931ce73b997de85123a7da09d35;hp=3d2d708db5657a6098bfd5be4dd661c22394491a;hpb=4edf733e765a1069a34d6fccf940af27ae39dad6;p=osm%2Fdevops.git diff --git a/robot-systest/lib/ssh_lib.robot b/robot-systest/lib/ssh_lib.robot index 3d2d708d..23e5ae49 100644 --- a/robot-systest/lib/ssh_lib.robot +++ b/robot-systest/lib/ssh_lib.robot @@ -40,6 +40,20 @@ Get Remote File Content Close All Connections [Return] ${output} +Ping Many + [Arguments] ${host} ${username} ${password} ${privatekey} @{ip_list} + + Open Connection ${host} + Run Keyword If '${password}'!='${EMPTY}' Login ${username} ${password} + ... ELSE Login With Public Key ${username} ${privatekey} + FOR ${ip} IN @{ip_list} + ${result}= Execute Command ping -c 5 -W 1 ${ip} > /dev/null && echo OK shell=True + Log ${result} + Should Contain ${result} OK + END + Close All Connections + + Execute Remote Command Check Rc Return Output [Arguments] ${host} ${username} ${password} ${privatekey} ${command} @@ -51,4 +65,5 @@ Execute Remote Command Check Rc Return Output log ${stdout} Close All Connections Should Be Equal As Integers ${rc} 0 - [Return] ${stdout} \ No newline at end of file + [Return] ${stdout} +