diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-07-01 13:53:28 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2020-07-13 09:01:01 -0500 |
commit | 1f4b774a6444575b86f27b17d3d01e4f41df6581 (patch) | |
tree | 3c54720209c3f5fc331da077b8067f238bcffd77 /tests | |
parent | a1a7f56cdd1ddc99fcd1078c9285849aaaaaeca9 (diff) | |
download | qemu-1f4b774a6444575b86f27b17d3d01e4f41df6581.zip qemu-1f4b774a6444575b86f27b17d3d01e4f41df6581.tar.gz qemu-1f4b774a6444575b86f27b17d3d01e4f41df6581.tar.bz2 |
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 <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200701105331.121670-3-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 109fb38..2a08fea 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -217,7 +217,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') |