From 63e35dbd88ca025037d72e910054f942fd8625ae Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 14 Dec 2023 04:34:00 -0800 Subject: [PATCH] auto-t: throw exception if executable is missing Certain tests may require external processes to work (e.g. testNetconfig) and if missing the test will just hang until the maximum test timeout. Check in start_process if the exe actually exists and if not throw an exception. --- tools/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/utils.py b/tools/utils.py index a07c3183..8219542e 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -34,6 +34,9 @@ class Process(subprocess.Popen): logfile = args[0] + if not shutil.which(args[0]): + raise Exception("%s is not found on system" % args[0]) + if Process.is_verbose(args[0], log=False): self.verbose = True