Skip to content

iotests: Honor $IMGOPTS in Python tests

Max Reitz qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest67 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/67iotests.py: Read $IMGOPTStests/qemu-iotests/iotests.py+6 -03 replies
2/67iotests.py: Add @skip_for_imgopts()tests/qemu-iotests/iotests.py+13 -03 replies
3/67iotests.py: Add unsupported_imgoptstests/qemu-iotests/iotests.py+6 -12 replies
4/67iotests.py: create_test_image, remove_test_imagetests/qemu-iotests/iotests.py+56 -04 replies
5/67iotests.py: Add ImagePathstests/qemu-iotests/iotests.py+30 -20 replies
6/67iotests.py: Add image_path()tests/qemu-iotests/iotests.py+12 -50 replies
7/67iotests.py: Filter data_file in filter_img_infotests/qemu-iotests/iotests.py+4 -00 replies
8/67iotests.py: Add filter_json_filename()tests/qemu-iotests/iotests.py+3 -00 replies
9/67iotests.py: Add @hide_fields to img_info_logtests/qemu-iotests/iotests.py+9 -20 replies
10/67iotests/169: Skip persistent cases for compat=0.10tests/qemu-iotests/169+12 -10 replies
11/67iotests/224: Filter json:{} from commit commandtests/qemu-iotests/224 tests/qemu-iotests/224.out+14 -50 replies
12/67iotests/228: Filter json:{} filenamestests/qemu-iotests/228 tests/qemu-iotests/228.out+8 -80 replies
13/67iotests/242: Hide refcount bit informationtests/qemu-iotests/242 tests/qemu-iotests/242.out+3 -80 replies
14/67iotests: Use unsupported_imgopts in Python teststests/qemu-iotests/044 tests/qemu-iotests/057 tests/qemu-iotests/065 +12 more+50 -150 replies
15/67iotests/030: Honor $IMGOPTStests/qemu-iotests/030+32 -370 replies
16/67iotests/040: Honor $IMGOPTStests/qemu-iotests/040+21 -210 replies
17/67iotests/041: Honor $IMGOPTStests/qemu-iotests/041+51 -570 replies
18/67iotests/044: Honor $IMGOPTStests/qemu-iotests/044+3 -30 replies
19/67iotests/045: Honor $IMGOPTStests/qemu-iotests/045+13 -130 replies
20/67iotests/055: Honor $IMGOPTStests/qemu-iotests/055+23 -180 replies
21/67iotests/056: Honor $IMGOPTStests/qemu-iotests/056+14 -160 replies
22/67iotests/057: Honor $IMGOPTStests/qemu-iotests/057+3 -30 replies
23/67iotests/065: Honor $IMGOPTStests/qemu-iotests/065+8 -90 replies
24/67iotests/096: Honor $IMGOPTStests/qemu-iotests/096+3 -20 replies
25/67iotests/118: Honor $IMGOPTStests/qemu-iotests/118+13 -130 replies
26/67iotests/124: Honor $IMGOPTStests/qemu-iotests/124+13 -160 replies
27/67iotests/129: Honor $IMGOPTStests/qemu-iotests/129+9 -20 replies
28/67iotests/132: Honor $IMGOPTStests/qemu-iotests/132+3 -30 replies
29/67iotests/139: Honor $IMGOPTStests/qemu-iotests/139+7 -80 replies
30/67iotests/147: Honor $IMGOPTStests/qemu-iotests/147+6 -50 replies
31/67iotests/148: Honor $IMGOPTStests/qemu-iotests/148+3 -20 replies
32/67iotests/151: Honor $IMGOPTStests/qemu-iotests/151+5 -50 replies
33/67iotests/152: Honor $IMGOPTStests/qemu-iotests/152+3 -30 replies
34/67iotests/155: Honor $IMGOPTStests/qemu-iotests/155+13 -160 replies
35/67iotests/163: Honor $IMGOPTStests/qemu-iotests/163+11 -130 replies
36/67iotests/165: Honor $IMGOPTStests/qemu-iotests/165+3 -30 replies
37/67iotests/169: Honor $IMGOPTStests/qemu-iotests/169+5 -50 replies
38/67iotests/194: Honor $IMGOPTStests/qemu-iotests/194+5 -40 replies
39/67iotests/196: Honor $IMGOPTStests/qemu-iotests/196+3 -30 replies
40/67iotests/199: Honor $IMGOPTStests/qemu-iotests/199+5 -50 replies
41/67iotests/202: Honor $IMGOPTStests/qemu-iotests/202+5 -40 replies
42/67iotests/203: Honor $IMGOPTStests/qemu-iotests/203+5 -40 replies
43/67iotests/205: Honor $IMGOPTStests/qemu-iotests/205+4 -30 replies
44/67iotests/208: Honor $IMGOPTStests/qemu-iotests/208+3 -20 replies
45/67iotests/208: Honor $IMGOPTStests/qemu-iotests/209+5 -40 replies
46/67iotests/216: Honor $IMGOPTStests/qemu-iotests/216+5 -60 replies
47/67iotests/218: Honor $IMGOPTStests/qemu-iotests/218+3 -30 replies
48/67iotests/219: Honor $IMGOPTStests/qemu-iotests/219+3 -20 replies
49/67iotests/222: Honor $IMGOPTStests/qemu-iotests/222+5 -50 replies
50/67iotests/224: Honor $IMGOPTStests/qemu-iotests/224+9 -110 replies
51/67iotests/228: Honor $IMGOPTStests/qemu-iotests/228+10 -90 replies
52/67iotests/234: Honor $IMGOPTStests/qemu-iotests/234+5 -40 replies
53/67iotests/235: Honor $IMGOPTStests/qemu-iotests/235+3 -40 replies
54/67iotests/236: Honor $IMGOPTStests/qemu-iotests/236+3 -30 replies
55/67iotests/237: Honor $IMGOPTStests/qemu-iotests/237 tests/qemu-iotests/237.out+5 -120 replies
56/67iotests/242: Honor $IMGOPTStests/qemu-iotests/242+6 -50 replies
57/67iotests/245: Honor $IMGOPTStests/qemu-iotests/245+9 -80 replies
58/67iotests/246: Honor $IMGOPTStests/qemu-iotests/246+3 -30 replies
59/67iotests/248: Honor $IMGOPTStests/qemu-iotests/248+4 -40 replies
60/67iotests/254: Honor $IMGOPTStests/qemu-iotests/254+3 -30 replies
61/67iotests/255: Honor $IMGOPTStests/qemu-iotests/255 tests/qemu-iotests/255.out+9 -190 replies
62/67iotests/256: Honor $IMGOPTStests/qemu-iotests/256+5 -50 replies
63/67iotests/257: Honor $IMGOPTStests/qemu-iotests/257+7 -70 replies
64/67iotests/258: Honor $IMGOPTStests/qemu-iotests/258+8 -80 replies
65/67iotests/262: Honor $IMGOPTStests/qemu-iotests/262+3 -20 replies
66/67iotests.py: Forbid qemu_img*('create', ...)tests/qemu-iotests/iotests.py+28 -80 replies
67/67iotests.py: Drop qemu_img_log(), qemu_img_create()tests/qemu-iotests/iotests.py+0 -240 replies

