From 467a84ddac182c978e87c9923e2e78a77c04b2e7 Mon Sep 17 00:00:00 2001 From: Amir Malka Date: Wed, 2 Aug 2023 09:47:01 +0300 Subject: [PATCH] add prints to smoketest Signed-off-by: Amir Malka --- smoke_testing/smoke_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/smoke_testing/smoke_utils.py b/smoke_testing/smoke_utils.py index fc7d7815..66d8c0fb 100644 --- a/smoke_testing/smoke_utils.py +++ b/smoke_testing/smoke_utils.py @@ -4,10 +4,16 @@ import subprocess def get_exec_from_args(args: list): return args[1] - def run_command(command, stdin=subprocess.PIPE, stderr=subprocess.STDOUT): try: return f"{subprocess.check_output(command, stdin=stdin, stderr=stderr)}" + except subprocess.CalledProcessError as e: + print(f">>>>> Failed Command: {e.cmd}") + print(f">>>>>>> Output: {e.output}") + print(f">>>>>>> Stderr: {e.stderr}") + print(f">>>>>>> Stdout: {e.stdout}") + print(f">>>>>>> Exit status: {e.returncode}") + return f"{e}" except Exception as e: return f"{e}"