summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/twister_launcher.py8
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)