Reviews trailers per patch

3 of 67 patches have a Reviewed-by or Acked-by.

PatchJohn SnowVladimir Sementsov-Ogievskiy
1/67R-b R-b
2/67R-b
3/67R-b
4/67
5/67
6/67
7/67
8/67
9/67
10/67
11/67
12/67
13/67
14/67
15/67
16/67
17/67
18/67
19/67
20/67
21/67
22/67
23/67
24/67
25/67
26/67
27/67
28/67
29/67
30/67
31/67
32/67
33/67
34/67
35/67
36/67
37/67
38/67
39/67
40/67
41/67
42/67
43/67
44/67
45/67
46/67
47/67
48/67
49/67
50/67
51/67
52/67
53/67
54/67
55/67
56/67
57/67
58/67
59/67
60/67
61/67
62/67
63/67
64/67
65/67
66/67
67/67

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

Read the v1 thread

Cover letter [PATCH 00/67] iotests: Honor $IMGOPTS in Python tests

First of all: Sorry.

Second:

Based-on: My block branch
(https://github.com/XanClic/qemu.git block)

Based-on: [email protected]
(“iotests: use python logging”)

Based-on: [email protected]
(“iotests: Allow ./check -o data_file”)

Based-on: [email protected]
(“iotests: Selfish patches”)

Based-on: [email protected]
(“block: Skip COR for inactive nodes”)

OK, now:

Hi,

My recent series “iotests: Allow ./check -o data_file” enabled our bash tests to interpret the data_file qcow2 option. It didn’t do anything for Python tests because those currently completely ignore all image format options.

This is where it gets hairy. To do so, we need two things: First of all, whatever way Python tests use to create images needs to interpret $IMGOPTS. Second, when deleting image files, they must not use a plain os.remove(), but a special function that will clean up data files, too.

The heap of patches in this series comes from making the Python tests use these new functions.

Most Python tests just run qemu-img through a helper function that does not care about the exact subcommand to create images. I could add $IMGOPTS support to it, but that doesn’t feel quite right to me, and it wouldn’t reduce the patch count because we still need a special removal function.

This series is structured as follows:
- Patches 1 through 7 add support to handle image files differently from other files (consider $IMGOPTS when creating them, consider data files when deleting them, separate ImagePaths from FilePaths, and so on)

- Patches 8 and 9 add two filters we’ll need in the next range:

- Patches 10 through 13 address some issues in a handful of tests that just need to be changed a little so they can overall work with some format options

- Patch 14 makes all tests pass unsupported_imgopts where there are options that they cannot support.

- Patches 15 through 65 make all Python tests use the new functions introduced in the first 7 patches so they no longer ignore $IMGOPTS.

I felt like this is much better than munching everything together into a single big commit (better to rebase, better to review), and I don’t really like ideas like “Just do five patches that each address ten iotests”.

But I’m still very much open to suggestions on how to combine these many small patches to reduce the overall patch count.

- Patch 66 ensures that Python tests always use the new function to create test images so they won’t bypass $IMGOPTS.

- Patch 67 cleans up. qemu_img_log() is only used for image creation, and I don’t see the point in that. The output is predictable and it is very unlikely to fail. We can see in the bash tests that regularly we basically just filter everything from it anyway.
(So this series replaces log(qemu_img_pipe()) instances by asserting that image creation did not fail.)
((qemu_img_create() obviously no longer has any use after this series.))

After this series, running the iotests with -o compat=0.10, -o refcount_bits=1, and -o 'data_file=$TEST_IMG.data_file' does something sensible even for the Python tests, and it passes.

Max Reitz (67):
iotests.py: Read $IMGOPTS
iotests.py: Add @skip_for_imgopts() iotests.py: Add unsupported_imgopts iotests.py: create_test_image, remove_test_image iotests.py: Add ImagePaths
iotests.py: Add image_path()
iotests.py: Filter data_file in filter_img_info iotests.py: Add filter_json_filename() iotests.py: Add @hide_fields to img_info_log iotests/169: Skip persistent cases for compat=0.10 iotests/224: Filter json:{} from commit command iotests/228: Filter json:{} filenames iotests/242: Hide refcount bit information
iotests: Use unsupported_imgopts in Python tests iotests/030: Honor $IMGOPTS
iotests/040: Honor $IMGOPTS
iotests/041: Honor $IMGOPTS
iotests/044: Honor $IMGOPTS
iotests/045: Honor $IMGOPTS
iotests/055: Honor $IMGOPTS
iotests/056: Honor $IMGOPTS
iotests/057: Honor $IMGOPTS
iotests/065: Honor $IMGOPTS
iotests/096: Honor $IMGOPTS
iotests/118: Honor $IMGOPTS
iotests/124: Honor $IMGOPTS
iotests/129: Honor $IMGOPTS
iotests/132: Honor $IMGOPTS
iotests/139: Honor $IMGOPTS
iotests/147: Honor $IMGOPTS
iotests/148: Honor $IMGOPTS
iotests/151: Honor $IMGOPTS
iotests/152: Honor $IMGOPTS
iotests/155: Honor $IMGOPTS
iotests/163: Honor $IMGOPTS
iotests/165: Honor $IMGOPTS
iotests/169: Honor $IMGOPTS
iotests/194: Honor $IMGOPTS
iotests/196: Honor $IMGOPTS
iotests/199: Honor $IMGOPTS
iotests/202: Honor $IMGOPTS
iotests/203: Honor $IMGOPTS
iotests/205: Honor $IMGOPTS
iotests/208: Honor $IMGOPTS
iotests/208: Honor $IMGOPTS
iotests/216: Honor $IMGOPTS
iotests/218: Honor $IMGOPTS
iotests/219: Honor $IMGOPTS
iotests/222: Honor $IMGOPTS
iotests/224: Honor $IMGOPTS
iotests/228: Honor $IMGOPTS
iotests/234: Honor $IMGOPTS
iotests/235: Honor $IMGOPTS
iotests/236: Honor $IMGOPTS
iotests/237: Honor $IMGOPTS
iotests/242: Honor $IMGOPTS
iotests/245: Honor $IMGOPTS
iotests/246: Honor $IMGOPTS
iotests/248: Honor $IMGOPTS
iotests/254: Honor $IMGOPTS
iotests/255: Honor $IMGOPTS
iotests/256: Honor $IMGOPTS
iotests/257: Honor $IMGOPTS
iotests/258: Honor $IMGOPTS
iotests/262: Honor $IMGOPTS
iotests.py: Forbid qemu_img*('create', ...) iotests.py: Drop qemu_img_log(), qemu_img_create()

 tests/qemu-iotests/030        |  69 ++++++------
 tests/qemu-iotests/040        |  42 ++++----
 tests/qemu-iotests/041        | 108 +++++++++----------
 tests/qemu-iotests/044        |  11 +-
 tests/qemu-iotests/045        |  26 ++---
 tests/qemu-iotests/055        |  41 +++----
 tests/qemu-iotests/056        |  30 +++---
 tests/qemu-iotests/057        |  10 +-
 tests/qemu-iotests/065        |  21 ++--
 tests/qemu-iotests/096        |   5 +-
 tests/qemu-iotests/118        |  26 ++---
 tests/qemu-iotests/124        |  29 +++--
 tests/qemu-iotests/129        |  11 +-
 tests/qemu-iotests/132        |   6 +-
 tests/qemu-iotests/139        |  15 ++-
 tests/qemu-iotests/147        |  11 +-
 tests/qemu-iotests/148        |   5 +-
 tests/qemu-iotests/151        |  10 +-
 tests/qemu-iotests/152        |   6 +-
 tests/qemu-iotests/155        |  29 +++--
 tests/qemu-iotests/163        |  29 ++---
 tests/qemu-iotests/165        |  10 +-
 tests/qemu-iotests/169        |  23 ++--
 tests/qemu-iotests/194        |   9 +-
 tests/qemu-iotests/196        |  10 +-
 tests/qemu-iotests/199        |  10 +-
 tests/qemu-iotests/202        |   9 +-
 tests/qemu-iotests/203        |   9 +-
 tests/qemu-iotests/205        |   7 +-
 tests/qemu-iotests/206        |   5 +-
 tests/qemu-iotests/208        |   5 +-
 tests/qemu-iotests/209        |   9 +-
 tests/qemu-iotests/216        |  11 +-
 tests/qemu-iotests/218        |   6 +-
 tests/qemu-iotests/219        |   5 +-
 tests/qemu-iotests/222        |  13 +--
 tests/qemu-iotests/224        |  33 +++---
 tests/qemu-iotests/224.out    |   4 +-
 tests/qemu-iotests/228        |  25 ++---
 tests/qemu-iotests/228.out    |   8 +-
 tests/qemu-iotests/234        |   9 +-
 tests/qemu-iotests/235        |   7 +-
 tests/qemu-iotests/236        |   6 +-
 tests/qemu-iotests/237        |  15 +--
 tests/qemu-iotests/237.out    |   6 --
 tests/qemu-iotests/242        |  21 ++--
 tests/qemu-iotests/242.out    |   5 -
 tests/qemu-iotests/245        |  21 ++--
 tests/qemu-iotests/246        |  11 +-
 tests/qemu-iotests/248        |  14 ++-
 tests/qemu-iotests/254        |  10 +-
 tests/qemu-iotests/255        |  20 ++--
 tests/qemu-iotests/255.out    |   8 --
 tests/qemu-iotests/256        |  10 +-
 tests/qemu-iotests/257        |  18 ++--
 tests/qemu-iotests/258        |  16 +--
 tests/qemu-iotests/262        |   5 +-
 tests/qemu-iotests/iotests.py | 197 +++++++++++++++++++++++++++-------
 58 files changed, 654 insertions(+), 496 deletions(-)
Signature · 1 line
2.21.0