mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
iotests: rebase qemu_io() on top of qemu_tool()
Rework qemu_io() to be analogous to qemu_img(); a function that requires a return code of zero by default unless disabled explicitly. Tests that use qemu_io(): 030 040 041 044 055 056 093 124 129 132 136 148 149 151 152 163 165 205 209 219 236 245 248 254 255 257 260 264 280 298 300 302 304 image-fleecing migrate-bitmaps-postcopy-test migrate-bitmaps-test migrate-during-backup migration-permissions Test that use qemu_io_log(): 242 245 255 274 303 307 nbd-reconnect-on-open Copy-pastables for testing/verification: ./check -qcow2 030 040 041 044 055 056 124 129 132 151 152 163 165 209 \ 219 236 242 245 248 254 255 257 260 264 274 \ 280 298 300 302 303 304 307 image-fleecing \ migrate-bitmaps-postcopy-test migrate-bitmaps-test \ migrate-during-backup nbd-reconnect-on-open ./check -raw 093 136 148 migration-permissions ./check -nbd 205 # ./configure configure --disable-gnutls --enable-gcrypt # this ALSO requires passwordless sudo. ./check -luks 149 # Just the tests that were edited in this commit: ./check -qcow2 030 040 242 245 ./check -raw migration-permissions ./check -nbd 205 ./check -luks 149 Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20220418211504.943969-8-jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
parent
b2d68a8e56
commit
6dede6a493
6 changed files with 82 additions and 55 deletions
|
@ -353,16 +353,23 @@ def qemu_io_wrap_args(args: Sequence[str]) -> List[str]:
|
|||
def qemu_io_popen(*args):
|
||||
return qemu_tool_popen(qemu_io_wrap_args(args))
|
||||
|
||||
def qemu_io(*args):
|
||||
'''Run qemu-io and return the stdout data'''
|
||||
return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args))[0]
|
||||
def qemu_io(*args: str, check: bool = True, combine_stdio: bool = True
|
||||
) -> 'subprocess.CompletedProcess[str]':
|
||||
"""
|
||||
Run QEMU_IO_PROG and return the status code and console output.
|
||||
|
||||
This function always prepends either QEMU_IO_OPTIONS or
|
||||
QEMU_IO_OPTIONS_NO_FMT.
|
||||
"""
|
||||
return qemu_tool(*qemu_io_wrap_args(args),
|
||||
check=check, combine_stdio=combine_stdio)
|
||||
|
||||
def qemu_io_pipe_and_status(*args):
|
||||
return qemu_tool_pipe_and_status('qemu-io', qemu_io_wrap_args(args))
|
||||
|
||||
def qemu_io_log(*args):
|
||||
result = qemu_io(*args)
|
||||
log(result, filters=[filter_testfiles, filter_qemu_io])
|
||||
def qemu_io_log(*args: str) -> 'subprocess.CompletedProcess[str]':
|
||||
result = qemu_io(*args, check=False)
|
||||
log(result.stdout, filters=[filter_testfiles, filter_qemu_io])
|
||||
return result
|
||||
|
||||
def qemu_io_silent(*args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue