aboutsummaryrefslogtreecommitdiff
path: root/automated/android
diff options
context:
space:
mode:
Diffstat (limited to 'automated/android')
-rwxr-xr-xautomated/android/apk-automation/geekbench4.py10
-rwxr-xr-xautomated/android/apk-automation/glbenchmark25.py5
-rwxr-xr-xautomated/android/apk-automation/rl-sqlite.py15
-rwxr-xr-xautomated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh10
-rwxr-xr-xautomated/android/noninteractive-tradefed/setup.sh16
-rw-r--r--automated/android/noninteractive-tradefed/tradefed.yaml9
-rwxr-xr-xautomated/android/optee/optee-gtest-gatekeeper-keymaster.sh38
-rwxr-xr-xautomated/android/optee/optee-gtest-gatekeeper-keymaster.yaml26
-rwxr-xr-xautomated/android/tradefed/tradefed.sh6
-rw-r--r--automated/android/tradefed/tradefed.yaml8
10 files changed, 126 insertions, 17 deletions
diff --git a/automated/android/apk-automation/geekbench4.py b/automated/android/apk-automation/geekbench4.py
index 5e53219..2e4434d 100755
--- a/automated/android/apk-automation/geekbench4.py
+++ b/automated/android/apk-automation/geekbench4.py
@@ -7,10 +7,10 @@ import time
from common import ApkTestRunner
from com.dtmilano.android.viewclient import ViewNotFoundException
-## geekbench-3-4-2-0.apk
-## Version is 4.2.0
-## size: 100171060
-## md5sum: 6df73d9b5c3f9fe7383683856985a153
+## geekbench-3-4-3-0.apk
+## Version is 4.3.0
+## size: 100459959
+## md5sum: c0013d79b8518edcdbcf7a2019d2e0ca
## Url:
## https://geekbench-3.en.uptodown.com/android
## https://play.google.com/store/apps/details?id=com.primatelabs.geekbench
@@ -19,7 +19,7 @@ from com.dtmilano.android.viewclient import ViewNotFoundException
class ApkRunnerImpl(ApkTestRunner):
def __init__(self, config):
self.config = config
- self.config['apk_file_name'] = "geekbench-3-4-2-0.apk"
+ self.config['apk_file_name'] = "geekbench-3-4-3-0.apk"
self.config['apk_package'] = "com.primatelabs.geekbench"
self.config['activity'] = "com.primatelabs.geekbench/.HomeActivity"
super(ApkRunnerImpl, self).__init__(self.config)
diff --git a/automated/android/apk-automation/glbenchmark25.py b/automated/android/apk-automation/glbenchmark25.py
index e5bb116..9853a84 100755
--- a/automated/android/apk-automation/glbenchmark25.py
+++ b/automated/android/apk-automation/glbenchmark25.py
@@ -41,6 +41,7 @@ class ApkRunnerImpl(ApkTestRunner):
self.dump_always()
select_all_btn = self.vc.findViewWithText("All")
display_tests_menu = self.vc.findViewWithText("Performance Tests")
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
if select_all_btn:
select_all_btn.touch()
self.logger.info("All selected!")
@@ -48,6 +49,10 @@ class ApkRunnerImpl(ApkTestRunner):
elif display_tests_menu:
display_tests_menu.touch()
self.logger.info("Display all tests to select all")
+ elif warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
else:
# continue
pass
diff --git a/automated/android/apk-automation/rl-sqlite.py b/automated/android/apk-automation/rl-sqlite.py
index 10929b2..c16c201 100755
--- a/automated/android/apk-automation/rl-sqlite.py
+++ b/automated/android/apk-automation/rl-sqlite.py
@@ -11,9 +11,18 @@ class ApkRunnerImpl(ApkTestRunner):
super(ApkRunnerImpl, self).__init__(self.config)
def execute(self):
- self.dump_always()
- btn_start = self.vc.findViewWithTextOrRaise(u'Start')
- btn_start.touch()
+ find_start_btn = False
+ while not find_start_btn:
+ self.dump_always()
+ warn_msg = self.vc.findViewWithText(u'This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer.')
+ btn_start = self.vc.findViewWithText(u'Start')
+ if warn_msg:
+ self.logger.info("Older version warning popped up")
+ warning_ok_btn = self.vc.findViewWithTextOrRaise(u'OK')
+ warning_ok_btn.touch()
+ elif btn_start:
+ btn_start.touch()
+ find_start_btn = True
finished = False
while(not finished):
diff --git a/automated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh b/automated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh
index 59fe540..8dd7d97 100755
--- a/automated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh
+++ b/automated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh
@@ -17,7 +17,17 @@ create_out_dir "${OUTPUT}"
# Run test script.
if test -n "$(adb shell "which ${TEST_SCRIPT}")"; then
+ # disable selinux for kernel test
+ selinux=$(adb shell getenforce)
+ if [ "X${selinux}" = "XEnforcing" ]; then
+ adb shell setenforce 0
+ fi
adb shell "${TEST_SCRIPT}" | tee "${LOGFILE}"
+ # enable selinux again after the test
+ # to avoid affecting next test
+ if [ "X${selinux}" = "XEnforcing" ]; then
+ adb shell setenforce 1
+ fi
else
warn_msg "${TEST_SCRIPT} NOT found"
report_fail "test-script-existence-check"
diff --git a/automated/android/noninteractive-tradefed/setup.sh b/automated/android/noninteractive-tradefed/setup.sh
index 86d8e69..0aba3b5 100755
--- a/automated/android/noninteractive-tradefed/setup.sh
+++ b/automated/android/noninteractive-tradefed/setup.sh
@@ -1,14 +1,22 @@
-#!/bin/sh -x
+#!/bin/bash -x
# shellcheck disable=SC2154
# shellcheck disable=SC1091
. ../../lib/sh-test-lib
. ../../lib/android-test-lib
-if echo "$ANDROID_VERSION" | grep aosp-master ; then
- JDK="openjdk-9-jdk-headless"
-else
+# ANDROID_VERSION was set in the format like change here:
+# https://review.linaro.org/#/c/ci/job/configs/+/29367/
+if [ -z "${ANDROID_VERSION}" ]; then
+ # install jdk8 when nothing specified
+ # to avoid regression
+ JDK="openjdk-8-jdk-headless"
+elif echo "${ANDROID_VERSION}" | grep -q "android-8\." ; then
+ # install jdk8 for Oreo builds, both 8.0 and 8.1
JDK="openjdk-8-jdk-headless"
+else
+ # Use Jdk9 for all other builds
+ JDK="openjdk-9-jdk-headless"
fi
PKG_DEPS="usbutils curl wget zip xz-utils python-lxml python-setuptools python-pexpect aapt lib32z1-dev libc6-dev-i386 lib32gcc1 libc6:i386 libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 python-dev python-protobuf protobuf-compiler python-virtualenv python-pip python-pexpect psmisc"
diff --git a/automated/android/noninteractive-tradefed/tradefed.yaml b/automated/android/noninteractive-tradefed/tradefed.yaml
index 9f9ae70..16a0139 100644
--- a/automated/android/noninteractive-tradefed/tradefed.yaml
+++ b/automated/android/noninteractive-tradefed/tradefed.yaml
@@ -34,6 +34,11 @@ params:
# Specify the failures number to be printed
FAILURES_PRINTED: "0"
TEST_REBOOT_EXPECTED: "false"
+ # setup.sh determines JDK version by Android version.
+ # Here are some examples for the param, see setup.sh for more details.
+ # ANDROID_VERSION: android-8.1.0_r33
+ # ANDROID_VERSION: aosp-master
+ ANDROID_VERSION: ""
run:
steps:
@@ -46,7 +51,7 @@ run:
# create test use to run the cts/vts tests
- useradd -m testuser && echo "testuser created successfully"
- chown testuser:testuser .
- - if [[ ${TEST_REBOOT_EXPECTED} == "true" ]]; then ./monitor_fastboot.sh & fi
+ - if [ "X${TEST_REBOOT_EXPECTED}" = "Xtrue" ]; then ./monitor_fastboot.sh & fi
- sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}" -f "${FAILURES_PRINTED}" -a "${AP_SSID}" -k "${AP_KEY}"
# Upload test log and result files to artifactorial.
- cp -r ./${TEST_PATH}/results ./output/ || true
@@ -61,4 +66,4 @@ run:
- userdel testuser -f -r || true
# When adb device lost, end test job to mark it as 'incomplete'.
- if ! adb shell echo ok; then error_fatal "adb device $ANDROID_SERIAL lost!"; fi
- - if [[ ${TEST_REBOOT_EXPECTED} == "true" ]]; then killall monitor_fastboot.sh; fi
+ - if [ "X${TEST_REBOOT_EXPECTED}" = "Xtrue" ]; then killall monitor_fastboot.sh; fi
diff --git a/automated/android/optee/optee-gtest-gatekeeper-keymaster.sh b/automated/android/optee/optee-gtest-gatekeeper-keymaster.sh
new file mode 100755
index 0000000..c315c4d
--- /dev/null
+++ b/automated/android/optee/optee-gtest-gatekeeper-keymaster.sh
@@ -0,0 +1,38 @@
+#!/bin/sh -e
+
+OUTPUT="$(pwd)/output"
+BOOT_TIMEOUT="300"
+LOGFILE="${OUTPUT}/gtest-gatekeeper-keymaster-stdout.log"
+RESULT_FILE="${OUTPUT}/result.txt"
+
+usage() {
+ echo "Usage: $0 [-s <android_serial>] [-t <boot_timeout>]" 1>&2
+ exit 1
+}
+
+while getopts ":s:t:" o; do
+ case "$o" in
+ s) ANDROID_SERIAL="${OPTARG}" ;;
+ t) BOOT_TIMEOUT="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+# shellcheck disable=SC1091
+. ../../lib/android-test-lib
+
+initialize_adb
+wait_boot_completed "${BOOT_TIMEOUT}"
+create_out_dir "${OUTPUT}"
+
+# Run test.
+info_msg "About to run gatekeeper and keymaster gtests on device ${ANDROID_SERIAL}"
+
+adb shell "echo /data/nativetest64/VtsHalGatekeeperV1_0TargetTest/VtsHalGatekeeperV1_0TargetTest 2>&1 | su" | tee "${LOGFILE}"
+adb shell "echo /data/nativetest64/VtsHalKeymasterV3_0TargetTest/VtsHalKeymasterV3_0TargetTest 2>&1 | su" | tee "${LOGFILE}"
+
+# Parse test log into RESULT_FILE
+grep "\[ *OK *\] [A-Za-z]" "${LOGFILE}" | awk '{printf("%s pass\n", $4)}' | tee -a "${RESULT_FILE}"
+grep "\[ *FAILED *\] [A-Za-z]" "${LOGFILE}" | awk '{printf("%s fail\n", $4)}' | tee -a "${RESULT_FILE}"
diff --git a/automated/android/optee/optee-gtest-gatekeeper-keymaster.yaml b/automated/android/optee/optee-gtest-gatekeeper-keymaster.yaml
new file mode 100755
index 0000000..8ec3b0f
--- /dev/null
+++ b/automated/android/optee/optee-gtest-gatekeeper-keymaster.yaml
@@ -0,0 +1,26 @@
+metadata:
+ name: optee-gtest-gatekeeper-keymaster
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "gatekeeper and keymaster gtests"
+ maintainer:
+ - victor.chong@linaro.org
+ - chase.qi@linaro.org
+ os:
+ - android
+ scope:
+ - functional
+ - performance
+ devices:
+ - hi6220-hikey
+
+params:
+ # Specify device serial no. when more than one device connected.
+ ANDROID_SERIAL: ""
+ # Specify timeout in seconds for wait_boot_completed
+ BOOT_TIMEOUT: "300"
+
+run:
+ steps:
+ - cd ./automated/android/optee
+ - ./optee-gtest-gatekeeper-keymaster.sh -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}"
+ - ../../utils/send-to-lava.sh ./output/result.txt
diff --git a/automated/android/tradefed/tradefed.sh b/automated/android/tradefed/tradefed.sh
index 2bcb4da..2f8df89 100755
--- a/automated/android/tradefed/tradefed.sh
+++ b/automated/android/tradefed/tradefed.sh
@@ -19,13 +19,14 @@ FAILURES_PRINTED="0"
AP_SSID=""
# WIFI AP KEY
AP_KEY=""
+JAVA_OPTIONS="-Xmx350M"
usage() {
echo "Usage: $0 [-o timeout] [-n serialno] [-c cts_url] [-t test_params] [-p test_path] [-r <aggregated|atomic>] [-f failures_printed] [-a <ap_ssid>] [-k <ap_key>]" 1>&2
exit 1
}
-while getopts ':o:n:c:t:p:r:f:a:k:' opt; do
+while getopts ':o:n:c:t:p:r:f:a:k:j:' opt; do
case "${opt}" in
o) TIMEOUT="${OPTARG}" ;;
n) export ANDROID_SERIAL="${OPTARG}" ;;
@@ -36,6 +37,7 @@ while getopts ':o:n:c:t:p:r:f:a:k:' opt; do
f) FAILURES_PRINTED="${OPTARG}" ;;
a) AP_SSID="${OPTARG}" ;;
k) AP_KEY="${OPTARG}" ;;
+ j) JAVA_OPTIONS="${OPTARG}" ;;
*) usage ;;
esac
done
@@ -58,7 +60,7 @@ disable_suspend
# wait_homescreen "${TIMEOUT}"
# Increase the heap size. KVM devices in LAVA default to ~250M of heap
-export _JAVA_OPTIONS="-Xmx350M"
+export _JAVA_OPTIONS="${JAVA_OPTIONS}"
java -version
# Download CTS/VTS test package or copy it from local disk.
diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml
index 44af753..0cd843b 100644
--- a/automated/android/tradefed/tradefed.yaml
+++ b/automated/android/tradefed/tradefed.yaml
@@ -34,6 +34,12 @@ params:
# Specify the failures number to be printed
FAILURES_PRINTED: "0"
TEST_REBOOT_EXPECTED: "false"
+ JAVA_OPTIONS: "-Xmx350M"
+ # setup.sh determines JDK version by Android version.
+ # Here are some examples for the param, see setup.sh for more details.
+ # ANDROID_VERSION: android-8.1.0_r33
+ # ANDROID_VERSION: aosp-master
+ ANDROID_VERSION: ""
run:
steps:
@@ -47,7 +53,7 @@ run:
- useradd -m testuser && echo "testuser created successfully"
- chown testuser:testuser .
- if [[ ${TEST_REBOOT_EXPECTED} == "true" ]]; then ./monitor_fastboot.sh & fi
- - sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}" -f "${FAILURES_PRINTED}" -a "${AP_SSID}" -k "${AP_KEY}"
+ - sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}" -f "${FAILURES_PRINTED}" -a "${AP_SSID}" -k "${AP_KEY}" -j "${JAVA_OPTIONS}"
# Upload test log and result files to artifactorial.
- cp -r ./${TEST_PATH}/results ./output/ || true
- cp -r ./${TEST_PATH}/logs ./output/ || true