[PATCH 0/5] iotests: add enhanced debugging info to qemu-img failures

John Snow posted 5 patches 2 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220303205902.4106779-1-jsnow@redhat.com
Test checkpatch failed
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Beraldo Leal <bleal@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
python/qemu/utils/__init__.py                 | 114 ++++++++++++++++++
tests/qemu-iotests/163                        |   9 +-
tests/qemu-iotests/216                        |   6 +-
tests/qemu-iotests/218                        |   2 +-
tests/qemu-iotests/224                        |  11 +-
tests/qemu-iotests/228                        |  12 +-
tests/qemu-iotests/257                        |  11 +-
tests/qemu-iotests/258                        |   4 +-
tests/qemu-iotests/310                        |  14 +--
tests/qemu-iotests/iotests.py                 |  69 +++++++++--
tests/qemu-iotests/tests/block-status-cache   |   3 +-
tests/qemu-iotests/tests/image-fleecing       |   4 +-
.../tests/mirror-ready-cancel-error           |   6 +-
tests/qemu-iotests/tests/mirror-top-perms     |   3 +-
.../tests/remove-bitmap-from-backing          |   8 +-
.../qemu-iotests/tests/stream-error-on-reset  |   4 +-
16 files changed, 220 insertions(+), 60 deletions(-)
[PATCH 0/5] iotests: add enhanced debugging info to qemu-img failures
Posted by John Snow 2 years, 1 month ago
This is kinda-sorta V3-ish of a series I started in response to Thomas
Huth's encountering a failure in qemu-img because of missing zstd
support. This series changes the qemu_img() function in iotests.py to
one that raises an Exception on non-zero return code by default.

Alongside this, the Exception object itself is also augmented so that it
prints the stdout/stderr logs to screen if the exception goes unhandled
so that failure cases are very obvious and easy to spot in the middle of
python tracebacks.

(Test this out yourself: Disable zstd support and then run qcow2 iotest
065 before and after this patchset. It makes a real difference!)

NOTE: I have another 13-ish patches that go the rest of the way and
ensure that *every* call to qemu-img goes through this new qemu_img()
function, but for the sake of doing the most good in the shortest amount
of time, I am sending just the first 5 patches, and the rest will be
sent later. I think this is a very good series to get in before freeze
so that we have it during the heavy testing season.

John Snow (5):
  python/utils: add add_visual_margin() text decoration utility
  python/utils: add VerboseProcessError
  iotests: Remove explicit checks for qemu_img() == 0
  iotests: make qemu_img raise on non-zero rc by default
  iotests: fortify compare_images() against crashes

 python/qemu/utils/__init__.py                 | 114 ++++++++++++++++++
 tests/qemu-iotests/163                        |   9 +-
 tests/qemu-iotests/216                        |   6 +-
 tests/qemu-iotests/218                        |   2 +-
 tests/qemu-iotests/224                        |  11 +-
 tests/qemu-iotests/228                        |  12 +-
 tests/qemu-iotests/257                        |  11 +-
 tests/qemu-iotests/258                        |   4 +-
 tests/qemu-iotests/310                        |  14 +--
 tests/qemu-iotests/iotests.py                 |  69 +++++++++--
 tests/qemu-iotests/tests/block-status-cache   |   3 +-
 tests/qemu-iotests/tests/image-fleecing       |   4 +-
 .../tests/mirror-ready-cancel-error           |   6 +-
 tests/qemu-iotests/tests/mirror-top-perms     |   3 +-
 .../tests/remove-bitmap-from-backing          |   8 +-
 .../qemu-iotests/tests/stream-error-on-reset  |   4 +-
 16 files changed, 220 insertions(+), 60 deletions(-)

-- 
2.34.1