summaryrefslogtreecommitdiff
path: root/automated/android/apk-automation/apk-automation.sh
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-03-30 18:54:46 +0100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-04-28 09:50:02 +0000
commitab48dcadc4eb74a126a8d76bece720ab000b1452 (patch)
tree4cf508236cf2cf8d44ff2552bf7b2d7a6fdee58b /automated/android/apk-automation/apk-automation.sh
parentd92cc5a7e7461e7fe493a3a1be0bbdc7a94f9892 (diff)
downloadtest-definitions-pipe-ab48dcadc4eb74a126a8d76bece720ab000b1452.tar.gz
automated: android: add refactored apk-automation
Change-Id: I5a81b3c4317dc56f90df37c5a8f83d2547542fab Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'automated/android/apk-automation/apk-automation.sh')
-rwxr-xr-xautomated/android/apk-automation/apk-automation.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/automated/android/apk-automation/apk-automation.sh b/automated/android/apk-automation/apk-automation.sh
new file mode 100755
index 0000000..5ecdba8
--- /dev/null
+++ b/automated/android/apk-automation/apk-automation.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# shellcheck disable=SC1091
+
+. ./../../lib/sh-test-lib
+. ./../../lib/android-test-lib
+
+SKIP_INSTALL="false"
+ANDROID_SERIAL=""
+BOOT_TIMEOUT="300"
+LOOPS="1"
+TEST_NAME="linpack"
+APK_DIR="./apks"
+BASE_URL="http://testdata.validation.linaro.org/apks/"
+
+usage() {
+ echo "Usage: $0 [-S <true|false>] [-s <serialno>] [-t <timeout>] [-l <loops>] [-n <test_name>] [-d <apk_dir>] ['-u <base_url>']" 1>&2
+ exit 1
+}
+
+while getopts ":S:s:t:l:n:d:u:" opt; do
+ case "${opt}" in
+ S) SKIP_INSTALL="${OPTARG}" ;;
+ s) ANDROID_SERIAL="${OPTARG}" ;;
+ t) BOOT_TIMEOUT="${OPTARG}" ;;
+ l) LOOPS="${OPTARG}" ;;
+ n) TEST_NAME="${OPTARG}" ;;
+ d) APK_DIR="${OPTARG}" ;;
+ u) BASE_URL="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+OUTPUT="$(pwd)/output/${TEST_NAME}"
+export OUTPUT
+RESULT_FILE="${OUTPUT}/result.txt"
+export RESULT_FILE
+
+! check_root && error_msg "Please run this script as superuser!"
+if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
+ info_msg "Package installation skipped"
+else
+ install_deps "git python python-lxml python-pil python-setuptools curl tar xz-utils" "${SKIP_INSTALL}"
+ git clone https://github.com/dtmilano/AndroidViewClient
+ (
+ cd AndroidViewClient/ || exit
+ python setup.py install
+ )
+fi
+
+initialize_adb
+adb_root
+wait_boot_completed "${BOOT_TIMEOUT}"
+disable_suspend
+
+info_msg "device-${ANDROID_SERIAL}: About to run ${TEST_NAME}..."
+python main.py -l "${LOOPS}" -n "${TEST_NAME}" -d "${APK_DIR}" -u "${BASE_URL}"