This will fix couple of adsal TCs
[integration/test.git] / test / csit / libraries / Utils.txt
index 73517c5a80c1f105851eb5de4029dcc79c42b758..e849c5c51ee14dd76efe1985ca1b76dde70dd509 100644 (file)
@@ -46,7 +46,7 @@ Check Nodes Stats
     [Arguments]    ${node}
     [Documentation]    A GET on the /node/${node} API is made and specific flow stat
     ...    strings are checked for existence.
-    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}/node/${node}
+    ${resp}    RequestsLibrary.Get    session    ${OPERATIONAL_NODES_API}/node/${node}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    flow-capable-node-connector-statistics
     Should Contain    ${resp.content}    flow-table-statistics
@@ -90,6 +90,11 @@ Check For Elements Not At URI
     : FOR    ${i}    IN    @{elements}
     \    Should Not Contain    ${resp.content}    ${i}
 
+Clean Mininet System
+    [Arguments]     ${mininet_system}=${MININET}
+    Run Command On Remote System    ${mininet_system}   sudo mn -c
+    Run Command On Remote System    ${mininet_system}   sudo ps -elf | egrep 'usr/local/bin/mn' | egrep python | awk '{print "sudo kill -9",$4}' | sh
+
 Extract Value From Content
     [Arguments]    ${content}    ${index}    ${strip}=nostrip
     [Documentation]    Will take the given response content and return the value at the given index as a string
@@ -110,11 +115,11 @@ Run Command On Remote System
     ...    taking care to log in with a public key and. The command given is written and the output returned. No test conditions
     ...    are checked.
     Log    Attempting to execute ${cmd} on ${remote_system}
-    ${conn_id}=    Open Connection    ${remote_system}    prompt=${prompt}    timeout=${prompt_timeout}
+    ${conn_id}=    SSHLibrary.Open Connection    ${remote_system}    prompt=${prompt}    timeout=${prompt_timeout}
     Login With Public Key    ${user}    ${USER_HOME}/.ssh/id_rsa    any
-    Write    ${cmd}
-    ${output}=    Read Until    ${linux_prompt}
-    Close Connection
+    SSHLibrary.Write    ${cmd}
+    ${output}=    SSHLibrary.Read Until    ${linux_prompt}
+    SSHLibrary.Close Connection
     [Return]    ${output}
 
 Verify File Exists On Remote System