From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org
Cc: kwolf@redhat.com, den@openvz.org, qemu-devel@nongnu.org,
mreitz@redhat.com
Subject: Re: [PATCH 2/4] iotests.py: QemuIoInteractive: print output on failure
Date: Thu, 25 Jun 2020 09:46:07 -0500 [thread overview]
Message-ID: <8ac0baf2-794a-5981-8c5b-a10956cd0a0e@redhat.com> (raw)
In-Reply-To: <20200625142540.24589-3-vsementsov@virtuozzo.com>
On 6/25/20 9:25 AM, Vladimir Sementsov-Ogievskiy wrote:
> Make it simpler to debug when qemu-io failes due to wrong arguments or
fails
> environment.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> tests/qemu-iotests/iotests.py | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index efe9958f5e..ac9d199a1e 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -216,7 +216,13 @@ class QemuIoInteractive:
> stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT,
> universal_newlines=True)
> - assert self._p.stdout.read(9) == 'qemu-io> '
> + out = self._p.stdout.read(9)
> + if out != 'qemu-io> ':
> + # Most probably qemu-io just failed to start.
> + # Let's collect the whole output and exit.
> + out += self._p.stdout.read()
> + self._p.wait(timeout=1)
> + raise ValueError(out)
>
Looks sensible.
Reviewed-by: Eric Blake <eblake@redhat.com>
> def close(self):
> self._p.communicate('q\n')
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-06-25 14:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 14:25 [PATCH 0/4] Fix crash due to NBD export leak Vladimir Sementsov-Ogievskiy
2020-06-25 14:25 ` [PATCH 1/4] iotests: QemuIoInteractive: use qemu_io_args_no_fmt Vladimir Sementsov-Ogievskiy
2020-06-25 19:32 ` Eric Blake
2020-06-25 14:25 ` [PATCH 2/4] iotests.py: QemuIoInteractive: print output on failure Vladimir Sementsov-Ogievskiy
2020-06-25 14:46 ` Eric Blake [this message]
2020-06-25 14:25 ` [PATCH 3/4] nbd: make client_close synchronous Vladimir Sementsov-Ogievskiy
2020-06-25 14:48 ` Eric Blake
2020-06-29 7:55 ` Vladimir Sementsov-Ogievskiy
2020-06-29 13:56 ` Stefan Hajnoczi
2020-07-01 10:19 ` Vladimir Sementsov-Ogievskiy
2020-06-25 14:25 ` [PATCH 4/4] iotests: test shutdown when bitmap is exported through NBD Vladimir Sementsov-Ogievskiy
2020-06-25 15:15 ` [PATCH 0/4] Fix crash due to NBD export leak no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ac0baf2-794a-5981-8c5b-a10956cd0a0e@redhat.com \
--to=eblake@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).