Fix typo in comparison operator in Open_Controller_Karaf_Console_On_Background for...
[integration/test.git] / csit / libraries / NexusKeywords.robot
index 9ef7e74c31634db1506004136d8f0a4709bd39e9..4656840f46e89d40040565224b3214390004feae 100644 (file)
@@ -1,16 +1,16 @@
 *** Settings ***
 Documentation     Nexus repository access keywords, and supporting Java and Maven handling.
-...           
+...
 ...               Copyright (c) 2015,2016 Cisco Systems, Inc. and others. All rights reserved.
-...           
+...
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
-...           
-...           
+...
+...
 ...               This library encapsulates a bunch of somewhat complex and commonly used
 ...               Nexus operations into reusable keywords to make writing test suites easier.
-...           
+...
 ...               Currently, Java version detection is incorporated so that Java tools can be run reliably.
 ...               Also, suport for installing and running Maven is added, as that needs the Java detection.
 ...               TODO: Move Java detection and Maven to a separate Resource, or rename this Resource.
@@ -26,8 +26,8 @@ Resource          ${CURDIR}/SSHKeywords.robot
 Resource          ${CURDIR}/Utils.robot
 
 *** Variables ***
-&{COMPONENT_MAPPING}    netconf=netconf-impl    bgpcep=pcep-impl    carpeople=clustering-it-model    yangtools=yang-data-impl    bindingv1=mdsal-binding-generator-impl
-@{RELEASE_INTEGRATED_COMPONENTS}    mdsal    odlparent    yangtools
+&{COMPONENT_MAPPING}    netconf=netconf-impl    bgpcep=pcep-impl    carpeople=clustering-it-model    yangtools=yang-data-impl    bindingv1=mdsal-binding-generator-impl    odl-micro=odlmicro-impl
+@{RELEASE_INTEGRATED_COMPONENTS}    mdsal    odlparent    yangtools    carpeople
 ${JDKVERSION}     None
 ${JAVA_8_HOME_CENTOS}    /usr/lib/jvm/java-1.8.0
 ${JAVA_8_HOME_UBUNTU}    /usr/lib/jvm/java-8-openjdk-amd64
@@ -99,7 +99,7 @@ Deploy_From_Url
     [Return]    ${filename}
 
 Deploy_Artifact
-    [Arguments]    ${component}    ${artifact}    ${name_prefix}=${artifact}-    ${name_suffix}=-executable.jar    ${fallback_url}=${NEXUS_FALLBACK_URL}    ${explicit_url}=${EMPTY}
+    [Arguments]    ${component}    ${artifact}    ${name_prefix}=${artifact}-    ${name_suffix}=-executable.jar    ${fallback_url}=${NEXUS_FALLBACK_URL}    ${explicit_url}=${EMPTY}    ${build_version}=${EMPTY}    ${build_location}=${EMPTY}
     [Documentation]    Deploy the specified artifact from Nexus to the cwd of the machine to which the active SSHLibrary connection points.
     ...    ${component} is a name part of an artifact present in system/ of ODl installation with the same version as ${artifact} should have.
     ...    Must have ${BUNDLE_URL} variable set to the URL from which the
@@ -115,8 +115,10 @@ Deploy_Artifact
     # If we are working with a "release integrated" project, we always will want to look for
     # a released version, not in the snapshots
     ${urlbase} =    BuiltIn.Set_Variable_If    '${urlbase}' != '${BUNDLE_URL}'    ${urlbase}    ${fallback_url}
+    CompareStream.Run_Keyword_If_At_Most_Magnesium    Collections.Remove_Values_From_List    ${RELEASE_INTEGRATED_COMPONENTS}    carpeople
     ${urlbase} =    BuiltIn.Set_Variable_If    '${component}' in @{RELEASE_INTEGRATED_COMPONENTS}    ${NEXUS_RELEASE_BASE_URL}    ${urlbase}
-    ${version}    ${location} =    NexusKeywords__Detect_Version_To_Pull    ${component}
+    ${version}    ${location} =    BuiltIn.Run_Keyword_If    '${build_version}'=='${EMPTY}'    NexusKeywords__Detect_Version_To_Pull    ${component}
+    ...    ELSE    BuiltIn.Set_Variable    ${build_version}    ${build_location}
     # TODO: Use RequestsLibrary and String instead of curl and bash utilities?
     ${url} =    BuiltIn.Set_Variable    ${urlbase}/${location}/${artifact}/${version}
     # TODO: Review SSHKeywords for current best keywords to call.
@@ -133,7 +135,7 @@ Deploy_Artifact
     [Return]    ${filename}
 
 Deploy_Test_Tool
-    [Arguments]    ${component}    ${artifact}    ${suffix}=executable    ${fallback_url}=${NEXUS_FALLBACK_URL}    ${explicit_url}=${EMPTY}
+    [Arguments]    ${component}    ${artifact}    ${suffix}=executable    ${fallback_url}=${NEXUS_FALLBACK_URL}    ${explicit_url}=${EMPTY}    ${build_version}=${EMPTY}    ${build_location}=${EMPTY}
     [Documentation]    Deploy a test tool.
     ...    The test tools have naming convention of the form
     ...    "<repository_url>/some/dir/somewhere/<tool-name>/<tool-name>-<version-tag>-${suffix}.jar"
@@ -143,9 +145,10 @@ Deploy_Test_Tool
     ...    "Deploy_Artifact" and then calls "Deploy_Artifact" to do the real
     ...    work of deploying the artifact.
     ${name_prefix} =    BuiltIn.Set_Variable    ${artifact}-
-    ${name_suffix} =    BuiltIn.Set_Variable_If    "${suffix}" != ""    -${suffix}.jar    .jar
+    ${extension} =    BuiltIn.Set_Variable_If    '${component}'=='odl-micro'    tar    jar
+    ${name_suffix} =    BuiltIn.Set_Variable_If    "${suffix}" != ""    -${suffix}.${extension}    .${extension}
     ${filename} =    Deploy_Artifact    ${component}    ${artifact}    ${name_prefix}    ${name_suffix}    ${fallback_url}
-    ...    ${explicit_url}
+    ...    ${explicit_url}    ${build_version}    ${build_location}
     [Return]    ${filename}
 
 Install_And_Start_Java_Artifact