IPv6: support ping6 in Check Ping keyword 76/56976/4
authorValentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
Fri, 12 May 2017 16:14:42 +0000 (18:14 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 12 May 2017 22:38:04 +0000 (22:38 +0000)
Due to IPv6 support introduced in commit
0d71e928a58944d2cd4391e407b8eb0d598b6029 "IPv6: support in basic
vpn_service tests", if a value of ${ip_address} doesn't match IPv4
address regexp, use ping6 instead of ping in Check Ping keyword.

Change-Id: I9ab68779c5c0b05ae74339610788188b7371f02c
Signed-off-by: Valentina Krasnobaeva <valentina.krasnobaeva@6wind.com>
csit/libraries/OpenStackOperations.robot

index 624e8c669c6c870adb74d5e2a8280f8555eeac63..8005a9331a102d290c56a865bcd9ba8dfe410647 100644 (file)
@@ -457,7 +457,9 @@ Exit From Vm Console
 Check Ping
     [Arguments]    ${ip_address}    ${ttl}=64
     [Documentation]    Run Ping command on the IP available as argument
-    ${output}=    Write Commands Until Expected Prompt    ping -t ${ttl} -c 3 ${ip_address}    ${OS_SYSTEM_PROMPT}
+    ${ethertype}=    Get Regexp Matches    ${ip_address}    ${IP_REGEX}
+    ${output}=    Run Keyword If    ${ethertype}    Write Commands Until Expected Prompt    ping -t ${ttl} -c 3 ${ip_address}    ${OS_SYSTEM_PROMPT}
+    ...    ELSE    Write Commands Until Expected Prompt    ping6 -t ${ttl} -c 3 ${ip_address}    ${OS_SYSTEM_PROMPT}
     Should Contain    ${output}    64 bytes
 
 Check Metadata Access