From: Jozef Behran Date: Thu, 4 Feb 2016 16:28:47 +0000 (+0100) Subject: Add missing error checks to the artifact deployer X-Git-Tag: release/beryllium-sr1~134 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=integration%2Ftest.git;a=commitdiff_plain;h=5fe9599fa87cb677ab518add53a143e6c2ed6d6b Add missing error checks to the artifact deployer When the artifact is not found or not downloaded, abort the test suite with a fatal error rather than returning some bogus file name and letting the Robot wasting time waiting for timeouts while the Java is trying to run a nonexistent tool. Change-Id: I5c8b227057a25caef2e30d0cad28e1a2f76dd6e6 Signed-off-by: Jozef Behran --- diff --git a/csit/libraries/NexusKeywords.robot b/csit/libraries/NexusKeywords.robot index f3fb87cda0..83105a711a 100644 --- a/csit/libraries/NexusKeywords.robot +++ b/csit/libraries/NexusKeywords.robot @@ -40,10 +40,14 @@ Deploy_Artifact ${version}= NexusKeywords__Get_Version_From_Metadata ${namepart}= SSHLibrary.Execute_Command curl ${urlbase}/${version}/maven-metadata.xml | grep value | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1 BuiltIn.Log ${namepart} + ${length}= BuiltIn.Get_Length ${namepart} + BuiltIn.Run_Keyword_If ${length} == 0 BuiltIn.Fail Artifact "${artifact}" not found in component "${component}" ${filename}= BuiltIn.Set_Variable ${name_prefix}${namepart}${name_suffix} BuiltIn.Log ${filename} - ${response}= SSHLibrary.Execute_Command wget -q -N ${urlbase}/${version}/${filename} 2>&1 + ${url}= BuiltIn.Set_Variable ${urlbase}/${version}/${filename} + ${response} ${result}= SSHLibrary.Execute_Command wget -q -N ${url} 2>&1 return_rc=True BuiltIn.Log ${response} + BuiltIn.Run_Keyword_If ${result} != 0 BuiltIn.Fail Artifact "${artifact}" in component "${component}" could not be downloaded from ${url} [Return] ${filename} Deploy_Test_Tool