Add Nexus artifact deployment initialization keyword 94/33994/2
authorJozef Behran <jbehran@cisco.com>
Wed, 3 Feb 2016 11:14:42 +0000 (12:14 +0100)
committerJozef Behran <jbehran@cisco.com>
Thu, 4 Feb 2016 08:50:47 +0000 (09:50 +0100)
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>
csit/libraries/NetconfKeywords.robot
csit/libraries/NexusKeywords.robot
csit/libraries/SSHKeywords.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot
csit/suites/netconf/CRUD/CRUD.robot
csit/suites/netconf/clustering/CRUD.robot
csit/suites/netconf/scale/getmulti.robot
csit/suites/netconf/scale/getsingle.robot

index 3abcb002efd513fa173853d280e2c387cfd7898e..e420a64215412b7c3c37d4c2b406637ff3046b29 100644 (file)
@@ -33,6 +33,7 @@ Setup_NetconfKeywords
     ${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}
index 6928891a9d81917e8225e62de61c344542587063..f3fb87cda098d6097a03bf3c91079c3e95c46033 100644 (file)
@@ -12,8 +12,16 @@ Documentation     Nexus repository access keywords.
 ...               netconf operations into reusable keywords to make writing netconf
 ...               test suites easier.
 Library           SSHLibrary
+Resource          SSHKeywords.robot
 
 *** Keywords ***
+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}
index 1e772fd6f43c98d0d34c16debe692cabe9c678b2..e38cc5f32ca60d96e05f150d4126cc996f641466 100644 (file)
@@ -13,8 +13,15 @@ Documentation     Resource enhancing SSHLibrary with Keywords used in multiple s
 ...               and if the Keywords do not fit into a more specific Resource,
 ...               you can place them here.
 Library           SSHLibrary
+Resource          ${CURDIR}/Utils.robot
 
 *** Keywords ***
+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.
index 3f7d72c510368639465d3f6156db67b135c83af4..20b3d7972bc5b20352eb62b46a6d0b4d39f2a987 100644 (file)
@@ -118,8 +118,7 @@ Set_It_Up
     [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
index c53f2df1426efb28b24df10e125cbeda7c2bef20..6faaf4f6db7fef462cf627578b57aa975ec6de07 100644 (file)
@@ -156,8 +156,7 @@ Set_It_Up
     [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}
index 7e96a57bd52da3321943a27cf261c4b2f4b2c54a..87431997c3529378514a70b8962ecfb6e23a9cb9 100644 (file)
@@ -120,9 +120,6 @@ Setup_Everything
     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.
index 85d68e0ff6c6cfe8e323446671275f945a5fa7c9..f29e6f2f84591da2187c59d93155a9e6e01a5bf9 100644 (file)
@@ -210,9 +210,6 @@ Setup_Everything
     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.
index c184713d07d72895fd1ac5eaf0351f8d76515840..b9eb4f67d9151a44833ae5529228670973ab50b8 100644 (file)
@@ -77,10 +77,7 @@ Setup_Everything
     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
 
index a239b500f19a9b5cfe23a1bd4f7f2e49060c724a..c00425fc6ea65188d97e3230ae0d6445d9b53dc6 100644 (file)
@@ -58,9 +58,6 @@ Setup_Everything
     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.