Library OperatingSystem
Library SSHLibrary
Library RequestsLibrary
-Library ${CURDIR}/../../../libraries/HsfJson/hsf_json.py
+Library ${CURDIR}/../../../libraries/norm_json.py
+Resource ${CURDIR}/../../../libraries/NexusKeywords.robot
Resource ${CURDIR}/../../../libraries/PcepOperations.robot
Resource ${CURDIR}/../../../libraries/Utils.robot
Variables ${CURDIR}/../../../variables/Variables.py
-Variables ${CURDIR}/../../../variables/pcepuser/variables.py ${MININET}
+Variables ${CURDIR}/../../../variables/pcepuser/variables.py ${TOOLS_SYSTEM_IP}
*** Variables ***
-${MININET_PROMPT} ${DEFAULT_LINUX_PROMPT}
${OUTPUT_TIMEOUT} 10
# FIXME: Unify parameter naming and case.
${ExpDir} ${CURDIR}/expected
Start_Pcc_Mock
[Documentation] Execute pcc-mock on Mininet, fail is Open is not sent, keep it running for next tests.
- ${command}= Set_Variable java -jar ${filename} --local-address ${MININET} --remote-address ${CONTROLLER} 2>&1 | tee pccmock.log
+ ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_IP} 2>&1 | tee pccmock.log
Log ${command}
Write ${command}
Read_Until started, sent proposal Open
[Documentation] Create SSH session to Mininet machine, prepare HTTP client session to Controller.
... Figure out latest pcc-mock version and download it from Nexus to Mininet.
... Also, delete and create directories for json diff handling.
- SSHLibrary.Open_Connection ${MININET} prompt=${MININET_PROMPT} timeout=${OUTPUT_TIMEOUT}
- Utils.Flexible_Mininet_Login
+ NexusKeywords.Initialize_Artifact_Deployment_And_Usage
# FIXME: Unify Module prefix usage across whole file.
- Create_Session ses http://${CONTROLLER}:${RESTCONFPORT}/restconf/operational/network-topology:network-topology auth=${AUTH}
- ${urlbase}= Set_Variable ${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/bgpcep/pcep-pcc-mock
- ${version}= Execute_Command curl ${urlbase}/maven-metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1
- Log ${version}
- ${namepart}= Execute_Command curl ${urlbase}/${version}/maven-metadata.xml | grep value | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1
- Log ${namepart}
- Set_Suite_Variable ${filename} pcep-pcc-mock-${namepart}-executable.jar
- Log ${filename}
- ${response}= Execute_Command wget -q -N ${urlbase}/${version}/${filename} 2>&1
- Log ${response}
+ Create_Session ses http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/restconf/operational/network-topology:network-topology auth=${AUTH}
+ ${name}= NexusKeywords.Deploy_Test_Tool bgpcep pcep-pcc-mock
+ BuiltIn.Set_Suite_Variable ${filename} ${name}
Remove_Directory ${ExpDir}
Remove_Directory ${ActDir}
Create_Directory ${ExpDir}
[Documentation] Get current pcep-topology as json, normalize both expected and actual json.
... Save normalized jsons to files for later processing.
... Error codes and normalized jsons should match exactly.
- ${normexp}= Hsf_Json ${expected}
+ ${normexp}= norm_json.normalize_json_text ${expected}
Log ${normexp}
Create_File ${ExpDir}${/}${name} ${normexp}
- ${resp}= RequestsLibrary.Get ses topology/pcep-topology
+ ${resp}= RequestsLibrary.Get Request ses topology/pcep-topology
Log ${resp}
Log ${resp.text}
- ${normresp}= Hsf_Json ${resp.text}
+ ${normresp}= norm_json.normalize_json_text ${resp.text}
Log ${normresp}
Create_File ${ActDir}${/}${name} ${normresp}
Should_Be_Equal_As_Strings ${resp.status_code} 200