From b6405e2e12b71a397c3974a8735b9adcc5cce97f Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Wed, 17 Jan 2018 15:56:21 +0800 Subject: add more debug information for cts test Change-Id: I0c959e43f848e8403996b80f67cc59e79e16708e Signed-off-by: Yongqin Liu --- automated/android/tradefed/tradefed-runner.py | 10 +++++++++- automated/android/tradefed/tradefed.yaml | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'automated') 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 -- cgit v1.2.3