Extracted Nexus artifact deployment code
[integration/test.git] / csit / suites / bgpcep / pcepuser / pcepuser.robot
index 4c320b4a1a0ca2b275fc3d2d2804c25dc2fbf8c7..3f7d72c510368639465d3f6156db67b135c83af4 100644 (file)
@@ -9,14 +9,19 @@ Documentation     Basic tests for odl-bgpcep-pcep-all feature.
 Suite Setup       Set_It_Up
 Suite Teardown    Tear_It_Down
 Library           OperatingSystem
-Library           SSHLibrary    prompt=]>
+Library           SSHLibrary
 Library           RequestsLibrary
 Library           ${CURDIR}/../../../libraries/HsfJson/hsf_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 ***
+${MININET_PROMPT}    ${DEFAULT_LINUX_PROMPT}
+${OUTPUT_TIMEOUT}    10
+# FIXME: Unify parameter naming and case.
 ${ExpDir}         ${CURDIR}/expected
 ${ActDir}         ${CURDIR}/actual
 
@@ -113,18 +118,12 @@ 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.
-    Open_Connection    ${MININET}
-    Login_With_Public_Key    ${MININET_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
+    SSHLibrary.Open_Connection    ${MININET}    prompt=${MININET_PROMPT}    timeout=${OUTPUT_TIMEOUT}
+    Utils.Flexible_Mininet_Login
+    # 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}
+    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep/pcep-pcc-mock
+    BuiltIn.Set_Suite_Variable    ${filename}    ${name}
     Remove_Directory    ${ExpDir}
     Remove_Directory    ${ActDir}
     Create_Directory    ${ExpDir}