From: garciadeblas Date: Fri, 25 Sep 2020 09:39:31 +0000 (+0000) Subject: Updated Test Connectivity to retry ping and capture ping output X-Git-Tag: release-v9.0-start~22 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=36b0312c543c3166e72d46af3879258f4ef71650;p=osm%2Ftests.git Updated Test Connectivity to retry ping and capture ping output Change-Id: Idf6b873db0066ea8783f5ae917ad94bcff2f6d43 Signed-off-by: garciadeblas --- diff --git a/robot-systest/lib/connectivity_lib.robot b/robot-systest/lib/connectivity_lib.robot index 7b86593..3db20b8 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} - ${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}