From f48aae09bf0133c409c92e8caab8c598b9ce63d2 Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Tue, 28 Feb 2017 10:56:46 +0800 Subject: automated: utils: improve upload-to-artifactorial.sh * Only do attachment uploading in LAVA * Use basename of "${ATTACHMENT}" in case it includes a path Change-Id: I4893da2b16766a64152804be47ee8853a162534a Signed-off-by: Chase Qi --- automated/utils/upload-to-artifactorial.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'automated/utils/upload-to-artifactorial.sh') diff --git a/automated/utils/upload-to-artifactorial.sh b/automated/utils/upload-to-artifactorial.sh index be307bf..a992b27 100755 --- a/automated/utils/upload-to-artifactorial.sh +++ b/automated/utils/upload-to-artifactorial.sh @@ -24,18 +24,18 @@ if [ -z "${URL}" ]; then exit 0 fi -if [ -z "${TOKEN}" ]; then - return=$(curl -F "path=@${ATTACHMENT}" "${URL}") -else - return=$(curl -F "path=@${ATTACHMENT}" -F "token=${TOKEN}" "${URL}") -fi +if which lava-test-reference; then + if [ -z "${TOKEN}" ]; then + return=$(curl -F "path=@${ATTACHMENT}" "${URL}") + else + return=$(curl -F "path=@${ATTACHMENT}" -F "token=${TOKEN}" "${URL}") + fi -if echo "${return}" | grep "${ATTACHMENT}"; then - if which lava-test-reference; then + if echo "${return}" | grep "$(basename "${ATTACHMENT}")"; then lava-test-reference "test-attachment" --result "pass" --reference "https://archive.validation.linaro.org/artifacts/${return}" else - echo "test-attachment skip" | tee -a "${RESULT_FILE}" + echo "test-attachment fail" | tee -a "${RESULT_FILE}" fi else - echo "test-attachment fail" | tee -a "${RESULT_FILE}" + echo "test-attachment skip" | tee -a "${RESULT_FILE}" fi -- cgit v1.2.3