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 <jbehran@cisco.com>
${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