qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/18] iotests: add enhanced debugging info to qemu-img failures
@ 2022-03-17 23:49 John Snow
  2022-03-17 23:49 ` [PATCH v4 01/18] python/utils: add add_visual_margin() text decoration utility John Snow
                   ` (18 more replies)
  0 siblings, 19 replies; 30+ messages in thread
From: John Snow @ 2022-03-17 23:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Beraldo Leal, qemu-block, John Snow, Hanna Reitz,
	Cleber Rosa, Eric Blake

Hiya!

This series effectively replaces qemu_img_pipe_and_status() with a
rewritten function named qemu_img() that raises an exception on non-zero
return code by default. By the end of the series, every last invocation
of the qemu-img binary ultimately goes through qemu_img().

The exception that this function raises includes stdout/stderr output
when the traceback is printed in a a little decorated text box so that
it stands out from the jargony Python traceback readout.

(You can test what this looks like for yourself, or at least you could,
by disabling ztsd support and then running qcow2 iotest 065.)

Negative tests are still possible in two ways:

- Passing check=False to qemu_img, qemu_img_log, or img_info_log
- Catching and handling the CalledProcessError exception at the callsite.

Here's a summary of the changes to help you update any tests you may
have in flight:

qemu_img()                   => qemu_img().returncode
qemu_img_pipe()              => qemu_img().stdout
qemu_img_pipe_and_status()   => qemu_img()
json.loads(qemu_img_pipe())) => qemu_img_json()
qemu_img_log()               => qemu_img_log()

v4:

- Combine both series into one big series again.

002/18:[0007] [FC] 'python/utils: add VerboseProcessError'
  Added a comment and a temporary var to explain the
  "elif stderr is not None" thing.
  (Kept R-Bs because I live dangerously.)

006/18:[0014] [FC] 'iotests: add qemu_img_json()'
  Made this wayyyy less stupid. Thanks Hanna.

010/18:[0010] [FC] 'iotests: add qemu_img_map() function'
  Fixed test output for 211.

018/18:[down] 'iotests: make qemu_img_log and img_info_log raise on error'
  New, enforce a good return code by default for *all*
  qemu-img calls, logged or not.

John Snow (18):
  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
  iotests: add qemu_img_json()
  iotests: use qemu_img_json() when applicable
  iotests: add qemu_img_info()
  iotests/remove-bitmap-from-backing: use qemu_img_info()
  iotests: add qemu_img_map() function
  iotests: change supports_quorum to use qemu_img
  iotests: replace unchecked calls to qemu_img_pipe()
  iotests/149: Remove qemu_img_pipe() call
  iotests: remove remaining calls to qemu_img_pipe()
  iotests: use qemu_img() in has_working_luks()
  iotests: replace qemu_img_log('create', ...) calls
  iotests: remove qemu_img_pipe_and_status()
  iotests: make qemu_img_log and img_info_log raise on error

 python/qemu/utils/__init__.py                 | 117 ++++++++++++
 tests/qemu-iotests/041                        |   5 +-
 tests/qemu-iotests/065                        |   7 +-
 tests/qemu-iotests/149                        |   7 +-
 tests/qemu-iotests/149.out                    |  21 ---
 tests/qemu-iotests/163                        |   9 +-
 tests/qemu-iotests/194                        |   4 +-
 tests/qemu-iotests/202                        |   4 +-
 tests/qemu-iotests/203                        |   4 +-
 tests/qemu-iotests/211                        |   6 +-
 tests/qemu-iotests/211.out                    |  10 +-
 tests/qemu-iotests/216                        |   6 +-
 tests/qemu-iotests/218                        |   2 +-
 tests/qemu-iotests/224                        |  11 +-
 tests/qemu-iotests/228                        |  12 +-
 tests/qemu-iotests/234                        |   4 +-
 tests/qemu-iotests/237                        |   3 +-
 tests/qemu-iotests/237.out                    |   3 -
 tests/qemu-iotests/242                        |   7 +-
 tests/qemu-iotests/255                        |   8 +-
 tests/qemu-iotests/255.out                    |   4 -
 tests/qemu-iotests/257                        |  11 +-
 tests/qemu-iotests/258                        |   4 +-
 tests/qemu-iotests/262                        |   2 +-
 tests/qemu-iotests/266                        |   2 +-
 tests/qemu-iotests/274                        |  17 +-
 tests/qemu-iotests/274.out                    |  29 ---
 tests/qemu-iotests/280                        |   2 +-
 tests/qemu-iotests/280.out                    |   1 -
 tests/qemu-iotests/296                        |  12 +-
 tests/qemu-iotests/303                        |   2 +-
 tests/qemu-iotests/310                        |  13 +-
 tests/qemu-iotests/iotests.py                 | 169 +++++++++++++-----
 tests/qemu-iotests/tests/block-status-cache   |  14 +-
 .../qemu-iotests/tests/graph-changes-while-io |   7 +-
 tests/qemu-iotests/tests/image-fleecing       |  10 +-
 .../tests/mirror-ready-cancel-error           |   6 +-
 tests/qemu-iotests/tests/mirror-top-perms     |   3 +-
 .../qemu-iotests/tests/parallels-read-bitmap  |   6 +-
 .../tests/remove-bitmap-from-backing          |  14 +-
 .../qemu-iotests/tests/stream-error-on-reset  |   4 +-
 41 files changed, 353 insertions(+), 229 deletions(-)

