summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2018-02-22 08:44:41 +0000
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2018-04-09 10:33:53 +0100
commit6bb7a68790976dfff1ec7cfaa05b04a8407afd46 (patch)
tree37cf287e336613f1650aefd8e052c8093005418b
parentf0efbad9485e60365a56b8774ef04f759307a079 (diff)
automated: workload-automation: allow for custom output path
In order to make result postprocessing possible in the LAVA job, WA results can now be saved in the custom path that can be set as parameter Change-Id: If9faac3d20fa10297ed8dc65aa5b2f3a0dae0ea4 Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
-rwxr-xr-xautomated/android/workload-automation/workload-automation.sh12
-rw-r--r--automated/android/workload-automation/workload-automation.yaml12
-rwxr-xr-xautomated/linux/workload-automation/workload-automation.sh12
-rw-r--r--automated/linux/workload-automation/workload-automation.yaml12
4 files changed, 34 insertions, 14 deletions
diff --git a/automated/android/workload-automation/workload-automation.sh b/automated/android/workload-automation/workload-automation.sh
index 68c997d..f1992c7 100755
--- a/automated/android/workload-automation/workload-automation.sh
+++ b/automated/android/workload-automation/workload-automation.sh
@@ -3,8 +3,6 @@
TEST_DIR=$(dirname "$(realpath "$0")")
OUTPUT="${TEST_DIR}/output"
-RESULT_FILE="${OUTPUT}/result.txt"
-export RESULT_FILE
SKIP_INSTALL="false"
ANDROID_SERIAL=""
BOOT_TIMEOUT="300"
@@ -18,11 +16,11 @@ BUILD_TOOLS_URL="http://testdata.validation.linaro.org/apks/workload-automation/
WA_HOME_URL="http://testdata.validation.linaro.org/apks/workload-automation/workload_automation_home.tar.gz"
usage() {
- echo "Usage: $0 [-s <true|false>] [-S <android_serial>] [-t <boot_timeout>] [-T <wa_tag>] [-r <wa_templates_repo>] [-g <templates_branch>] [-c <config>] [-a <agenda>] [-b <build_tools_url>] [-w <wa_home_url>] [-p <aep_path>]" 1>&2
+ echo "Usage: $0 [-s <true|false>] [-S <android_serial>] [-t <boot_timeout>] [-T <wa_tag>] [-r <wa_templates_repo>] [-g <templates_branch>] [-c <config>] [-a <agenda>] [-b <build_tools_url>] [-w <wa_home_url>] [-p <aep_path>] [-o <output_dir>]" 1>&2
exit 1
}
-while getopts ":s:S:t:T:r:g:c:a:b:w:p:" opt; do
+while getopts ":s:S:t:T:r:g:c:a:b:w:p:o:" opt; do
case "${opt}" in
s) SKIP_INSTALL="${OPTARG}" ;;
S) ANDROID_SERIAL="${OPTARG}" ;;
@@ -35,6 +33,7 @@ while getopts ":s:S:t:T:r:g:c:a:b:w:p:" opt; do
b) BUILD_TOOLS_URL="${OPTARG}" ;;
w) WA_HOME_URL="${OPTARG}" ;;
p) PROBE="${OPTARG}" ;;
+ o) NEW_OUTPUT="${OPTARG}" ;;
*) usage ;;
esac
done
@@ -43,7 +42,12 @@ done
. "${TEST_DIR}/../../lib/android-test-lib"
cd "${TEST_DIR}"
+if [ ! -z "${NEW_OUTPUT}" ]; then
+ OUTPUT="${NEW_OUTPUT}"
+fi
create_out_dir "${OUTPUT}"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
info_msg "WA installation skipped"
diff --git a/automated/android/workload-automation/workload-automation.yaml b/automated/android/workload-automation/workload-automation.yaml
index 4aa8a7e..e5dc2b9 100644
--- a/automated/android/workload-automation/workload-automation.yaml
+++ b/automated/android/workload-automation/workload-automation.yaml
@@ -32,6 +32,9 @@ params:
# allow extra extenstions for WA
WA_EXTENSION_PATHS: ""
PROBE: ""
+ # directory where the WA results are stored
+ # defaults to {TEST_DIR}/output
+ OUTPUT: ""
# Specify url and token for publishing artifacts.
# For safety reasons, please set 'ARTIFACTORIAL_TOKEN' variable in job definition with
# 'secrets' dictionary, and set job visibility to personal or group.
@@ -43,10 +46,13 @@ run:
steps:
- export WA_EXTENSION_PATHS=$WA_EXTENSION_PATHS
- cd ./automated/android/workload-automation
+ - echo ${OUTPUT}
+ - if [ -z "${OUTPUT}" ]; then OUTPUT="./output"; fi
+ - echo ${OUTPUT}
# Test run.
- - ./workload-automation.sh -s "${SKIP_INSTALL}" -t "${BOOT_TIMEOUT}" -S "${ANDROID_SERIAL}" -T "${WA_TAG}" -r "${WA_TEMPLATES_REPO}" -g "${TEMPLATES_BRANCH}" -c "${CONFIG}" -a "${AGENDA}" -b "${BUILD_TOOLS_URL}" -w "${WA_HOME_URL}" -p "${PROBE}"
+ - ./workload-automation.sh -s "${SKIP_INSTALL}" -t "${BOOT_TIMEOUT}" -S "${ANDROID_SERIAL}" -T "${WA_TAG}" -r "${WA_TEMPLATES_REPO}" -g "${TEMPLATES_BRANCH}" -c "${CONFIG}" -a "${AGENDA}" -b "${BUILD_TOOLS_URL}" -w "${WA_HOME_URL}" -p "${PROBE}" -o "${OUTPUT}"
# Upload test output to artifactorial.
- - tar caf "wa-output.tar.xz" "./output"
+ - tar caf "wa-output.tar.xz" "${OUTPUT}"
- ../../utils/upload-to-artifactorial.sh -a "wa-output.tar.xz" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
# Send test result to LAVA.
- - ../../utils/send-to-lava.sh "./output/result.txt"
+ - ../../utils/send-to-lava.sh "${OUTPUT}/result.txt"
diff --git a/automated/linux/workload-automation/workload-automation.sh b/automated/linux/workload-automation/workload-automation.sh
index d9d7b57..065f9d6 100755
--- a/automated/linux/workload-automation/workload-automation.sh
+++ b/automated/linux/workload-automation/workload-automation.sh
@@ -3,8 +3,6 @@
TEST_DIR=$(dirname "$(realpath "$0")")
OUTPUT="${TEST_DIR}/output"
-RESULT_FILE="${OUTPUT}/result.txt"
-export RESULT_FILE
SKIP_INSTALL="false"
WA_TAG="master"
@@ -14,11 +12,11 @@ CONFIG="config/generic-linux-localhost.py"
AGENDA="agenda/linux-dhrystone.yaml"
usage() {
- echo "Usage: $0 [-s <true|false>] [-t <wa_tag>] [-r <wa_templates_repo>] [-T <templates_branch>] [-c <config>] [-a <agenda>]" 1>&2
+ echo "Usage: $0 [-s <true|false>] [-t <wa_tag>] [-r <wa_templates_repo>] [-T <templates_branch>] [-c <config>] [-a <agenda>] [-o <output_dir> ]" 1>&2
exit 1
}
-while getopts ":s:t:r:T:c:a:" opt; do
+while getopts ":s:t:r:T:c:a:o:" opt; do
case "${opt}" in
s) SKIP_INSTALL="${OPTARG}" ;;
t) WA_TAG="${OPTARG}" ;;
@@ -26,6 +24,7 @@ while getopts ":s:t:r:T:c:a:" opt; do
T) TEMPLATES_BRANCH="${OPTARG}" ;;
c) CONFIG="${OPTARG}" ;;
a) AGENDA="${OPTARG}" ;;
+ o) NEW_OUTPUT="${OPTARG}" ;;
*) usage ;;
esac
done
@@ -34,7 +33,12 @@ done
! check_root && error_msg "Please run this test as root."
cd "${TEST_DIR}"
+if [ ! -z "${NEW_OUTPUT}" ]; then
+ OUTPUT="${NEW_OUTPUT}"
+fi
create_out_dir "${OUTPUT}"
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
info_msg "WA installation skipped"
diff --git a/automated/linux/workload-automation/workload-automation.yaml b/automated/linux/workload-automation/workload-automation.yaml
index 5c7a3bb..57818bf 100644
--- a/automated/linux/workload-automation/workload-automation.yaml
+++ b/automated/linux/workload-automation/workload-automation.yaml
@@ -28,6 +28,9 @@ params:
AGENDA: "agenda/linux-dhrystone.yaml"
# allow extra extenstions for WA
WA_EXTENSION_PATHS: ""
+ # directory where the WA results are stored
+ # defaults to {TEST_DIR}/output
+ OUTPUT: ""
# Specify url and token for publishing artifacts.
# For safety reasons, please set 'ARTIFACTORIAL_TOKEN' variable in job definition with
# 'secrets' dictionary, and set job visibility to personal or group.
@@ -39,10 +42,13 @@ run:
steps:
- export WA_EXTENSION_PATHS=$WA_EXTENSION_PATHS
- cd ./automated/linux/workload-automation
+ - echo ${OUTPUT}
+ - if [ -z "${OUTPUT}" ]; then OUTPUT="./output"; fi
+ - echo ${OUTPUT}
# Test run.
- - ./workload-automation.sh -s "${SKIP_INSTALL}" -t "${WA_TAG}" -r "${WA_TEMPLATES_REPO}" -T "${TEMPLATES_BRANCH}" -c "${CONFIG}" -a "${AGENDA}"
+ - ./workload-automation.sh -s "${SKIP_INSTALL}" -t "${WA_TAG}" -r "${WA_TEMPLATES_REPO}" -T "${TEMPLATES_BRANCH}" -c "${CONFIG}" -a "${AGENDA}" -o "${OUTPUT}"
# Upload test output to artifactorial.
- - tar caf "wa-output.tar.xz" "./output"
+ - tar caf "wa-output.tar.xz" "${OUTPUT}"
- ../../utils/upload-to-artifactorial.sh -a "wa-output.tar.xz" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}"
# Send test result to LAVA.
- - ../../utils/send-to-lava.sh "./output/result.txt"
+ - ../../utils/send-to-lava.sh "${OUTPUT}/result.txt"