From 8208bad1adac46a863c904c1b43544b8ede94c08 Mon Sep 17 00:00:00 2001 From: Joerg Hofrichter Date: Wed, 23 Oct 2024 13:49:16 +0200 Subject: [PATCH] ci: devtest: abort execution if uhd_find_devices failed --- .ci/utils/mutex_hardware.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.ci/utils/mutex_hardware.py b/.ci/utils/mutex_hardware.py index 3619c73d95..d1241c8bb7 100644 --- a/.ci/utils/mutex_hardware.py +++ b/.ci/utils/mutex_hardware.py @@ -328,18 +328,25 @@ def main(args): ) else: result = subprocess.run(shlex.split(command.format(fpga=fpga))) - if return_code == 0: + if result.returncode != 0: + print("Command exited with return code {}".format(result.returncode), flush=True) + print("Aborting execution (fpga={})".format(fpga), flush=True) return_code = result.returncode + break sys.exit(return_code) else: + return_code = 0 for command in args.test_commands: if args.working_dir: result = subprocess.run(shlex.split(command), cwd=args.working_dir) else: result = subprocess.run(shlex.split(command)) if result.returncode != 0: - sys.exit(result.returncode) - sys.exit(0) + print("Command exited with return code {}".format(result.returncode), flush=True) + print("Aborting execution", flush=True) + return_code = result.returncode + break + sys.exit(return_code) if __name__ == "__main__":