Split "name" of test tool to "component" and "artifact" 95/34095/2
authorJozef Behran <jbehran@cisco.com>
Thu, 4 Feb 2016 17:12:11 +0000 (18:12 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 4 Feb 2016 17:25:14 +0000 (17:25 +0000)
The "name" of the test tool was an ad-hoc specification of
the test tool that the deployment framework was needed to
somehow use to locate the artifact in Nexus. After reviewing
the code that searches for the artifact I decided to separate
the "component" and the "artifact" into their own arguments
to make this distinction explicit. This is also necessary
to support the increasing complexity of the artifact search.

Change-Id: I3c6677c4aa191c03cc01ef35ad54a359d2320a1d
Signed-off-by: Jozef Behran <jbehran@cisco.com>
csit/libraries/NetconfKeywords.robot
csit/libraries/NexusKeywords.robot
csit/suites/bgpcep/pcepuser/pcepuser.robot
csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot

index e420a64215412b7c3c37d4c2b406637ff3046b29..66907f612d07fc235200cebecf49a3a81442724f 100644 (file)
@@ -148,7 +148,7 @@ Install_And_Start_Testtool
     ...    for the additional schemas is deleted on the remote machine and
     ...    the additional schemas argument is left out.
     # Install test tool on the machine.
-    ${filename}=    NexusKeywords.Deploy_Test_Tool    netconf/netconf-testtool
+    ${filename}=    NexusKeywords.Deploy_Test_Tool    netconf    netconf-testtool
     ${schemas_option}=    NetconfKeywords__Deploy_Additional_Schemas    ${schemas}
     # Start the testtool
     ${command}    BuiltIn.Set_Variable    java ${java_options} -jar ${filename} ${tool_options} --device-count ${device-count} --debug ${debug} ${schemas_option} --md-sal ${mdsal}
index 83105a711a47ccc24bbeec24a0a6dc565d8e6e5e..e6853f8e61dc573c705b822756656bd604c50ae7 100644 (file)
@@ -31,9 +31,9 @@ NexusKeywords__Get_Version_From_Metadata
     BuiltIn.Fail    Unrecognized metadata format, cannot determine the location of the requested artifact.
 
 Deploy_Artifact
-    [Arguments]    ${directory}    ${name_prefix}    ${name_suffix}=-executable.jar    ${type}=snapshot
+    [Arguments]    ${component}    ${artifact}    ${name_prefix}    ${name_suffix}=-executable.jar    ${type}=snapshot
     [Documentation]    Deploy the specified artifact from Nexus to the cwd of the machine to which the active SSHLibrary connection points.
-    ${urlbase}=    BuiltIn.Set_Variable    ${NEXUSURL_PREFIX}/content/repositories/opendaylight.${type}/org/opendaylight/${directory}
+    ${urlbase}=    BuiltIn.Set_Variable    ${NEXUSURL_PREFIX}/content/repositories/opendaylight.${type}/org/opendaylight/${component}/${artifact}
     ${response}=    SSHLibrary.Execute_Command    curl ${urlbase}/maven-metadata.xml >metadata.xml
     BuiltIn.Log    ${response}
     # TODO: Use RequestsLibrary and String instead of curl and bash utilities?
@@ -51,7 +51,7 @@ Deploy_Artifact
     [Return]    ${filename}
 
 Deploy_Test_Tool
-    [Arguments]    ${name}    ${suffix}=executable    ${type}=snapshot
+    [Arguments]    ${component}    ${artifact}    ${suffix}=executable    ${type}=snapshot
     [Documentation]    Deploy a test tool.
     ...    The test tools have naming convention of the form
     ...    "${type}/some/dir/somewhere/<tool-name>/<tool-name>-<version-tag>-${suffix}.jar"
@@ -60,8 +60,7 @@ Deploy_Test_Tool
     ...    keyword calculates ${name_prefix} and ${name_suffix} for
     ...    "Deploy_Artifact" and then calls "Deploy_Artifact" to do the real
     ...    work of deploying the artifact.
-    ${name_part}=    BuiltIn.Evaluate    '${name}'.split("/").pop()
-    ${name_prefix}=    BuiltIn.Set_Variable    ${name_part}-
+    ${name_prefix}=    BuiltIn.Set_Variable    ${artifact}-
     ${name_suffix}=    BuiltIn.Set_Variable    -${suffix}.jar
-    ${filename}=    Deploy_Artifact    ${name}    ${name_prefix}    ${name_suffix}    ${type}
+    ${filename}=    Deploy_Artifact    ${component}    ${artifact}    ${name_prefix}    ${name_suffix}    ${type}
     [Return]    ${filename}
index 20b3d7972bc5b20352eb62b46a6d0b4d39f2a987..eb5609089b55318dc86d0053e2304227ed27b114 100644 (file)
@@ -121,7 +121,7 @@ Set_It_Up
     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
+    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep    pcep-pcc-mock
     BuiltIn.Set_Suite_Variable    ${filename}    ${name}
     Remove_Directory    ${ExpDir}
     Remove_Directory    ${ActDir}
index 6faaf4f6db7fef462cf627578b57aa975ec6de07..bc717f4d590342f109d258fe767fefe9f1a3af13 100644 (file)
@@ -162,7 +162,7 @@ Set_It_Up
     BuiltIn.Log    ${current_prompt}
     BuiltIn.Set_Suite_Variable    ${prompt}    ${current_prompt}
     RequestsLibrary.Create_Session    ses    http://${CONTROLLER}:${RESTCONFPORT}${OPERATIONAL_TOPO_API}    auth=${AUTH}
-    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep/pcep-pcc-mock
+    ${name}=    NexusKeywords.Deploy_Test_Tool    bgpcep    pcep-pcc-mock
     BuiltIn.Set_Suite_Variable    ${filename}    ${name}
     OperatingSystem.Remove_Directory    ${directory_for_expected_responses}    recursive=True
     OperatingSystem.Remove_Directory    ${directory_for_actual_responses}    recursive=True