summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-06-05 11:06:02 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-16 02:12:11 +0000
commit4c17d005ff59601ae7a6bf85747dc43a5e2f2dac (patch)
tree9cb27669a38803d5b92930628c8d0fcca02dae16
parentb30fe9b01bea50b1321bfc9045e0190074e03b5b (diff)
downloadchrome-ec-4c17d005ff59601ae7a6bf85747dc43a5e2f2dac.tar.gz
test/run_device_tests.py: Fail test if flashing failed
BRANCH=none BUG=b:151105339 TEST=Stop JLinkRemoteServerCLExe: ./test/run_device_tests.py -t flash_write_protect echo $? 1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7ca451f73a302a40f9d48fa901b55205180e0e96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2233782 Commit-Queue: Craig Hesling <hesling@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
-rwxr-xr-xtest/run_device_tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/run_device_tests.py b/test/run_device_tests.py
index 3d9b71ea58..cc6e302484 100755
--- a/test/run_device_tests.py
+++ b/test/run_device_tests.py
@@ -194,7 +194,8 @@ def flash(test_name, board):
test_name + '.bin'),
]
logging.debug('Running command: "%s"', ' '.join(cmd))
- subprocess.run(cmd).check_returncode()
+ completed_process = subprocess.run(cmd)
+ return completed_process.returncode == 0
def readline(executor, f, timeout_secs):
@@ -329,7 +330,9 @@ def main():
build(test.name, args.board)
# flash test binary
- flash(test.name, args.board)
+ if not flash(test.name, args.board):
+ test.passed = False
+ continue
if test.toggle_power:
power(args.board, board_config, on=False)