Skip to content

Commit 1f4b774

Browse files
Vladimir Sementsov-Ogievskiyebblake
authored andcommitted
iotests.py: QemuIoInteractive: print output on failure
Make it simpler to debug when qemu-io fails due to wrong arguments or environment. Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> Reviewed-by: Eric Blake <[email protected]> Message-Id: <[email protected]> Signed-off-by: Eric Blake <[email protected]>
1 parent a1a7f56 commit 1f4b774

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/qemu-iotests/iotests.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ def __init__(self, *args):
217217
stdout=subprocess.PIPE,
218218
stderr=subprocess.STDOUT,
219219
universal_newlines=True)
220-
assert self._p.stdout.read(9) == 'qemu-io> '
220+
out = self._p.stdout.read(9)
221+
if out != 'qemu-io> ':
222+
# Most probably qemu-io just failed to start.
223+
# Let's collect the whole output and exit.
224+
out += self._p.stdout.read()
225+
self._p.wait(timeout=1)
226+
raise ValueError(out)
221227

222228
def close(self):
223229
self._p.communicate('q\n')

0 commit comments

Comments
 (0)