diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-03-22 13:38:34 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-03-22 14:53:11 +0000 |
commit | 6ee3e9d1f293c2d51736b8ba053e66bd873ad232 (patch) | |
tree | cd2cc150987c2c056a32e2104d44d201ad18fa94 /automated/android | |
parent | ed69cdaedaffee87ca8ec76859cdd8e8ce15c3c0 (diff) |
automated: android: set and use environmental variable ANDROID_SERIAL
When ANDROID_SERIAL set, we don't need to use '-s' to specify device
serial no. any more.
Change-Id: Ide4951c6ab68806a6241b38c3bf001e2e4e15eab
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/android')
-rwxr-xr-x | automated/android/bionic-benchmarks/bionic-benchmarks.sh | 4 | ||||
-rwxr-xr-x | automated/android/bionic-libc-tests/bionic-libc-tests.sh | 4 | ||||
-rwxr-xr-x | automated/android/busybox/busybox.sh | 2 | ||||
-rwxr-xr-x | automated/android/cts/cts-runner.py | 6 | ||||
-rwxr-xr-x | automated/android/cts/cts.sh | 5 | ||||
-rw-r--r-- | automated/android/cts/cts.yaml | 6 | ||||
-rwxr-xr-x | automated/android/dd-wr-speed/dd-wr-speed.sh | 10 | ||||
-rw-r--r-- | automated/android/dd-wr-speed/dd-wr-speed.yaml | 4 | ||||
-rwxr-xr-x | automated/android/linaro-android-kernel-tests/linaro-android-kernel-tests.sh | 4 |
9 files changed, 21 insertions, 24 deletions
diff --git a/automated/android/bionic-benchmarks/bionic-benchmarks.sh b/automated/android/bionic-benchmarks/bionic-benchmarks.sh index ae6a618..babe3df 100755 --- a/automated/android/bionic-benchmarks/bionic-benchmarks.sh +++ b/automated/android/bionic-benchmarks/bionic-benchmarks.sh @@ -66,8 +66,8 @@ initialize_adb wait_boot_completed "${TIMEOUT}" adb_push "./device-script.sh" "/data/local/tmp/" -info_msg "About to run bionic-benchmarks on device ${SN}" -adb -s "${SN}" shell /data/local/tmp/device-script.sh "${LOOPS}" 2>&1 \ +info_msg "About to run bionic-benchmarks on device ${ANDROID_SERIAL}" +adb shell /data/local/tmp/device-script.sh "${LOOPS}" 2>&1 \ | tee "${HOST_OUTPUT}"/device-run.log adb_pull "${DEVICE_OUTPUT}" "${HOST_OUTPUT}" diff --git a/automated/android/bionic-libc-tests/bionic-libc-tests.sh b/automated/android/bionic-libc-tests/bionic-libc-tests.sh index 55c7762..f2f2565 100755 --- a/automated/android/bionic-libc-tests/bionic-libc-tests.sh +++ b/automated/android/bionic-libc-tests/bionic-libc-tests.sh @@ -25,8 +25,8 @@ initialize_adb wait_boot_completed "${TIMEOUT}" adb_push "./device-script.sh" "/data/local/tmp/" -info_msg "About to run bionic-libc-tests on device ${SN}" -adb -s "${SN}" shell /data/local/tmp/device-script.sh 2>&1 \ +info_msg "About to run bionic-libc-tests on device ${ANDROID_SERIAL}" +adb shell /data/local/tmp/device-script.sh 2>&1 \ | tee "${HOST_OUTPUT}"/device-run.log adb_pull "${DEVICE_OUTPUT}" "${HOST_OUTPUT}" diff --git a/automated/android/busybox/busybox.sh b/automated/android/busybox/busybox.sh index 30141da..b36600a 100755 --- a/automated/android/busybox/busybox.sh +++ b/automated/android/busybox/busybox.sh @@ -14,7 +14,7 @@ create_out_dir "${OUTPUT}" adb_push "./device-script.sh" "/data/local/tmp/bin/" -adb -s "${SN}" shell '/data/local/tmp/bin/device-script.sh 2>&1' \ +adb shell '/data/local/tmp/bin/device-script.sh 2>&1' \ | tee "${OUTPUT}/device-stdout.log" adb_pull "/data/local/tmp/busybox/result.txt" "${OUTPUT}/" diff --git a/automated/android/cts/cts-runner.py b/automated/android/cts/cts-runner.py index 50589e3..b81b8ff 100755 --- a/automated/android/cts/cts-runner.py +++ b/automated/android/cts/cts-runner.py @@ -80,16 +80,12 @@ RESULT_FILE = '%s/result.txt' % OUTPUT CTS_STDOUT = '%s/cts-stdout.txt' % OUTPUT CTS_LOGCAT = '%s/cts-logcat.txt' % OUTPUT TEST_PARAMS = '' -SN = '' parser = argparse.ArgumentParser() parser.add_argument('-t', dest='TEST_PARAMS', required=True, help="cts test parameters") -parser.add_argument('-n', dest='SN', required=True, - help='Target device serial no.') args = parser.parse_args() TEST_PARAMS = args.TEST_PARAMS -SN = args.SN if os.path.exists(OUTPUT): suffix = datetime.datetime.now().strftime('%Y%m%d%H%M%S') @@ -127,7 +123,7 @@ while child.isalive(): subprocess.call('echo') subprocess.call(['echo', '--- line break ---']) logger.info('Checking adb connectivity...') - adb_command = "adb -s %s shell echo OK" % SN + adb_command = "adb shell echo OK" adb_check = subprocess.Popen(shlex.split(adb_command)) if adb_check.wait() != 0: subprocess.call(['adb', 'devices']) diff --git a/automated/android/cts/cts.sh b/automated/android/cts/cts.sh index 9f5bdc3..8e85d94 100755 --- a/automated/android/cts/cts.sh +++ b/automated/android/cts/cts.sh @@ -23,7 +23,7 @@ while getopts ':s:o:n:d:c:t:' opt; do case "${opt}" in s) SKIP_INSTALL="${OPTARG}" ;; o) TIMEOUT="${OPTARG}" ;; - n) SN="${OPTARG}" ;; + n) ANDROID_SERIAL="${OPTARG}" ;; d) JDK="${OPTARG}" ;; c) CTS_URL="${OPTARG}" ;; t) TEST_PARAMS="${OPTARG}" ;; @@ -80,7 +80,8 @@ if [ -d android-cts/results ]; then fi # Run CTS test. -./cts-runner.py -t "${TEST_PARAMS}" -n "${SN}" +info_msg "About to run dd speed test on device ${ANDROID_SERIAL}" +./cts-runner.py -t "${TEST_PARAMS}" # Cleanup. rm -f /etc/apt/sources.list.d/cts.list diff --git a/automated/android/cts/cts.yaml b/automated/android/cts/cts.yaml index 74e65cf..d12e149 100644 --- a/automated/android/cts/cts.yaml +++ b/automated/android/cts/cts.yaml @@ -17,8 +17,8 @@ params: SKIP_INSTALL: "false" # Specify timeout in seconds for wait_boot_completed and wait_homescreen. TIMEOUT: "300" - # Specify adb device SN if more then one device connected. - SN: "" + # Specify adb device serial no. if more then one device connected. + ANDROID_SERIAL: "" JDK: "openjdk-8-jdk-headless" # Download CTS package or copy it from local disk. # CTS_URL: "/root/android-cts/linaro/7.1_r1/android-cts-7.1_r1.zip" @@ -30,7 +30,7 @@ params: run: steps: - cd ./automated/android/cts - - ./cts.sh -s "${SKIP_INSTALL}" -o "${TIMEOUT}" -n "${SN}" -d "${JDK}" -c "${CTS_URL}" -t "${TEST_PARAMS}" + - ./cts.sh -s "${SKIP_INSTALL}" -o "${TIMEOUT}" -n "${ANDROID_SERIAL}" -d "${JDK}" -c "${CTS_URL}" -t "${TEST_PARAMS}" # Upload test log and result files to artifactorial. - cp -r ./android-cts/results ./output/ || true - cp -r ./android-cts/logs ./output/ || true diff --git a/automated/android/dd-wr-speed/dd-wr-speed.sh b/automated/android/dd-wr-speed/dd-wr-speed.sh index b094875..402a17e 100755 --- a/automated/android/dd-wr-speed/dd-wr-speed.sh +++ b/automated/android/dd-wr-speed/dd-wr-speed.sh @@ -3,7 +3,7 @@ HOST_OUTPUT="$(pwd)/output" LOCAL_DEVICE_OUTPUT="${HOST_OUTPUT}/device-output" DEVICE_OUTPUT="/data/local/tmp/dd-wr-speed" -SN="" +ANDROID_SERIAL="" BOOT_TIMEOUT="300" ITERATION="5" PARTITION="" @@ -11,7 +11,7 @@ RESULT_FILE="${HOST_OUTPUT}/result.txt" export RESULT_FILE usage() { - echo "Usage: $0 [-p <partition>] [-i <iteration>] [-s <sn>] [-t <timeout>]" 1>&2 + echo "Usage: $0 [-p <partition>] [-i <iteration>] [-s <android_serial>] [-t <timeout>]" 1>&2 exit 1 } @@ -24,7 +24,7 @@ while getopts ":p:i:s:t:" o; do # You may need to run dd test 4-5 times for an accurate evaluation. i) ITERATION="${OPTARG}" ;; # Specify device serial number when more than one device connected. - s) SN="${OPTARG}" ;; + s) ANDROID_SERIAL="${OPTARG}" ;; t) BOOT_TIMEOUT="${OPTARG}" ;; *) usage ;; esac @@ -91,8 +91,8 @@ detect_abi adb_push "../../bin/${abi}/busybox" "/data/local/tmp/bin/" adb_push "./device-script.sh" "/data/local/tmp/bin" -info_msg "About to run dd speed test on device ${SN}" -adb -s "${SN}" shell "echo /data/local/tmp/bin/device-script.sh ${ITERATION} ${DEVICE_OUTPUT} ${PARTITION} | su" 2>&1 | tee "${HOST_OUTPUT}/device-stdout.log" +info_msg "About to run dd speed test on device ${ANDROID_SERIAL}" +adb shell "echo /data/local/tmp/bin/device-script.sh ${ITERATION} ${DEVICE_OUTPUT} ${PARTITION} | su" 2>&1 | tee "${HOST_OUTPUT}/device-stdout.log" adb_pull "${DEVICE_OUTPUT}" "${LOCAL_DEVICE_OUTPUT}" diff --git a/automated/android/dd-wr-speed/dd-wr-speed.yaml b/automated/android/dd-wr-speed/dd-wr-speed.yaml index 3abddc2..fa4b5ee 100644 --- a/automated/android/dd-wr-speed/dd-wr-speed.yaml +++ b/automated/android/dd-wr-speed/dd-wr-speed.yaml @@ -23,12 +23,12 @@ params: ITERATION: "5" # Specify device serial number for adb connection if more than one device # connected. - SN: "" + ANDROID_SERIAL: "" # Specify timeout in seconds for wait_boot_completed BOOT_TIMEOUT: "300" run: steps: - cd ./automated/android/dd-wr-speed - - ./dd-wr-speed.sh -p "${PARTITION}" -i "${ITERATION}" -s "${SN}" -t "${BOOT_TIMEOUT}" + - ./dd-wr-speed.sh -p "${PARTITION}" -i "${ITERATION}" -s "${ANDROID_SERIAL}" -t "${BOOT_TIMEOUT}" - ../../utils/send-to-lava.sh ./output/result.txt 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 5cb7a96..59fe540 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 @@ -16,8 +16,8 @@ wait_boot_completed "300" create_out_dir "${OUTPUT}" # Run test script. -if test -n "$(adb -s "${SN}" shell "which ${TEST_SCRIPT}")"; then - adb -s "${SN}" shell "${TEST_SCRIPT}" | tee "${LOGFILE}" +if test -n "$(adb shell "which ${TEST_SCRIPT}")"; then + adb shell "${TEST_SCRIPT}" | tee "${LOGFILE}" else warn_msg "${TEST_SCRIPT} NOT found" report_fail "test-script-existence-check" |