diff options
author | Lisa Nguyen <lisa.nguyen@linaro.org> | 2018-01-31 13:21:07 -0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2018-02-16 12:26:23 +0000 |
commit | b8c25bd0379bfe443665351a31252203dcefbdce (patch) | |
tree | c8b3ca3aae991175351d3c5e5ee6572641324ac7 /automated/android/workload-automation | |
parent | 3837902a76d7b6934d5decdfffd00869ea0323b8 (diff) |
WA: Use correct AEP config file before running WA
If AEP exists, update the AEP path in the agenda pointing to the
correct AEP config file before running WA.
Change-Id: I0fea9fe17e4f6486434c06d5c10645b6c6f94a3b
Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
Diffstat (limited to 'automated/android/workload-automation')
-rwxr-xr-x | automated/android/workload-automation/workload-automation.sh | 24 | ||||
-rw-r--r-- | automated/android/workload-automation/workload-automation.yaml | 3 |
2 files changed, 23 insertions, 4 deletions
diff --git a/automated/android/workload-automation/workload-automation.sh b/automated/android/workload-automation/workload-automation.sh index 33d6cc1..e273f4e 100755 --- a/automated/android/workload-automation/workload-automation.sh +++ b/automated/android/workload-automation/workload-automation.sh @@ -8,7 +8,7 @@ export RESULT_FILE SKIP_INSTALL="false" ANDROID_SERIAL="" BOOT_TIMEOUT="300" - +PROBE="" WA_TAG="master" WA_TEMPLATES_REPO="https://git.linaro.org/qa/wa2-lava.git" TEMPLATES_BRANCH="wa-templates" @@ -18,11 +18,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>]" 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>]" 1>&2 exit 1 } -while getopts ":s:S:t:T:r:g:c:a:b:w:" opt; do +while getopts ":s:S:t:T:r:g:c:a:b:w:p:" opt; do case "${opt}" in s) SKIP_INSTALL="${OPTARG}" ;; S) ANDROID_SERIAL="${OPTARG}" ;; @@ -34,6 +34,7 @@ while getopts ":s:S:t:T:r:g:c:a:b:w:" opt; do a) AGENDA="${OPTARG}" ;; b) BUILD_TOOLS_URL="${OPTARG}" ;; w) WA_HOME_URL="${OPTARG}" ;; + p) PROBE="${OPTARG}" ;; *) usage ;; esac done @@ -104,6 +105,23 @@ if ! awk '/result_processors = [[]/,/[]]/' ./config.py | grep -q 'csv'; then sed -i "s/result_processors = [[]/result_processors = [\n 'csv',/" ./config.py fi +if [ -z "${PROBE}" ]; then + # LAVA supports one probe per device for now. + PROBE=$(find /dev/serial/by-id/ -name "usb-NXP_SEMICOND_ARM_Energy_Probe*" | head -n 1) +fi + +# If AEP exists, find the correct AEP config file and update the AEP config path in the agenda. +if [ -n "${PROBE}" ]; then +( + cd "${WA_EXTENSION_PATHS}" + # find config file with matching probe ID + CONFIG_FILE=$(basename "$(grep -rl "${PROBE}" .)") + cd - + # update AEP config path on agenda + sed -i "s|\$WA_EXTENSION_PATHS/*.*|\$WA_EXTENSION_PATHS/'${CONFIG_FILE}'\"|" agenda.yaml +) +fi + info_msg "device-${ANDROID_SERIAL}: About to run WA with ${AGENDA}..." wa run ./agenda.yaml -v -f -d "${OUTPUT}/wa" -c ./config.py || report_fail "wa-test-run" diff --git a/automated/android/workload-automation/workload-automation.yaml b/automated/android/workload-automation/workload-automation.yaml index 966fb34..4aa8a7e 100644 --- a/automated/android/workload-automation/workload-automation.yaml +++ b/automated/android/workload-automation/workload-automation.yaml @@ -31,6 +31,7 @@ params: AGENDA: "agenda/android-linpack.yaml" # allow extra extenstions for WA WA_EXTENSION_PATHS: "" + PROBE: "" # 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,7 +44,7 @@ run: - export WA_EXTENSION_PATHS=$WA_EXTENSION_PATHS - cd ./automated/android/workload-automation # 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}" + - ./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}" # Upload test output to artifactorial. - tar caf "wa-output.tar.xz" "./output" - ../../utils/upload-to-artifactorial.sh -a "wa-output.tar.xz" -u "${ARTIFACTORIAL_URL}" -t "${ARTIFACTORIAL_TOKEN}" |