@samitouri / QOSamiQemu / commits / 87c14d88ec

iotests: ensure all qcow2 I/O tests are able to be run via make

For block formats marked as 'quick', only tests in the 'auto' group are added to the meson test suite. The result of this is that qcow2 tests not in the 'auto' group cannot be run at all, even if passing SPEED=slow or SPEED=thorough. To fix this we need todo two passes over the I/O test list. First add all tests from 'auto' group into the 'block' suite, so they are run by default. Then on the second pass add any tests which were not in 'auto' into the 'block-slow' suite, so they get run when SPEED=slow or SPEED=thorough. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Daniel P. Berrangé committed Jan 12, 2026 at 13:12 UTC 87c14d88ec5e321b7f9d0ae9d11d1783e24b6b16
1 file changed +43 -5
tests/qemu-iotests/meson.build
+43 -5
@@ -30,16 +30,48 @@ endforeach
30 qemu_iotests_check_cmd = files('check')
31
32 foreach format, speed: qemu_iotests_formats
33 + # Formats tagged 'quick' get the subset of tests in the 'auto'
34 + # group, run by default with 'make check' / 'make check-block'
35 + seen = []
36 if speed == 'quick'
34 - suites = 'block'
37 + args = ['-tap', '-' + format, '-g', 'auto']
38 + suites = ['block']
39 +
40 + rc = run_command(
41 + [python, qemu_iotests_check_cmd] + args + ['-n'],
42 + check: true,
43 + )
44 +
45 + foreach item: rc.stdout().strip().split()
46 + seen += item
47 + args = [qemu_iotests_check_cmd,
48 + '-tap', '-' + format, item,
49 + '--source-dir', meson.current_source_dir(),
50 + '--build-dir', meson.current_build_dir()]
51 + # Some individual tests take as long as 45 seconds
52 + # Bump the timeout to 3 minutes for some headroom
53 + # on slow machines to minimize spurious failures
54 + test('io-' + format + '-' + item,
55 + python,
56 + args: args,
57 + depends: qemu_iotests_binaries,
58 + env: qemu_iotests_env,
59 + protocol: 'tap',
60 + timeout: 180,
61 + suite: suites)
62 + endforeach
63 + endif
64 +
65 + suites = []
66 + # Any format tagged quick or slow also gets added to slow
67 + # otherwise its tagged thorough
68 + if speed != 'thorough'
69 + suites += ['block-slow']
70 else
36 - suites = ['block-' + speed]
71 + suites += ['block-thorough']
72 endif
73
74 args = ['-tap', '-' + format]
40 - if speed == 'quick'
41 - args += ['-g', 'auto']
42 - endif
75
76 rc = run_command(
77 [python, qemu_iotests_check_cmd] + args + ['-n'],
@@ -47,6 +79,12 @@ foreach format, speed: qemu_iotests_formats
79 )
80
81 foreach item: rc.stdout().strip().split()
82 + # Skip any tests already added from the 'auto' group
83 + # as they're run in the 'quick' suite already
84 + if item in seen
85 + continue
86 + endif
87 +
88 args = [qemu_iotests_check_cmd,
89 '-tap', '-' + format, item,
90 '--source-dir', meson.current_source_dir(),