-- 
2.34.1




^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-03-21 16:31 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-17 23:49 [PATCH v4 00/18] iotests: add enhanced debugging info to qemu-img failures John Snow
2022-03-17 23:49 ` [PATCH v4 01/18] python/utils: add add_visual_margin() text decoration utility John Snow
2022-03-17 23:49 ` [PATCH v4 02/18] python/utils: add VerboseProcessError John Snow
2022-03-17 23:49 ` [PATCH v4 03/18] iotests: Remove explicit checks for qemu_img() == 0 John Snow
2022-03-17 23:49 ` [PATCH v4 04/18] iotests: make qemu_img raise on non-zero rc by default John Snow
2022-03-17 23:49 ` [PATCH v4 05/18] iotests: fortify compare_images() against crashes John Snow
2022-03-17 23:49 ` [PATCH v4 06/18] iotests: add qemu_img_json() John Snow
2022-03-21 13:40   ` Eric Blake
2022-03-17 23:49 ` [PATCH v4 07/18] iotests: use qemu_img_json() when applicable John Snow
2022-03-17 23:49 ` [PATCH v4 08/18] iotests: add qemu_img_info() John Snow
2022-03-17 23:49 ` [PATCH v4 09/18] iotests/remove-bitmap-from-backing: use qemu_img_info() John Snow
2022-03-17 23:49 ` [PATCH v4 10/18] iotests: add qemu_img_map() function John Snow
2022-03-21 14:24   ` Eric Blake
2022-03-21 16:15     ` John Snow
2022-03-17 23:49 ` [PATCH v4 11/18] iotests: change supports_quorum to use qemu_img John Snow
2022-03-17 23:49 ` [PATCH v4 12/18] iotests: replace unchecked calls to qemu_img_pipe() John Snow
2022-03-17 23:49 ` [PATCH v4 13/18] iotests/149: Remove qemu_img_pipe() call John Snow
2022-03-17 23:49 ` [PATCH v4 14/18] iotests: remove remaining calls to qemu_img_pipe() John Snow
2022-03-17 23:49 ` [PATCH v4 15/18] iotests: use qemu_img() in has_working_luks() John Snow
2022-03-17 23:49 ` [PATCH v4 16/18] iotests: replace qemu_img_log('create', ...) calls John Snow
2022-03-17 23:49 ` [PATCH v4 17/18] iotests: remove qemu_img_pipe_and_status() John Snow
2022-03-17 23:49 ` [PATCH v4 18/18] iotests: make qemu_img_log and img_info_log raise on error John Snow
2022-03-18 13:35 ` [PATCH v4 00/18] iotests: add enhanced debugging info to qemu-img failures Hanna Reitz
2022-03-18 15:08   ` John Snow
2022-03-18 16:38     ` Hanna Reitz
2022-03-18 21:14   ` John Snow
2022-03-21 13:14     ` Hanna Reitz
2022-03-21 15:50       ` Hanna Reitz
2022-03-21 16:23         ` John Snow
2022-03-21 16:26           ` Hanna Reitz

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).