From: Vratko Polak Date: Tue, 9 Feb 2016 12:14:51 +0000 (+0100) Subject: Use fallback URL for deploying tools for custom-built .zip X-Git-Tag: release/beryllium-sr1~113 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F34319%2F4;p=integration%2Ftest.git Use fallback URL for deploying tools for custom-built .zip NexusKeywords.Deploy_Artifact was assuming that ${BUNDLE_URL} points to a full Nexus installation. But if the bundle under test comes from another source (most notably patch test job on Jenkins, either RelEng or Sandbox) there are no test tools on similar URLs. In that case, fall back to default ODL Nexus (snapshot repository). Change-Id: Icdd09da8ca219d26b42ca60e6aee0520220e9c31 Signed-off-by: Vratko Polak --- diff --git a/csit/libraries/NexusKeywords.robot b/csit/libraries/NexusKeywords.robot index 145bb66afe..90178aa331 100644 --- a/csit/libraries/NexusKeywords.robot +++ b/csit/libraries/NexusKeywords.robot @@ -16,6 +16,9 @@ Library SSHLibrary Library String Resource SSHKeywords.robot +*** Variables *** +${NEXUS_FALLBACK_URL} http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot + *** Keywords *** Initialize_Artifact_Deployment_And_Usage [Arguments] ${tools_system_connect}=True @@ -60,13 +63,16 @@ NexusKeywords__Detect_Version_To_Pull [Return] ${version} ${location} Deploy_Artifact - [Arguments] ${component} ${artifact} ${name_prefix} ${name_suffix}=-executable.jar + [Arguments] ${component} ${artifact} ${name_prefix} ${name_suffix}=-executable.jar ${fallback_url}=${NEXUS_FALLBACK_URL} [Documentation] Deploy the specified artifact from Nexus to the cwd of the machine to which the active SSHLibrary connection points. ... Must have ${BUNDLE_URL} variable set to the URL from which the ... tested ODL distribution was downloaded and this place must be ... inside a repository created by a standard distribution - ... construction job. + ... construction job. If this is detected to ne be the case, fallback URL is used. ${urlbase}= String.Fetch_From_Left ${BUNDLE_URL} /org/opendaylight + # If the BUNDLE_URL points somewhere else (perhaps *patch-test* job in Jenkins), + # ${urlbase} is the whole ${BUNDLE_URL}, in which case we use the ${fallback_url} + ${urlbase}= BuiltIn.Set_Variable_If '${urlbase}' != '${BUNDLE_URL}' ${urlbase} ${fallback_url} ${version} ${location}= NexusKeywords__Detect_Version_To_Pull ${component} # TODO: Use RequestsLibrary and String instead of curl and bash utilities? ${url}= BuiltIn.Set_Variable ${urlbase}/${location}/${artifact}/${version}