From fb0b17a19fd9817e5505dc095ed65ffdb3538a4f Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Tue, 24 Oct 2017 12:59:49 +0200 Subject: [PATCH] test/vhost: always print command output In case of error the message is command output and is confusing: ERROR! While executing FIO jobs - RC: 1, Err message: hostname=VM-11-0xC0000000, be=0, 64-bit, os=Linux, arch=x86-64, fio=fio-2.2.10, flags=1 19:04:59 hostname=VM-10-0x30000000, be=0, 64-bit, os=Linux, arch=x86-64, fio=fio-2.2.10, flags=1 So change this to always print command output then error message. Change-Id: Iee4b25a00438c153a0d4d250ae43fc0d283faf33 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/383596 Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- test/vhost/common/run_fio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/vhost/common/run_fio.py b/test/vhost/common/run_fio.py index b3003a4aa..fd9ca4cd8 100755 --- a/test/vhost/common/run_fio.py +++ b/test/vhost/common/run_fio.py @@ -74,11 +74,12 @@ def run_fio(vms, fio_cfg_fname, out_path, perf_vmex=False): # if for some reason output contains lines with "eta" - remove them out = re.sub(r'.+\[eta\s+\d{2}m:\d{2}s\]', '', out) + print(out) + if rc != 0: - print("ERROR! While executing FIO jobs - RC: {rc}, Err message: {out}".format(rc=rc, out=out)) + print("ERROR! While executing FIO jobs - RC: {rc}".format(rc=rc, out=out)) sys.exit(rc) else: - print(out) save_file(os.path.join(out_path, ".".join([fio_cfg_prefix, "log"])), "w", out) if perf_vmex: @@ -170,7 +171,7 @@ def main(): out = exec_cmd("./test/vhost/common/vm_ssh.sh {vm_num} sh -c 'echo {line} >> {cfg}'" .format(vm_num=i, line=line.strip(), cfg=fio_cfg_fname), blocking=True) if out[0] != 0: - print("ERROR! While copying FIO job config file to VM {vm_num} - {vm_ip}" + print("ERROR! While copying FIO job config file to VM {vm_num} - {vm_ip}\n" .format(vm_num=1, vm_ip=vm[0])) sys.exit(1)