[prev in list] [next in list] [prev in thread] [next in thread]
List: qemu-block
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] iotests: Let 216 make use of qemu-io's exit code
From: Eric Blake <eblake () redhat ! com>
Date: 2018-04-30 16:44:04
Message-ID: b9482f2c-31a8-9d94-9e02-357eb1c1d3d8 () redhat ! com
[Download RAW message or body]
On 04/28/2018 09:41 AM, Max Reitz wrote:
> As a showcase of how you can use qemu-io's exit code to determine
> success or failure (same for qemu-img), this test is changed to use
> qemu_io_silent() instead of qemu_io(), and to assert the exit code
> instead of logging the filtered result.
>
> One real advantage of this is that in case of an error, you get a
> backtrace that helps you locate the issue in the test file quickly.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> tests/qemu-iotests/216 | 23 ++++++++++++-----------
> tests/qemu-iotests/216.out | 17 ++---------------
> 2 files changed, 14 insertions(+), 26 deletions(-)
> - qemu_img_pipe('create', '-f', iotests.imgfmt, base_img_path, '64M')
> + assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
Yeah, I can see how writing the setup for a test gets simpler when you
don't have to worry about logging and filtering the stuff that isn't the
heart of the test.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic