]>
Commit | Line | Data |
---|---|---|
a0bc5997 | 1 | if not have_tools or targetos == 'windows' |
f1f8af23 | 2 | subdir_done() |
98487b90 | 3 | endif |
f1f8af23 | 4 | |
34f983d8 | 5 | foreach cflag: qemu_ldflags |
2cf6a4e3 TH |
6 | if cflag.startswith('-fsanitize') and \ |
7 | not cflag.contains('safe-stack') and not cflag.contains('cfi-icall') | |
8 | message('Sanitizers are enabled ==> Disabled the qemu-iotests.') | |
9 | subdir_done() | |
10 | endif | |
11 | endforeach | |
12 | ||
13 | bash = find_program('bash', required: false, version: '>= 4.0') | |
14 | if not bash.found() | |
15 | message('bash >= v4.0 not available ==> Disabled the qemu-iotests.') | |
16 | subdir_done() | |
17 | endif | |
18 | ||
f1f8af23 TH |
19 | qemu_iotests_binaries = [qemu_img, qemu_io, qemu_nbd, qsd] |
20 | qemu_iotests_env = {'PYTHON': python.full_path()} | |
21 | qemu_iotests_formats = { | |
22 | 'qcow2': 'quick', | |
23 | 'raw': 'slow', | |
24 | 'qed': 'thorough', | |
25 | 'vmdk': 'thorough', | |
26 | 'vpc': 'thorough' | |
27 | } | |
28 | ||
29 | foreach k, v : emulators | |
30 | if k.startswith('qemu-system-') | |
31 | qemu_iotests_binaries += v | |
32 | endif | |
33 | endforeach | |
34 | ||
51ab5f8b DB |
35 | qemu_iotests_check_cmd = files('check') |
36 | ||
f1f8af23 TH |
37 | foreach format, speed: qemu_iotests_formats |
38 | if speed == 'quick' | |
39 | suites = 'block' | |
40 | else | |
41 | suites = ['block-' + speed, speed] | |
42 | endif | |
51ab5f8b DB |
43 | |
44 | args = ['-tap', '-' + format] | |
45 | if speed == 'quick' | |
46 | args += ['-g', 'auto'] | |
47 | endif | |
48 | ||
49 | rc = run_command( | |
90834f5d | 50 | [python, qemu_iotests_check_cmd] + args + ['-n'], |
51ab5f8b DB |
51 | check: true, |
52 | ) | |
53 | ||
54 | foreach item: rc.stdout().strip().split() | |
90834f5d DB |
55 | args = [qemu_iotests_check_cmd, |
56 | '-tap', '-' + format, item, | |
51ab5f8b DB |
57 | '--source-dir', meson.current_source_dir(), |
58 | '--build-dir', meson.current_build_dir()] | |
59 | # Some individual tests take as long as 45 seconds | |
60 | # Bump the timeout to 3 minutes for some headroom | |
61 | # on slow machines to minimize spurious failures | |
62 | test('io-' + format + '-' + item, | |
90834f5d | 63 | python, |
51ab5f8b DB |
64 | args: args, |
65 | depends: qemu_iotests_binaries, | |
66 | env: qemu_iotests_env, | |
67 | protocol: 'tap', | |
68 | timeout: 180, | |
69 | suite: suites) | |
70 | endforeach | |
f1f8af23 | 71 | endforeach |