2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
16 Documentation Library providing keywords for testing connectivity to hosts via ping.
17 Library OperatingSystem
21 ${SUCCESS_RETURN_CODE} 0
22 ${CONNECTIVITY_POL_TIME} 5sec
23 ${CONNECTIVITY_MAX_WAIT_TIME} 30sec
28 [Documentation] Run Ping
30 ... host: IP or name of the host
31 ... Execution example:
32 ... Ping Test \${host}
34 ${rc} ${stdout}= Run And Return Rc And Output ping -c 2 -W 1 ${host}
36 Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE}
39 [Documentation] Ping a host several times during ${CONNECTIVITY_MAX_WAIT_TIME} until it succeeds or raises a timeout.
41 Wait Until Keyword Succeeds ${CONNECTIVITY_MAX_WAIT_TIME} ${CONNECTIVITY_POL_TIME} Test Ping Host ${host}