add prints to smoketest

Signed-off-by: Amir Malka <amirm@armosec.io>
This commit is contained in:
Amir Malka
2023-08-02 09:52:01 +03:00
parent 0c019819ff
commit 467a84ddac
+7 -1
View File
@@ -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}"