X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fconnectivity_lib.robot;h=fed1b233cc83658417d00a988dd4b2a9fd202098;hb=8fb875b28cbee52b5b5bcde7c967810252848dc4;hp=7b865935d17f81412fc63e08f20f1c39ca0d42cf;hpb=f96bb45c0a03f2188688d90d67ea718851cec2de;p=osm%2Ftests.git diff --git a/robot-systest/lib/connectivity_lib.robot b/robot-systest/lib/connectivity_lib.robot index 7b86593..fed1b23 100644 --- a/robot-systest/lib/connectivity_lib.robot +++ b/robot-systest/lib/connectivity_lib.robot @@ -10,10 +10,26 @@ # See the License for the specific language governing permissions and # limitations under the License. +*** Variables *** +${success_return_code} 0 +${connectivity_pol_time} 5sec +${connectivity_max_wait_time} 30sec + *** Keywords *** +Test Ping Host + [Documentation] Run Ping + ... Parameters: + ... host: IP or name of the host + ... Execution example: + ... Ping Test \${host} + + [Arguments] ${host} + + ${rc} ${stdout}= Run and Return RC and Output ping -c 2 -W 1 ${host} + log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + Test Connectivity - [Arguments] ${host} + [Arguments] ${host} - ${result} Run Process ping -c 5 -W 1 ${host} > /dev/null && echo OK shell=True - Log all output: ${result.stdout} - Should Contain ${result.stdout} OK + WAIT UNTIL KEYWORD SUCCEEDS ${connectivity_max_wait_time} ${connectivity_pol_time} Test Ping Host ${host}