]> git.proxmox.com Git - mirror_qemu.git/commit
iotests: make qemu_img raise on non-zero rc by default
authorJohn Snow <jsnow@redhat.com>
Mon, 21 Mar 2022 20:16:04 +0000 (16:16 -0400)
committerHanna Reitz <hreitz@redhat.com>
Tue, 22 Mar 2022 09:14:26 +0000 (10:14 +0100)
commit2882ccf86a9bc7ea9ae23dce2bad91c8d3e7e135
treeaded8a4dfc87502c6907aef078d7ea7b223152e4
parentfc272d3ce0094d2c2aff973662536d8d1a6943e5
iotests: make qemu_img raise on non-zero rc by default

re-write qemu_img() as a function that will by default raise a
VerboseProcessException (extended from CalledProcessException) on
non-zero return codes. This will produce a stack trace that will show
the command line arguments and return code from the failed process run.

Users that want something more flexible (there appears to be only one)
can use check=False and manage the return themselves. However, when the
return code is negative, the Exception will be raised no matter what.
This is done under the belief that there's no legitimate reason, even in
negative tests, to see a crash from qemu-img.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220321201618.903471-5-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
tests/qemu-iotests/257
tests/qemu-iotests/iotests.py