iotests: add enhanced debugging info to qemu-img failures
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest18 patches 3 repliesIn review
- v418 patches 11 repliesSuperseded
- v35 patches 17 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 5 patches | 2 replies | Superseded | |
| v1 | 5 patches | 5 replies | Superseded |
v4 from the cover letter
- Combine both series into one big series again.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | python/utils: add add_visual_margin() text decoration utilitypython/ | +78 | 0 replies | |
| 2/18 | python/utils: add VerboseProcessErrorpython/ | +39 | 0 replies | |
| 3/18 | iotests: Remove explicit checks for qemu_img() == 0tests/ tests/ tests/ +12 more | +45 | 0 replies | |
| 4/18 | iotests: make qemu_img raise on non-zero rc by defaulttests/ tests/ | +55 | 0 replies | |
| 5/18 | iotests: fortify compare_images() against crashestests/ | +16 | 0 replies | |
| 6/18 | iotests: add qemu_img_json()tests/ | +32 | 0 replies | |
| 7/18 | iotests: use qemu_img_json() when applicabletests/ | +4 | 0 replies | |
| 8/18 | iotests: add qemu_img_info()tests/ tests/ tests/ | +15 | 0 replies | |
| 9/18 | iotests/remove-bitmap-from-backing: use qemu_img_info()tests/ | +3 | 0 replies | |
| 10/18 | iotests: add qemu_img_map() functiontests/ tests/ tests/ +3 more | +17 | 0 replies | |
| 11/18 | iotests: change supports_quorum to use qemu_imgtests/ | +2 | 0 replies | |
| 12/18 | iotests: replace unchecked calls to qemu_img_pipe()tests/ tests/ tests/ +3 more | +10 | 0 replies | |
| 13/18 | iotests/149: Remove qemu_img_pipe() calltests/ tests/ | +5 | 0 replies | |
| 14/18 | iotests: remove remaining calls to qemu_img_pipe()tests/ tests/ tests/ +1 more | +9 | 0 replies | |
| 15/18 | iotests: use qemu_img() in has_working_luks()tests/ | +9 | 0 replies | |
| 16/18 | iotests: replace qemu_img_log('create', ...) callstests/ tests/ tests/ +3 more | +13 | 0 replies | |
| 17/18 | iotests: remove qemu_img_pipe_and_status()tests/ | +7 | 1 reply | |
| 18/18 | iotests: make qemu_img_log and img_info_log raise on errortests/ tests/ tests/ | +7 | 1 reply |
Reviews trailers per patch
All 18 patches have a Reviewed-by or Acked-by.
| Patch | Eric Blake | Hanna Reitz |
|---|---|---|
| 1/18 | R-b | A-b |
| 2/18 | R-b | R-b |
| 3/18 | R-b | R-b |
| 4/18 | R-b | R-b |
| 5/18 | R-b | R-b |
| 6/18 | R-b | |
| 7/18 | R-b | |
| 8/18 | R-b | |
| 9/18 | R-b | |
| 10/18 | R-b | |
| 11/18 | R-b | |
| 12/18 | R-b | |
| 13/18 | R-b | |
| 14/18 | R-b | |
| 15/18 | R-b | |
| 16/18 | R-b | |
| 17/18 | R-b | |
| 18/18 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 00/18] iotests: add enhanced debugging info to qemu-img failures
V5 hotfix:
- Quote the subprocess.CompletedProcess[str] type annotations, Python 3.6 chokes on them at runtime :(
- Reduce line length in the text decoration fn,
even though check-patch still doesn't like it.
- Reflow docstring for qemu_img.*
V5 CI: https://gitlab.com/jsnow/qemu/-/pipelines/496050668
[*] Didn't re-run CI for this tiny change. If it breaks something I WILL cry.
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 | 170 +++++++++++++----- 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, 354 insertions(+), 229 deletions(-)
Signature · 1 line
2.34.1