diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2018-04-17 23:10:59 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@linaro.org> | 2018-04-19 09:17:22 +0530 |
commit | 806d42e4140b721422d0b0cd01f924042f9fde5e (patch) | |
tree | 732adfaa401af31cccbfa988a131952b9530d78c | |
parent | 9181fd2b701de4c209d613b6b78401deff77656b (diff) |
tradefed: add monitor_fastboot.sh
This is a workaround for LAVA not supporting reboot
during the test. Details of the testing results for the
patch is available here:
https://projects.linaro.org/secure/attachment/13543/13543_LAVA+_+Scheduler+_+Device+Type+hi6220-hikey-r2.pdf
Change-Id: Idd1355a70856f0e58ad250ed8932b03073a5c6d5
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rwxr-xr-x | automated/android/tradefed/monitor_fastboot.sh | 4 | ||||
-rwxr-xr-x | automated/android/tradefed/setup.sh | 2 | ||||
-rwxr-xr-x | automated/android/tradefed/tradefed-runner.py | 27 | ||||
-rw-r--r-- | automated/android/tradefed/tradefed.yaml | 2 |
4 files changed, 23 insertions, 12 deletions
diff --git a/automated/android/tradefed/monitor_fastboot.sh b/automated/android/tradefed/monitor_fastboot.sh new file mode 100755 index 0000000..ca7cb44 --- /dev/null +++ b/automated/android/tradefed/monitor_fastboot.sh @@ -0,0 +1,4 @@ +#!/bin/sh +while true; do +fastboot boot /lava-lxc/boot.img +done diff --git a/automated/android/tradefed/setup.sh b/automated/android/tradefed/setup.sh index fb5eb5b..86d8e69 100755 --- a/automated/android/tradefed/setup.sh +++ b/automated/android/tradefed/setup.sh @@ -10,7 +10,7 @@ if echo "$ANDROID_VERSION" | grep aosp-master ; then else JDK="openjdk-8-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" +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" dist_name case "${dist}" in diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py index 814ee1e..b5e966c 100755 --- a/automated/android/tradefed/tradefed-runner.py +++ b/automated/android/tradefed/tradefed-runner.py @@ -220,20 +220,25 @@ while child.isalive(): adb_command = "adb shell echo OK" adb_check = subprocess.Popen(shlex.split(adb_command)) if adb_check.wait() != 0: - logger.debug('adb connection lost! Trying to dump logs of all invocations...') - child.sendline('d l') - time.sleep(30) - subprocess.call(['sh', '-c', '. ../../lib/sh-test-lib && . ../../lib/android-test-lib && adb_debug_info']) - logger.debug('"adb devices" output') - subprocess.call(['adb', 'devices']) - logger.error('adb connection lost!! Will wait for 5 minutes and terminating tradefed shell test as adb connection is lost!') + logger.debug('adb connection lost! maybe device is rebooting. Lets check again in 5 minute') time.sleep(300) - child.terminate(force=True) - result = 'check-adb-connectivity fail' - py_test_lib.add_result(RESULT_FILE, result) - break + adb_check = subprocess.Popen(shlex.split(adb_command)) + if adb_check.wait() != 0: + logger.debug('adb connection lost! Trying to dump logs of all invocations...') + child.sendline('d l') + time.sleep(30) + subprocess.call(['sh', '-c', '. ../../lib/sh-test-lib && . ../../lib/android-test-lib && adb_debug_info']) + logger.debug('"adb devices" output') + subprocess.call(['adb', 'devices']) + logger.error('adb connection lost!! Will wait for 5 minutes and terminating tradefed shell test as adb connection is lost!') + time.sleep(300) + child.terminate(force=True) + result = 'check-adb-connectivity fail' + py_test_lib.add_result(RESULT_FILE, result) + break else: logger.info('adb device is alive') + time.sleep(300) # Check if all tests finished every minute. m = child.expect(['ResultReporter: Full Result:', diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml index 07cbcb0..4f06a58 100644 --- a/automated/android/tradefed/tradefed.yaml +++ b/automated/android/tradefed/tradefed.yaml @@ -45,6 +45,7 @@ run: # create test use to run the cts/vts tests - useradd -m testuser && echo "testuser created successfully" - chown testuser:testuser . + - ./monitor_fastboot.sh & - 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 @@ -59,3 +60,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 + - killall monitor_fastboot.sh |