From fffa030132628cd5b57d950368345c4a472035c7 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 8 May 2018 11:35:07 +0100 Subject: workload-automation: add installation and config for AEP This commit adds support for installing and configuring ARM Energy Probe (AEP) devices. These devices are connected to Device Under Test in order to measure energy consumption at the connection point. AEP is currently only suppored in WA scripts that execute on AOSP. There is no support for devices running Linux. Scripts allow to use custom repositories and branches for installation and configuration. Change-Id: Ieb9a485f1d269f108c1305c373d66e422136a2b0 Signed-off-by: Milosz Wasilewski --- .../workload-automation/aep-energy-config.sh | 44 ++++++++++++++++++++++ .../android/workload-automation/aep-install.sh | 44 ++++++++++++++++++++++ .../android/workload-automation/aep-install.yaml | 30 +++++++++++++++ 3 files changed, 118 insertions(+) create mode 100755 automated/android/workload-automation/aep-energy-config.sh create mode 100755 automated/android/workload-automation/aep-install.sh create mode 100644 automated/android/workload-automation/aep-install.yaml diff --git a/automated/android/workload-automation/aep-energy-config.sh b/automated/android/workload-automation/aep-energy-config.sh new file mode 100755 index 0000000..79ce07b --- /dev/null +++ b/automated/android/workload-automation/aep-energy-config.sh @@ -0,0 +1,44 @@ +#!/bin/sh -ex +# shellcheck disable=SC1090 + +TEST_DIR=$(dirname "$(realpath "$0")") +OUTPUT="${TEST_DIR}/output" +SKIP_INSTALL="false" +AEP_CONFIG_REPOSITORY="https://git.linaro.org/power/energy-probe-ext.git" +AEP_CONFIG_REF="master" +AEP_CONFIG_TARGET_PATH="/root/energy-probe-ext" + +usage() { + echo "Usage: $0 [-t ] [-r ] [-p ]" 1>&2 + exit 1 +} + +while getopts ":t:r:p:" opt; do + case "${opt}" in + t) AEP_CONFIG_REF="${OPTARG}" ;; + r) AEP_CONFIG_REPOSITORY="${OPTARG}" ;; + p) AEP_CONFIG_TARGET_PATH="${OPTARG}" ;; + *) usage ;; + esac +done + +. "${TEST_DIR}/../../lib/sh-test-lib" + +! check_root && error_msg "Please run this test as root." +cd "${TEST_DIR}" +create_out_dir "${OUTPUT}" +RESULT_FILE="${OUTPUT}/result.txt" +export RESULT_FILE + +if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then + info_msg "Dependency installation skipped" +else + PKGS="git" + install_deps "${PKGS}" +fi +create_out_dir "${AEP_CONFIG_TARGET_PATH}" +git clone "${AEP_CONFIG_REPOSITORY}" energy-probe-ext +cd energy-probe-ext +git checkout "${AEP_CONFIG_REF}" +cp -r ./* "${AEP_CONFIG_TARGET_PATH}" +report_pass "AEP config installed" diff --git a/automated/android/workload-automation/aep-install.sh b/automated/android/workload-automation/aep-install.sh new file mode 100755 index 0000000..5cb4104 --- /dev/null +++ b/automated/android/workload-automation/aep-install.sh @@ -0,0 +1,44 @@ +#!/bin/sh -ex +# shellcheck disable=SC1090 + +TEST_DIR=$(dirname "$(realpath "$0")") +OUTPUT="${TEST_DIR}/output" +SKIP_INSTALL="false" +AEP_REPOSITORY="https://git.linaro.org/tools/arm-probe.git" +AEP_REF="master" + +usage() { + echo "Usage: $0 [-t ] [-r ]" 1>&2 + exit 1 +} + +while getopts ":t:r:" opt; do + case "${opt}" in + t) AEP_REF="${OPTARG}" ;; + r) AEP_REPOSITORY="${OPTARG}" ;; + *) usage ;; + esac +done + +. "${TEST_DIR}/../../lib/sh-test-lib" + +! check_root && error_msg "Please run this test as root." +cd "${TEST_DIR}" +create_out_dir "${OUTPUT}" +RESULT_FILE="${OUTPUT}/result.txt" +export RESULT_FILE + +if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then + info_msg "Dependency installation skipped" +else + PKGS="git autoconf libtool cmake zlib1g-dev libssl-dev python" + install_deps "${PKGS}" +fi +git clone "${AEP_REPOSITORY}" arm-probe +cd arm-probe +git checkout "${AEP_REF}" +./autogen.sh +./configure --prefix=/usr +make +make install +report_pass "AEP installed" diff --git a/automated/android/workload-automation/aep-install.yaml b/automated/android/workload-automation/aep-install.yaml new file mode 100644 index 0000000..a8ed990 --- /dev/null +++ b/automated/android/workload-automation/aep-install.yaml @@ -0,0 +1,30 @@ +metadata: + format: Lava-Test Test Definition 1.0 + name: arm-probe-install + description: "Install arm-probe tool on devices that have ARM + energy probes connected to them. + It also installs configuration files for the probe" + maintainer: + - lisa.nguyen@linaro.org + - milosz.wasilewski@linaro.org + os: + - ubuntu + devices: + - hi6220-hikey + - hi960-hikey + - juno + +params: + AEP_REPOSITORY: https://git.linaro.org/tools/arm-probe.git + AEP_REF: master + AEP_CONFIG_REPOSITORY: https://git.linaro.org/power/energy-probe-ext.git + AEP_CONFIG_REF: master + # path should be absolute + AEP_CONFIG_TARGET_PATH: /root/energy-probe-ext + +run: + steps: + - cd ./automated/android/workload-automation + - ./aep-install.sh -r "${AEP_REPOSITORY}" -t "${AEP_REF}" + - ./aep-energy-config.sh -r "${AEP_CONFIG_REPOSITORY}" -t "${AEP_CONFIG_REF}" -p "${AEP_CONFIG_TARGET_PATH}" + - ../../utils/send-to-lava.sh ./output/result.txt -- cgit v1.2.3