summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-01-17 15:56:21 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2018-01-17 15:56:21 +0800
commitb6405e2e12b71a397c3974a8735b9adcc5cce97f (patch)
tree551d05929c1a651ba1b3328d1335384aefe82c46
parent726c1c7a0c61dea9b58a86afa5d89b7785b0d07a (diff)
add more debug information for cts test
Change-Id: I0c959e43f848e8403996b80f67cc59e79e16708e Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-xautomated/android/tradefed/tradefed-runner.py10
-rw-r--r--automated/android/tradefed/tradefed.yaml2
2 files changed, 11 insertions, 1 deletions
diff --git a/automated/android/tradefed/tradefed-runner.py b/automated/android/tradefed/tradefed-runner.py
index 81541a1..3143d5b 100755
--- a/automated/android/tradefed/tradefed-runner.py
+++ b/automated/android/tradefed/tradefed-runner.py
@@ -217,9 +217,11 @@ while child.isalive():
timeout=60)
# CTS tests finished correctly.
if m == 0:
+ logger.info('Output for debug purposea: m=%d: ResultReporter: Full Result: matched' % m)
py_test_lib.add_result(RESULT_FILE, 'tradefed-test-run pass')
# CTS tests ended with failure.
elif m == 1:
+ logger.info('Output for debug purposea: m=%d: ConsoleReporter:.*Test run failed to complete. matched' % m)
py_test_lib.add_result(RESULT_FILE, 'tradefed-test-run fail')
# CTS not finished yet, continue to wait.
elif m == 2:
@@ -227,10 +229,14 @@ while child.isalive():
child.expect(['.+', pexpect.TIMEOUT, pexpect.EOF], timeout=1)
logger.info('Printing tradefed recent output...')
subprocess.call(['tail', TRADEFED_STDOUT])
+ else:
+ logger.info('Output for debug purpose: m=%d' % m)
# Once all tests finshed, exit from tf shell to throw EOF, which sets child.isalive() to false.
- if m == 0 or m == 1:
+ #if m == 0 or m == 1:
+ if m == 0:
try:
+ logger.debug('Try to stop the execution...m=%d' % m)
child.expect(prompt, timeout=60)
logger.debug('Sending "exit" command to TF shell...')
child.sendline('exit')
@@ -241,6 +247,8 @@ while child.isalive():
logger.debug('Unsuccessful clean exit, force killing child process...')
child.terminate(force=True)
break
+ else:
+ logger.debug('Test execution continued...')
logger.info('Tradefed test finished')
diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml
index baf2a5e..f9d4f9c 100644
--- a/automated/android/tradefed/tradefed.yaml
+++ b/automated/android/tradefed/tradefed.yaml
@@ -53,3 +53,5 @@ run:
# Send test result to LAVA.
- ../../utils/send-to-lava.sh ./output/result.txt
- 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