Skip to content

iotests: add enhanced debugging info to qemu-io failures

John Snow qemu-devel 3 versions – Applied

Status from this message: Thanks, applied to my block branch:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 3 repliesApplied
  2. v217 patches 10 repliesSuperseded
  3. v115 patches 38 repliesSuperseded

Changes in v3 from the cover letter

- Rebased
- Squashed the patches that I said I would

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/12iotests: replace calls to log(qemu_io(...)) with qemu_io_log()tests/qemu-iotests/242 tests/qemu-iotests/255 tests/qemu-iotests/303+6 -80 replies
2/12iotests/163: Fix broken qemu-io invocationtests/qemu-iotests/163+1 -40 replies
3/12iotests: Don't check qemu_io() output for specific error stringstests/qemu-iotests/040 tests/qemu-iotests/056+17 -180 replies
4/12iotests/040: Don't check image pattern on zero-length imagetests/qemu-iotests/040+12 -20 replies
5/12iotests/040: Fix TestCommitWithFilters testtests/qemu-iotests/040+4 -20 replies
6/12iotests: create generic qemu_tool() functiontests/qemu-iotests/iotests.py+21 -110 replies
7/12iotests: rebase qemu_io() on top of qemu_tool()tests/qemu-iotests/030 tests/qemu-iotests/149 tests/qemu-iotests/205 +3 more+81 -541 reply
8/12iotests/migration-permissions: use assertRaises() for qemu_io() negative testtests/qemu-iotests/tests/migration-permissions+14 -140 replies
9/12iotests/image-fleecing: switch to qemu_io()tests/qemu-iotests/tests/image-fleecing+19 -90 replies
10/12iotests: remove qemu_io_pipe_and_status()tests/qemu-iotests/iotests.py+0 -30 replies
11/12iotests: remove qemu_io_silent() and qemu_io_silent_check().tests/qemu-iotests/216 tests/qemu-iotests/218 tests/qemu-iotests/224 +7 more+37 -580 replies
12/12iotests: make qemu_io_log() check return codes by defaulttests/qemu-iotests/iotests.py tests/qemu-iotests/tests/nbd-reconnect-on-open+4 -30 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchEric BlakeHanna Reitz
1/12R-b R-b
2/12R-b R-b
3/12R-b R-b
4/12R-b R-b
5/12R-b
6/12R-b R-b
7/12R-b
8/12R-b T-b R-b
9/12R-b R-b
10/12R-b R-b
11/12R-b R-b
12/12R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures

GitLab: https://gitlab.com/jsnow/qemu/-/commits/iotests_qemu_io_diagnostics

Howdy,

This series does for qemu_io() what we've done for qemu_img() and makes it a function that checks the return code by default and raises an Exception when things do not go according to plan.

This series removes qemu_io_pipe_and_status(), qemu_io_silent(), and qemu_io_silent_check() in favor of just qemu_io().

V3:

- Rebased
- Squashed the patches that I said I would

Note: check-tox job will fail right now, it's unrelated to this series; see https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg07149.html

V2:

- Fixed 040
- Fixed 245 on tmpfs
- Fixed tests/image-fleecing

- I expect to respin a v3 to:
(A) Fix the commit message on the 040 fix
(B) Squash patches 7-12.

Notes:

- There are a few remaining uses of qemu-io that don't go through qemu_io; QemuIoInteractive is a user that is used in 205, 298, 299, and 307. It ... did not appear worth it to morph qemu_tool_popen into something that could be used by both QemuIoInteractive *and* qemu_io(), so I left it alone. It's probably fine for now. (But it does bother me, a little.)

- qemu_io_popen itself is used by the nbd-reconnect-on-open test, and it seems like a legitimate use -- it wants concurrency. Like the above problem, I couldn't find a way to bring it into the fold, so I didn't. (Meh.) I eventually plan to add asyncio subprocess management to machine.py, and I could tackle stuff like this then. It's not worth it now.

(Maybe I'll bring these in under the fold the next time I get bored, but I think it's not worth the trouble right now, there are very few users. I did try, but the benefit to VerboseProcessError is that it includes stdout/stderr. When using Popen with pipes you lose access to that information in the management context. Popen does not natively buffer stdout/stderr, so we'd have to fall back to just using a regular CalledProcessError. I think I'd have to extend Popen and add buffering. I think that's something for later.)

(I tried doing the above and it's definitely more hassle than it's worth right now.)

John Snow (12):
iotests: replace calls to log(qemu_io(...)) with qemu_io_log() iotests/163: Fix broken qemu-io invocation
iotests: Don't check qemu_io() output for specific error strings iotests/040: Don't check image pattern on zero-length image iotests/040: Fix TestCommitWithFilters test
iotests: create generic qemu_tool() function
iotests: rebase qemu_io() on top of qemu_tool() iotests/migration-permissions: use assertRaises() for qemu_io()
negative test
iotests/image-fleecing: switch to qemu_io()
iotests: remove qemu_io_pipe_and_status()
iotests: remove qemu_io_silent() and qemu_io_silent_check().
iotests: make qemu_io_log() check return codes by default

 tests/qemu-iotests/030                        | 85 +++++++++++--------
 tests/qemu-iotests/040                        | 53 +++++++-----
 tests/qemu-iotests/056                        |  2 +-
 tests/qemu-iotests/149                        |  6 +-
 tests/qemu-iotests/163                        |  5 +-
 tests/qemu-iotests/205                        |  4 +-
 tests/qemu-iotests/216                        | 12 +--
 tests/qemu-iotests/218                        |  5 +-
 tests/qemu-iotests/224                        |  4 +-
 tests/qemu-iotests/242                        |  6 +-
 tests/qemu-iotests/245                        | 17 ++--
 tests/qemu-iotests/255                        |  4 +-
 tests/qemu-iotests/258                        | 11 ++-
 tests/qemu-iotests/298                        | 15 ++--
 tests/qemu-iotests/303                        |  4 +-
 tests/qemu-iotests/310                        | 22 ++---
 tests/qemu-iotests/iotests.py                 | 69 ++++++++-------
 tests/qemu-iotests/tests/image-fleecing       | 30 ++++---
 .../qemu-iotests/tests/migration-permissions  | 28 +++---
 .../tests/mirror-ready-cancel-error           |  2 +-
 .../qemu-iotests/tests/nbd-reconnect-on-open  |  2 +-
 .../qemu-iotests/tests/stream-error-on-reset  |  4 +-
 22 files changed, 210 insertions(+), 180 deletions(-)
Signature · 1 line
2.34.1