iotests: make qemu_io_log() check return codes by default

Just like qemu_img_log(), upgrade qemu_io_log() to enforce a return code
of zero by default.

Tests that use qemu_io_log(): 242 245 255 274 303 307 nbd-reconnect-on-open

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220418211504.943969-13-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
John Snow 2022-04-18 17:15:04 -04:00 committed by Hanna Reitz
parent 72cfb937b8
commit 40bfeae134
2 changed files with 4 additions and 3 deletions

View File

@ -364,8 +364,9 @@ def qemu_io(*args: str, check: bool = True, combine_stdio: bool = True
return qemu_tool(*qemu_io_wrap_args(args),
check=check, combine_stdio=combine_stdio)
def qemu_io_log(*args: str) -> 'subprocess.CompletedProcess[str]':
result = qemu_io(*args, check=False)
def qemu_io_log(*args: str, check: bool = True
) -> 'subprocess.CompletedProcess[str]':
result = qemu_io(*args, check=check)
log(result.stdout, filters=[filter_testfiles, filter_qemu_io])
return result

View File

@ -39,7 +39,7 @@ def check_fail_to_connect(open_timeout):
log(f'Check fail to connect with {open_timeout} seconds of timeout')
start_t = time.time()
qemu_io_log(*create_args(open_timeout))
qemu_io_log(*create_args(open_timeout), check=False)
delta_t = time.time() - start_t
max_delta = open_timeout + 0.2