Currently this Nexus artifact deployment initialization
keyword contains the code to connect to the tools system,
which was extracted into a keyword in SSHKeywords. This
artifact deployment initialization keyword is then called
in all suites that need to deploy test tools so any code
that explicitly opens this connection was removed from the
suites that need the Nexus artifact deployment facility.
For Netconf test suite this setup keyowrd gets called
automatically from NetconfKeywords setup keyword so
no explicit Nexus keywords initialization is done there.
This is a part of working around the bug 5206.
Change-Id: If46823d7aba92657b99d050e3098ec7c99895824
Signed-off-by: Jozef Behran <jbehran@cisco.com>
${tmp}= BuiltIn.Create_Dictionary
BuiltIn.Set_Suite_Variable ${NetconfKeywords__mounted_device_types} ${tmp}
NetconfViaRestconf.Setup_Netconf_Via_Restconf
${tmp}= BuiltIn.Create_Dictionary
BuiltIn.Set_Suite_Variable ${NetconfKeywords__mounted_device_types} ${tmp}
NetconfViaRestconf.Setup_Netconf_Via_Restconf
+ NexusKeywords.Initialize_Artifact_Deployment_And_Usage
Configure_Device_In_Netconf
[Arguments] ${device_name} ${device_type}=default ${device_port}=${FIRST_TESTTOOL_PORT}
Configure_Device_In_Netconf
[Arguments] ${device_name} ${device_type}=default ${device_port}=${FIRST_TESTTOOL_PORT}
... netconf operations into reusable keywords to make writing netconf
... test suites easier.
Library SSHLibrary
... netconf operations into reusable keywords to make writing netconf
... test suites easier.
Library SSHLibrary
+Resource SSHKeywords.robot
+Initialize_Artifact_Deployment_And_Usage
+ [Documentation] Initialize Nexus artifact deployment and usage
+ ... Create and activate a connection to the tools system and perform
+ ... additional configuration to allow the remaining keywords to deploy
+ ... and use artifacts from Nexus on the tools system.
+ SSHKeywords.Open_Connection_To_Tools_System
+
NexusKeywords__Get_Version_From_Metadata
${version}= SSHLibrary.Execute_Command cat metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1
BuiltIn.Log ${version}
NexusKeywords__Get_Version_From_Metadata
${version}= SSHLibrary.Execute_Command cat metadata.xml | grep latest | cut -d '>' -f 2 | cut -d '<' -f 1
BuiltIn.Log ${version}
... and if the Keywords do not fit into a more specific Resource,
... you can place them here.
Library SSHLibrary
... and if the Keywords do not fit into a more specific Resource,
... you can place them here.
Library SSHLibrary
+Resource ${CURDIR}/Utils.robot
+Open_Connection_To_Tools_System
+ [Documentation] Open a connection to the tools system and return its identifier.
+ ${tools}= SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT}
+ Utils.Flexible_Mininet_Login
+ [Return] ${tools}
+
Execute_Command_Passes
[Arguments] ${command}
[Documentation] Execute command via SSH. If RC is nonzero, log everything. Retrun bool string of command success.
Execute_Command_Passes
[Arguments] ${command}
[Documentation] Execute command via SSH. If RC is nonzero, log everything. Retrun bool string of command success.
[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.
[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}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep/pcep-pcc-mock
# FIXME: Unify Module prefix usage across whole file.
Create_Session ses http://${CONTROLLER}:${RESTCONFPORT}/restconf/operational/network-topology:network-topology auth=${AUTH}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep/pcep-pcc-mock
[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.
[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}
- SSHLibrary.Login_With_Public_Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
+ NexusKeywords.Initialize_Artifact_Deployment_And_Usage
${current_connection}= SSHLibrary.Get_Connection
${current_prompt}= BuiltIn.Set_Variable ${current_connection.prompt}
BuiltIn.Log ${current_prompt}
${current_connection}= SSHLibrary.Get_Connection
${current_prompt}= BuiltIn.Set_Variable ${current_connection.prompt}
BuiltIn.Log ${current_prompt}
SetupUtils.Setup_Utils_For_Setup_And_Teardown
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
NetconfKeywords.Setup_Netconf_Keywords
SetupUtils.Setup_Utils_For_Setup_And_Teardown
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
NetconfKeywords.Setup_Netconf_Keywords
- # Connect to the Mininet machine
- SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT}
- Utils.Flexible_Mininet_Login
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
NetconfViaRestconf.Create_NVR_Session node1 ${ODL_SYSTEM_1_IP}
NetconfViaRestconf.Create_NVR_Session node2 ${ODL_SYSTEM_2_IP}
NetconfViaRestconf.Create_NVR_Session node3 ${ODL_SYSTEM_3_IP}
NetconfViaRestconf.Create_NVR_Session node1 ${ODL_SYSTEM_1_IP}
NetconfViaRestconf.Create_NVR_Session node2 ${ODL_SYSTEM_2_IP}
NetconfViaRestconf.Create_NVR_Session node3 ${ODL_SYSTEM_3_IP}
- # Connect to the Mininet machine
- SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT}
- Utils.Flexible_Mininet_Login
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
SSHLibrary.Set_Default_Configuration prompt=${TOOLS_SYSTEM_PROMPT}
SetupUtils.Setup_Utils_For_Setup_And_Teardown
NetconfKeywords.Setup_Netconf_Keywords
SSHLibrary.Set_Default_Configuration prompt=${TOOLS_SYSTEM_PROMPT}
SetupUtils.Setup_Utils_For_Setup_And_Teardown
NetconfKeywords.Setup_Netconf_Keywords
- # Connect to the tools machine
- SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP}
- Utils.Flexible_Mininet_Login
- # Deploy testing tools on it.
+ # Deploy testing tools.
SSHLibrary.Put_File ${CURDIR}/../../../../tools/netconf_tools/getter.py
SSHLibrary.Put_File ${CURDIR}/../../../libraries/AuthStandalone.py
SSHLibrary.Put_File ${CURDIR}/../../../../tools/netconf_tools/getter.py
SSHLibrary.Put_File ${CURDIR}/../../../libraries/AuthStandalone.py
SetupUtils.Setup_Utils_For_Setup_And_Teardown
NetconfKeywords.Setup_Netconf_Keywords
KarafKeywords.Configure_Timeout_For_Karaf_Console 120s
SetupUtils.Setup_Utils_For_Setup_And_Teardown
NetconfKeywords.Setup_Netconf_Keywords
KarafKeywords.Configure_Timeout_For_Karaf_Console 120s
- # Connect to the tools machine
- SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP}
- Utils.Flexible_Mininet_Login
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.
Teardown_Everything
[Documentation] Teardown the test infrastructure, perform cleanup and release all resources.