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
# 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}
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}
[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.
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.
[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