From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com,
qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com,
den@openvz.org
Subject: [PATCH v2 2/5] iotests.py: QemuIoInteractive: print output on failure
Date: Wed, 1 Jul 2020 13:53:28 +0300 [thread overview]
Message-ID: <20200701105331.121670-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20200701105331.121670-1-vsementsov@virtuozzo.com>
Make it simpler to debug when qemu-io fails due to wrong arguments or
environment.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.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)
def close(self):
self._p.communicate('q\n')
--
2.18.0
next prev parent reply other threads:[~2020-07-01 10:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 10:53 [PATCH v2 0/5] Fix crash due to NBD export leak Vladimir Sementsov-Ogievskiy
2020-07-01 10:53 ` [PATCH v2 1/5] iotests: QemuIoInteractive: use qemu_io_args_no_fmt Vladimir Sementsov-Ogievskiy
2020-07-01 10:53 ` Vladimir Sementsov-Ogievskiy [this message]
2020-07-01 10:53 ` [PATCH v2 3/5] nbd: make nbd_export_close_all() synchronous Vladimir Sementsov-Ogievskiy
2020-07-13 13:03 ` Eric Blake
2020-07-01 10:53 ` [PATCH v2 4/5] iotests.py: filter_testfiles(): filter SOCK_DIR too Vladimir Sementsov-Ogievskiy
2020-07-13 13:07 ` Eric Blake
2020-07-13 14:00 ` Eric Blake
2020-07-13 14:31 ` Vladimir Sementsov-Ogievskiy
2020-07-01 10:53 ` [PATCH v2 5/5] iotests: test shutdown when bitmap is exported through NBD Vladimir Sementsov-Ogievskiy
2020-07-13 13:41 ` Eric Blake
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=20200701105331.121670-3-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).