unable to terminate netconf session due to process ID is truncated
[integration/test.git] / csit / suites / netconf / MDSAL / northbound.robot
index dcf55789ab2d91233124435b1690eb5264c653c7..ec7343616dec480927e8a45b6142f36a02a32f61 100644 (file)
@@ -35,6 +35,8 @@ Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 Library           RequestsLibrary
 Library           SSHLibrary
+Library           String
+Library           XML
 Resource          ${CURDIR}/../../../libraries/CompareStream.robot
 Resource          ${CURDIR}/../../../libraries/FailFast.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
@@ -339,11 +341,11 @@ Create_ODL_Netconf_Connection
     #    object and pull the data out of it rather than relying on
     #    global variables. This will allow for tracking more Netconf
     #    connections, increasing utility.
-    ${control}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=10s
-    Utils.Flexible_Controller_Login
+    ${control}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=60s
+    SSHKeywords.Flexible_Controller_Login
     BuiltIn.Set_Suite_Variable    ${ssh_control}    ${control}
-    ${netconf}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=10s
-    Utils.Flexible_Controller_Login
+    ${netconf}=    SSHLibrary.Open_Connection    ${host}    prompt=${ODL_SYSTEM_PROMPT}    timeout=60s
+    SSHKeywords.Flexible_Controller_Login
     BuiltIn.Set_Suite_Variable    ${ssh_netconf}    ${netconf}
     BuiltIn.Set_Suite_Variable    ${ssh_port}    ${port}
     BuiltIn.Set_Suite_Variable    ${ssh_user}    ${user}
@@ -354,7 +356,7 @@ Reopen_ODL_Netconf_Connection
     SSHLibrary.Write    sshpass -p ${ssh_password} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${ssh_user}\@127.0.0.1 -p ${ssh_port} -s netconf
     ${hello}=    SSHLibrary.Read_Until    ${ODL_NETCONF_PROMPT}
     SSHLibrary.Switch_Connection    ${ssh_control}
-    ${pid}=    SSHLibrary.Execute_Command    ps -A | grep sshpass | cut -b 1-6
+    ${pid}=    SSHLibrary.Execute_Command    ps -A | grep sshpass | awk '{print $1}'
     BuiltIn.Set_Suite_Variable    ${ssh_netconf_pid}    ${pid}
     SSHLibrary.Switch_Connection    ${ssh_netconf}
     [Return]    ${hello}
@@ -401,8 +403,7 @@ Load_Expected_Reply
     [Arguments]    ${name}
     [Documentation]    Load the expected reply from the data file set and return it.
     ${expected_reply}=    Get_Data    ${name}-reply
-    ${expected}=    Prepare_For_Search    ${expected_reply}
-    [Return]    ${expected}
+    [Return]    ${expected_reply}
 
 Abort_ODL_Netconf_Connection
     [Documentation]    Correctly close the Netconf connection and make sure it is really dead.
@@ -422,7 +423,7 @@ Close_ODL_Netconf_Connection_Gracefully
 Setup_Everything
     [Documentation]    Setup resources and create session for Restconf checking.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    RequestsLibrary.Create_Session    config    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${CONFIG_API}    auth=${AUTH}
+    RequestsLibrary.Create_Session    config    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${REST_API}    auth=${AUTH}
 
 Teardown_Everything
     [Documentation]    Close the Netconf connection and destroy all sessions in the requests library.
@@ -508,8 +509,9 @@ Perform_Test
     [Documentation]    Load and send the request from the dataset and compare the returned reply to the one stored in the dataset.
     ${actual}=    Load_And_Send_Message    ${name}
     ${expected}=    Load_Expected_Reply    ${name}
-    ${newline}=    BuiltIn.Evaluate    "\\r\\n"
-    BuiltIn.Should_Be_Equal    ${newline}${expected}${ODL_NETCONF_PROMPT}    ${actual}
+    ${actual}=    String.Remove String    ${actual}    ]]>]]>
+    ${actual}=    String.Strip String    ${actual}    mode=both
+    XML.Elements Should Be Equal    ${actual}    ${expected}    normalize_whitespace=True
     [Return]    ${actual}
 
 Send_And_Check