Add ping retries and break on success
[integration/test.git] / csit / libraries / Utils.robot
index cfcefc11aab1d8bf6319869556f3abf70ff8f667..00991c75b6773ba5495a1aa76f4ee38b195e7ee2 100644 (file)
@@ -504,12 +504,23 @@ Convert_To_Minutes
 Write Commands Until Expected Prompt
     [Arguments]    ${cmd}    ${prompt}    ${timeout}=${DEFAULT_TIMEOUT}
     [Documentation]    quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
+    BuiltIn.Log    cmd: ${cmd}
     SSHLibrary.Set Client Configuration    timeout=${timeout}
     SSHLibrary.Read
     SSHLibrary.Write    ${cmd}
     ${output}=    SSHLibrary.Read Until    ${prompt}
     [Return]    ${output}
 
+Write Commands Until Expected Regexp
+    [Arguments]    ${cmd}    ${regexp}    ${timeout}=${DEFAULT_TIMEOUT}
+    [Documentation]    quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
+    BuiltIn.Log    cmd: ${cmd}
+    SSHLibrary.Set Client Configuration    timeout=${timeout}
+    SSHLibrary.Read
+    SSHLibrary.Write    ${cmd}
+    ${output}=    SSHLibrary.Read Until Regexp    ${regexp}
+    [Return]    ${output}
+
 Install Package On Ubuntu System
     [Arguments]    ${package_name}    ${system}=${TOOLS_SYSTEM_IP}    ${user}=${TOOLS_SYSTEM_USER}    ${password}=${TOOLS_SYSTEM_PASSWORD}    ${prompt}=${DEFAULT_LINUX_PROMPT}    ${prompt_timeout}=30s
     [Documentation]    Keyword to install packages for testing to Ubuntu Mininet VM