]> git.proxmox.com Git - mirror_qemu.git/blame - tests/qtest/meson.build
qtest: bump min meson timeout to 60 seconds
[mirror_qemu.git] / tests / qtest / meson.build
CommitLineData
dc1d91ac 1slow_qtests = {
dc1d91ac 2 'bios-tables-test' : 120,
dc1d91ac
PB
3 'migration-test' : 150,
4 'npcm7xx_pwm-test': 150,
dc1d91ac
PB
5 'qom-test' : 300,
6 'test-hmp' : 120,
7}
8
b911c30c 9qtests_generic = [
a2ce7dbd
PB
10 'cdrom-test',
11 'device-introspect-test',
12 'machine-none-test',
13 'qmp-test',
14 'qmp-cmd-test',
15 'qom-test',
16 'test-hmp',
17 'qos-test',
f6a5f380 18 'readconfig-test',
c95031a1 19 'netdev-socket',
a2ce7dbd 20]
6002711c 21if enable_modules
a2ce7dbd
PB
22 qtests_generic += [ 'modules-test' ]
23endif
24
25qtests_pci = \
26 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
27 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
28
33c47ab9
JC
29qtests_cxl = \
30 (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
31
973d97fe
TH
32# FIXME: Get rid of get_option('default_devices') here and check
33# for the availability of the default NICs in the tests
8bf5bb2e 34qtests_filter = \
973d97fe 35 (get_option('default_devices') and slirp.found() ? ['test-netfilter'] : []) + \
d0cda6f4
PB
36 (get_option('default_devices') and host_os != 'windows' ? ['test-filter-mirror'] : []) + \
37 (get_option('default_devices') and host_os != 'windows' ? ['test-filter-redirector'] : [])
8bf5bb2e 38
a2ce7dbd 39qtests_i386 = \
8bf5bb2e
BM
40 (slirp.found() ? ['pxe-test'] : []) + \
41 qtests_filter + \
a2ce7dbd
PB
42 (have_tools ? ['ahci-test'] : []) + \
43 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
44 (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
a2ce7dbd 45 (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
d0cda6f4 46 (host_os == 'linux' and \
faae3437
TH
47 config_all_devices.has_key('CONFIG_ISA_IPMI_BT') and
48 config_all_devices.has_key('CONFIG_IPMI_EXTERN') ? ['ipmi-bt-test'] : []) + \
a2ce7dbd 49 (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
677726ef 50 (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
c0f82826 51 (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
a2ce7dbd
PB
52 (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
53 (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
54 (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
af05ffff 55 (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : []) + \
a2ce7dbd
PB
56 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
57 (config_all_devices.has_key('CONFIG_USB_UHCI') and \
58 config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
59 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
60 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
61 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
62 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
63 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
64 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
7d6a4f12 65 (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \
b911c30c
TH
66 (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
67 (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
68 (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
69 (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
70 (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
ce94fa7a 71 (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
d0cda6f4 72 (host_os != 'windows' and \
84efa8aa 73 config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
56f7c6b1
FR
74 (config_all_devices.has_key('CONFIG_PCIE_PORT') and \
75 config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
e32b96b5
LV
76 config_all_devices.has_key('CONFIG_Q35') and \
77 config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
78 slirp.found() ? ['virtio-net-failover'] : []) + \
2e0def6d
FR
79 (unpack_edk2_blobs and \
80 config_all_devices.has_key('CONFIG_HPET') and \
81 config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \
a2ce7dbd 82 qtests_pci + \
33c47ab9 83 qtests_cxl + \
a2ce7dbd
PB
84 ['fdc-test',
85 'ide-test',
a2ce7dbd
PB
86 'hd-geo-test',
87 'boot-order-test',
a2ce7dbd
PB
88 'rtc-test',
89 'i440fx-test',
90 'fw_cfg-test',
91 'device-plug-test',
92 'drive_del-test',
93 'tco-test',
94 'cpu-plug-test',
95 'q35-test',
96 'vmgenid-test',
97 'migration-test',
98 'test-x86-cpuid-compat',
8bf5bb2e 99 'numa-test'
31fb263c 100 ]
a2ce7dbd 101
306d7581 102if dbus_display
b4dd5b6a
MAL
103 qtests_i386 += ['dbus-display-test']
104endif
105
a2ce7dbd 106dbus_daemon = find_program('dbus-daemon', required: false)
7544060e 107if dbus_daemon.found() and gdbus_codegen.found()
a2ce7dbd
PB
108 # Temporarily disabled due to Patchew failures:
109 #qtests_i386 += ['dbus-vmstate-test']
110 dbus_vmstate1 = custom_target('dbus-vmstate description',
111 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
861aa79a 112 input: meson.project_source_root() / 'backends/dbus-vmstate1.xml',
7544060e 113 command: [gdbus_codegen, '@INPUT@',
a2ce7dbd
PB
114 '--interface-prefix', 'org.qemu',
115 '--generate-c-code', '@BASENAME@']).to_list()
116else
117 dbus_vmstate1 = []
118endif
119
120qtests_x86_64 = qtests_i386
121
31fb263c 122qtests_alpha = ['boot-serial-test'] + \
8bf5bb2e 123 qtests_filter + \
a2ce7dbd
PB
124 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
125
126qtests_avr = [ 'boot-serial-test' ]
127
31fb263c 128qtests_hppa = ['boot-serial-test'] + \
8bf5bb2e 129 qtests_filter + \
a2ce7dbd
PB
130 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
131
31fb263c 132qtests_m68k = ['boot-serial-test'] + \
8bf5bb2e 133 qtests_filter
31fb263c
TH
134
135qtests_microblaze = ['boot-serial-test'] + \
8bf5bb2e 136 qtests_filter
31fb263c 137
a2ce7dbd
PB
138qtests_microblazeel = qtests_microblaze
139
140qtests_mips = \
8bf5bb2e 141 qtests_filter + \
a2ce7dbd
PB
142 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
143 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
144
20516580
TH
145qtests_mipsel = qtests_mips
146qtests_mips64 = qtests_mips
147qtests_mips64el = qtests_mips
a2ce7dbd 148
a2ce7dbd 149qtests_ppc = \
8bf5bb2e 150 qtests_filter + \
a2ce7dbd
PB
151 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
152 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
cfc1a889
PB
153 (config_all_accel.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) + \
154 (config_all_accel.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) + \
74884cb1 155 ['boot-order-test']
a2ce7dbd
PB
156
157qtests_ppc64 = \
a9697d09 158 qtests_ppc + \
a2ce7dbd
PB
159 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
160 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
161 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
31fb263c 162 (slirp.found() ? ['pxe-test'] : []) + \
a2ce7dbd
PB
163 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
164 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
d8a18da5 165 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
a2ce7dbd
PB
166
167qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
168qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
169
31fb263c 170qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
8bf5bb2e 171 qtests_filter
a2ce7dbd
PB
172
173qtests_sparc64 = \
174 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
8bf5bb2e 175 qtests_filter + \
a2ce7dbd
PB
176 ['prom-env-test', 'boot-serial-test']
177
326ccfe2 178qtests_npcm7xx = \
77c05b0b
HW
179 ['npcm7xx_adc-test',
180 'npcm7xx_gpio-test',
73314f13 181 'npcm7xx_pwm-test',
526dbbe0 182 'npcm7xx_rng-test',
4c579e15 183 'npcm7xx_sdhci-test',
d986bf72 184 'npcm7xx_smbus-test',
326ccfe2 185 'npcm7xx_timer-test',
e6646167
DE
186 'npcm7xx_watchdog_timer-test'] + \
187 (slirp.found() ? ['npcm7xx_emc-test'] : [])
66609952 188qtests_aspeed = \
5fde7f10 189 ['aspeed_hace-test',
2ec06378
PD
190 'aspeed_smc-test',
191 'aspeed_gpio-test']
a2ce7dbd 192qtests_arm = \
1eca58aa 193 (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \
9bc064b5 194 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
30858daf 195 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
9cf5eb29 196 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
e19d24e6
TH
197 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') and
198 config_all_devices.has_key('CONFIG_MUSICPAL') ? ['pflash-cfi02-test'] : []) + \
66609952 199 (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
288c31e3 200 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
628f9008 201 (config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'] : []) + \
bcbbd95d 202 (config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \
e19d24e6
TH
203 (config_all_devices.has_key('CONFIG_VEXPRESS') ? ['test-arm-mptimer'] : []) + \
204 (config_all_devices.has_key('CONFIG_MICROBIT') ? ['microbit-test'] : []) + \
a2ce7dbd 205 ['arm-cpu-features',
628f9008 206 'boot-serial-test']
a2ce7dbd
PB
207
208# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
209qtests_aarch64 = \
809954ef 210 (cpu != 'arm' and unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
cfc1a889 211 (config_all_accel.has_key('CONFIG_TCG') and config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? \
caf01d6a 212 ['tpm-tis-device-test', 'tpm-tis-device-swtpm-test'] : []) + \
bf22f151 213 (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test', 'fuzz-xlnx-dp-test'] : []) + \
1c98a821 214 (config_all_devices.has_key('CONFIG_XLNX_VERSAL') ? ['xlnx-canfd-test', 'xlnx-versal-trng-test'] : []) + \
db2237c4 215 (config_all_devices.has_key('CONFIG_RASPI') ? ['bcm2835-dma-test'] : []) + \
cfc1a889 216 (config_all_accel.has_key('CONFIG_TCG') and \
b08dc0f1 217 config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \
05889d15
AJ
218 ['arm-cpu-features',
219 'numa-test',
a2ce7dbd 220 'boot-serial-test',
db2237c4 221 'migration-test']
a2ce7dbd
PB
222
223qtests_s390x = \
973d97fe 224 qtests_filter + \
a2ce7dbd
PB
225 ['boot-serial-test',
226 'drive_del-test',
227 'device-plug-test',
228 'virtio-ccw-test',
229 'cpu-plug-test',
230 'migration-test']
231
2f849e9d
TW
232qtests_riscv32 = \
233 (config_all_devices.has_key('CONFIG_SIFIVE_E_AON') ? ['sifive-e-aon-watchdog-test'] : [])
234
a2ce7dbd
PB
235qos_test_ss = ss.source_set()
236qos_test_ss.add(
237 'ac97-test.c',
c0167539 238 'adm1272-test.c',
5861f5ab 239 'adm1266-test.c',
a2ce7dbd
PB
240 'ds1338-test.c',
241 'e1000-test.c',
a2ce7dbd
PB
242 'eepro100-test.c',
243 'es1370-test.c',
244 'ipoctal232-test.c',
4fd1ebb1 245 'lsm303dlhc-mag-test.c',
ffcdae67 246 'isl_pmbus_vr-test.c',
7649086f 247 'max34451-test.c',
a2ce7dbd
PB
248 'megasas-test.c',
249 'ne2000-test.c',
250 'tulip-test.c',
251 'nvme-test.c',
252 'pca9552-test.c',
253 'pci-test.c',
254 'pcnet-test.c',
255 'sdhci-test.c',
256 'spapr-phb-test.c',
257 'tmp105-test.c',
5e623f2b 258 'emc141x-test.c',
a2ce7dbd
PB
259 'usb-hcd-ohci-test.c',
260 'virtio-test.c',
261 'virtio-blk-test.c',
262 'virtio-net-test.c',
263 'virtio-rng-test.c',
264 'virtio-scsi-test.c',
becf8873 265 'virtio-iommu-test.c',
a2ce7dbd 266 'vmxnet3-test.c',
45cb69bb 267 'igb-test.c',
631c8726 268 'ufs-test.c',
a2ce7dbd 269)
b8a310a2
FR
270
271if config_all_devices.has_key('CONFIG_VIRTIO_SERIAL')
272 qos_test_ss.add(files('virtio-serial-test.c'))
273endif
274
d0cda6f4 275if host_os != 'windows'
bc67e31c
BM
276 qos_test_ss.add(files('e1000e-test.c'))
277endif
2c9dce01
PB
278if have_virtfs
279 qos_test_ss.add(files('virtio-9p-test.c'))
280endif
43b6d7ee
PB
281if have_vhost_user
282 qos_test_ss.add(files('vhost-user-test.c'))
283endif
80695202
CX
284if have_tools and have_vhost_user_blk_server
285 qos_test_ss.add(files('vhost-user-blk-test.c'))
286endif
a2ce7dbd 287
da00d067
PB
288tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
289
58d25e97
DB
290migration_files = [files('migration-helpers.c')]
291if gnutls.found()
292 migration_files += [files('../unit/crypto-tls-psk-helpers.c'), gnutls]
d47b83b1
DB
293
294 if tasn1.found()
295 migration_files += [files('../unit/crypto-tls-x509-helpers.c',
296 '../unit/pkix_asn1_tab.c'), tasn1]
297 endif
58d25e97
DB
298endif
299
da00d067
PB
300qtests = {
301 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
a2ce7dbd 302 'cdrom-test': files('boot-sector.c'),
a2ce7dbd 303 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
bd24550e 304 'erst-test': files('erst-test.c'),
da00d067 305 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
58d25e97 306 'migration-test': migration_files,
da00d067 307 'pxe-test': files('boot-sector.c'),
1220f581 308 'qos-test': [chardev, io, qos_test_ss.apply({}).sources()],
da00d067
PB
309 'tpm-crb-swtpm-test': [io, tpmemu_files],
310 'tpm-crb-test': [io, tpmemu_files],
311 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
312 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
bcbbd95d 313 'tpm-tis-i2c-test': [io, tpmemu_files, 'qtest_aspeed.c'],
da00d067
PB
314 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
315 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
6830e53b 316 'virtio-net-failover': files('migration-helpers.c'),
a2ce7dbd 317 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
c95031a1 318 'netdev-socket': files('netdev-socket.c', '../unit/socket-helpers.c'),
a2ce7dbd
PB
319}
320
4d1bc58d 321if vnc.found()
2564dcbf 322 gvnc = dependency('gvnc-1.0', method: 'pkg-config', required: false)
4d1bc58d
JQ
323 if gvnc.found()
324 qtests += {'vnc-display-test': [gvnc]}
325 qtests_generic += [ 'vnc-display-test' ]
326 endif
f5755989
MAL
327endif
328
b4dd5b6a 329if dbus_display
f5755989 330 qtests += {'dbus-display-test': [dbus_display1, gio]}
b4dd5b6a
MAL
331endif
332
a2ce7dbd
PB
333qtest_executables = {}
334foreach dir : target_dirs
335 if not dir.endswith('-softmmu')
336 continue
337 endif
338
339 target_base = dir.split('-')[0]
fd5eef85 340 qtest_emulator = emulators['qemu-system-' + target_base]
da00d067 341 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
a2ce7dbd 342
809954ef 343 test_deps = roms
a2ce7dbd 344 qtest_env = environment()
fd5eef85
PB
345 if have_tools
346 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
347 test_deps += [qemu_img]
348 endif
654d6b04 349 qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh')
64ed6f92 350 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
cc1838c2
TH
351 if have_tools and have_vhost_user_blk_server
352 qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
353 test_deps += [qsd]
354 endif
355
d864756e
FR
356 qtest_env.set('PYTHON', python.full_path())
357
da00d067 358 foreach test : target_qtests
a2ce7dbd
PB
359 # Executables are shared across targets, declare them only the first time we
360 # encounter them
361 if not qtest_executables.has_key(test)
da00d067
PB
362 src = [test + '.c']
363 deps = [qemuutil, qos]
364 if test in qtests
365 # use a sourceset to quickly separate sources and deps
366 test_ss = ss.source_set()
367 test_ss.add(qtests[test])
368 src += test_ss.all_sources()
369 deps += test_ss.all_dependencies()
370 endif
a2ce7dbd 371 qtest_executables += {
da00d067 372 test: executable(test, src, dependencies: deps)
a2ce7dbd
PB
373 }
374 endif
34f02e9f 375 test('qtest-@0@/@1@'.format(target_base, test),
a2ce7dbd 376 qtest_executables[test],
fb72176b 377 depends: [test_deps, qtest_emulator, emulator_modules],
a2ce7dbd
PB
378 env: qtest_env,
379 args: ['--tap', '-k'],
380 protocol: 'tap',
9eb95e5c
DB
381 timeout: slow_qtests.get(test, 60),
382 priority: slow_qtests.get(test, 60),
a2ce7dbd
PB
383 suite: ['qtest', 'qtest-' + target_base])
384 endforeach
385endforeach