diff options
author | Al Semjonovs <asemjonovs@google.com> | 2022-09-15 09:32:26 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-15 17:56:01 +0000 |
commit | 85bf6634783828083f3e36313640053b86841f1c (patch) | |
tree | 25ce8f8dc26cd4b104d4466446c5769c8cbc64d2 | |
parent | 375305e76bb87ef51c0d1db2d6bbfcc066b31a91 (diff) | |
download | chrome-ec-85bf6634783828083f3e36313640053b86841f1c.tar.gz |
zephyr: Check if rdb tool is available before trying to upload
Check if rdb tool is available before trying to upload test
results.
BUG=None
BRANCH=NONE
TEST=in chroot
./twister -T zephyr/test
outside chroot (no rdb)
./twister -T zephyr/test
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
Change-Id: I86863c3e55aca13ccada01db083fa0192c20f0c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3900051
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rwxr-xr-x | util/twister_launcher.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/twister_launcher.py b/util/twister_launcher.py index 6fd871d31b..c30c6191f8 100755 --- a/util/twister_launcher.py +++ b/util/twister_launcher.py @@ -69,6 +69,7 @@ import shlex import subprocess import sys from pathlib import Path +from shutil import which def find_checkout() -> Path: @@ -134,6 +135,11 @@ def find_modules(mod_dir: Path) -> list: return modules +def is_tool(name): + """Check if 'name' is on PATH and marked executable.""" + return which(name) is not None + + def is_rdb_login(): """Checks if user is logged into rdb""" cmd = ["rdb", "auth-info"] @@ -298,7 +304,7 @@ def main(): else: print("TEST EXECUTION FAILED") - if intercepted_args.upload_cros_rdb: + if is_tool("rdb") and intercepted_args.upload_cros_rdb: upload_results(ec_base) sys.exit(result.returncode) |