diff options
author | Per Larsen <perlarsen@google.com> | 2022-12-22 00:27:01 +0000 |
---|---|---|
committer | Armelle Laine <armellel@google.com> | 2022-12-23 17:14:03 +0000 |
commit | 7c9311f638f70195e374843040aaf6c34836a1f5 (patch) | |
tree | bf262b810a744ac4e3cd2155580eede72f74af9f | |
parent | 394b803479ac9b38ad044c160bfa395d9fe20c4c (diff) | |
download | generic-arm64-7c9311f638f70195e374843040aaf6c34836a1f5.tar.gz |
project/qemu: Dump system log on test failure
If an android test returns a non-zero status code, whether due
to a timeout or a test failure, mark that the session encountered
an error. This ensures that the system log gets printed when the
emulator environment shuts down.
Bug: None
Test: manually, set timeout for pincputest to 30s; then run
build.py qemu-generic-arm64-test-debug --test "^android.*com.android.kernel.pincputest"
Change-Id: I4f76d8cde75dbfb72c8e69c9ff3e7a4bfc506b48
-rw-r--r-- | project/qemu/qemu.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/project/qemu/qemu.py b/project/qemu/qemu.py index 8fb478d..1fc6949 100644 --- a/project/qemu/qemu.py +++ b/project/qemu/qemu.py @@ -608,8 +608,12 @@ class Runner(object): qemu_handle_error(command_pipe=session.command_pipe, debug_on_error=self.debug_on_error) - return self.adb(["shell"] + cmd, timeout=test_timeout, - on_timeout=on_adb_timeout, force_output=True) + test_result = self.adb(["shell"] + cmd, timeout=test_timeout, + on_timeout=on_adb_timeout, force_output=True) + if test_result: + session.has_error = True + + return test_result except: session.has_error = True raise @@ -990,8 +994,6 @@ class Runner(object): test_result = self.androidtest_run([android_test], timeout) test_results.append(test_result) if test_result: - assert self.session # appease mypy - self.session.has_error = True break return test_results |