From 0bb32329287ed6742eb58f0f73b3e2d5d1930eee Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Tue, 7 Mar 2017 15:20:56 +0100 Subject: automated: android: handle failed cts test run Change-Id: I907b91ee0670087551f5f61d8ea03a882e3c2208 Signed-off-by: Chase Qi --- automated/android/cts/cts-runner.py | 9 ++++++++- automated/android/cts/cts.sh | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'automated/android') diff --git a/automated/android/cts/cts-runner.py b/automated/android/cts/cts-runner.py index aa25e21..50589e3 100755 --- a/automated/android/cts/cts-runner.py +++ b/automated/android/cts/cts-runner.py @@ -141,7 +141,14 @@ while child.isalive(): try: # Check if all tests finished every minute. - child.expect('I/ResultReporter: Full Result:', timeout=60) + m = child.expect(['I/ResultReporter: Full Result:', + 'I/ConsoleReporter:.*Test run failed to complete.'], + timeout=60) + if m == 0: + py_test_lib.add_result(RESULT_FILE, 'cts-test-run pass') + elif m == 1: + py_test_lib.add_result(RESULT_FILE, 'cts-test-run fail') + # Once all tests finshed, exit from tf shell and throw EOF. child.sendline('exit') child.expect(pexpect.EOF, timeout=60) diff --git a/automated/android/cts/cts.sh b/automated/android/cts/cts.sh index 34e56a7..9f5bdc3 100755 --- a/automated/android/cts/cts.sh +++ b/automated/android/cts/cts.sh @@ -81,7 +81,6 @@ fi # Run CTS test. ./cts-runner.py -t "${TEST_PARAMS}" -n "${SN}" -check_return "cts-test-run" # Cleanup. rm -f /etc/apt/sources.list.d/cts.list -- cgit v1.2.3