1 # All QTests for now are POSIX-only, but the dependencies are
2 # really in libqtest, not in the testcases themselves.
3 if not config_host.has_key('CONFIG_POSIX')
9 'bios-tables-test' : 120,
10 'boot-serial-test' : 60,
11 'migration-test' : 150,
12 'npcm7xx_pwm-test': 150,
22 'device-introspect-test',
30 if config_host.has_key('CONFIG_MODULES')
31 qtests_generic += [ 'modules-test' ]
35 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
36 (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
39 (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
42 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
43 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
44 (have_tools ? ['ahci-test'] : []) + \
45 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
46 (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
47 (config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
48 (config_host.has_key('CONFIG_LINUX') and \
49 config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \
50 (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
51 (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
52 (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
53 (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
54 (config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
55 (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
56 (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : []) + \
57 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
58 (config_all_devices.has_key('CONFIG_USB_UHCI') and \
59 config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
60 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
61 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
62 (config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
63 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
64 (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
65 (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
66 (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \
67 (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
68 (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
69 (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
70 (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
71 (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
72 (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
73 (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
74 (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
75 config_all_devices.has_key('CONFIG_Q35') and \
76 config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
77 slirp.found() ? ['virtio-net-failover'] : []) + \
78 (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
95 'test-x86-cpuid-compat',
97 'test-filter-redirector'
101 qtests_i386 += ['dbus-display-test']
104 dbus_daemon = find_program('dbus-daemon', required: false)
105 if dbus_daemon.found() and gdbus_codegen.found()
106 # Temporarily disabled due to Patchew failures:
107 #qtests_i386 += ['dbus-vmstate-test']
108 dbus_vmstate1 = custom_target('dbus-vmstate description',
109 output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
110 input: meson.project_source_root() / 'backends/dbus-vmstate1.xml',
111 command: [gdbus_codegen, '@INPUT@',
112 '--interface-prefix', 'org.qemu',
113 '--generate-c-code', '@BASENAME@']).to_list()
118 qtests_x86_64 = qtests_i386
120 qtests_alpha = ['boot-serial-test'] + \
121 ['test-filter-mirror', 'test-filter-redirector'] + \
122 (slirp.found() ? ['test-netfilter'] : []) + \
123 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
125 qtests_avr = [ 'boot-serial-test' ]
127 qtests_hppa = ['boot-serial-test'] + \
128 ['test-filter-mirror', 'test-filter-redirector'] + \
129 (slirp.found() ? ['test-netfilter'] : []) + \
130 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
132 qtests_m68k = ['boot-serial-test'] + \
133 ['test-filter-mirror', 'test-filter-redirector'] + \
134 (slirp.found() ? ['test-netfilter'] : [])
136 qtests_microblaze = ['boot-serial-test'] + \
137 ['test-filter-mirror', 'test-filter-redirector'] + \
138 (slirp.found() ? ['test-netfilter'] : [])
140 qtests_microblazeel = qtests_microblaze
143 ['test-filter-mirror', 'test-filter-redirector'] + \
144 (slirp.found() ? ['test-netfilter'] : []) + \
145 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
146 (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
148 qtests_mipsel = qtests_mips
149 qtests_mips64 = qtests_mips
150 qtests_mips64el = qtests_mips
153 ['test-filter-mirror', 'test-filter-redirector'] + \
154 (slirp.found() ? ['test-netfilter'] : []) + \
155 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
156 (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
157 (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) + \
158 (config_all_devices.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) + \
163 (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
164 (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
165 (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
166 (slirp.found() ? ['pxe-test'] : []) + \
167 (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
168 (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
169 qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
171 qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
172 qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
174 qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \
175 ['test-filter-mirror', 'test-filter-redirector'] + \
176 (slirp.found() ? ['test-netfilter'] : [])
179 (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
180 (slirp.found() ? ['test-netfilter'] : []) + \
181 ['test-filter-mirror', 'test-filter-redirector'] + \
182 ['prom-env-test', 'boot-serial-test']
189 'npcm7xx_sdhci-test',
190 'npcm7xx_smbus-test',
191 'npcm7xx_timer-test',
192 'npcm7xx_watchdog_timer-test'] + \
193 (slirp.found() ? ['npcm7xx_emc-test'] : [])
199 (config_all_devices.has_key('CONFIG_MPS2') ? ['sse-timer-test'] : []) + \
200 (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
201 (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
202 (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
203 (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
204 (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
205 (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
212 # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
214 (cpu != 'arm' and unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
215 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
216 (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
217 (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test', 'fuzz-xlnx-dp-test'] : []) + \
224 (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
225 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
226 (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
234 qos_test_ss = ss.source_set()
244 'lsm303dlhc-mag-test.c',
245 'isl_pmbus_vr-test.c',
258 'usb-hcd-ohci-test.c',
263 'virtio-scsi-test.c',
264 'virtio-serial-test.c',
265 'virtio-iommu-test.c',
269 qos_test_ss.add(files('virtio-9p-test.c'))
272 qos_test_ss.add(files('vhost-user-test.c'))
274 if have_tools and have_vhost_user_blk_server
275 qos_test_ss.add(files('vhost-user-blk-test.c'))
278 tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
280 migration_files = [files('migration-helpers.c')]
282 migration_files += [files('../unit/crypto-tls-psk-helpers.c'), gnutls]
285 migration_files += [files('../unit/crypto-tls-x509-helpers.c',
286 '../unit/pkix_asn1_tab.c'), tasn1]
291 'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
292 'cdrom-test': files('boot-sector.c'),
293 'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
294 'erst-test': files('erst-test.c'),
295 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
296 'migration-test': migration_files,
297 'pxe-test': files('boot-sector.c'),
298 'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
299 'tpm-crb-swtpm-test': [io, tpmemu_files],
300 'tpm-crb-test': [io, tpmemu_files],
301 'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
302 'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
303 'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
304 'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
305 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
309 qtests += {'dbus-display-test': [dbus_display1, gio]}
312 qtest_executables = {}
313 foreach dir : target_dirs
314 if not dir.endswith('-softmmu')
318 target_base = dir.split('-')[0]
319 qtest_emulator = emulators['qemu-system-' + target_base]
320 target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
323 qtest_env = environment()
325 qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
326 test_deps += [qemu_img]
328 qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh')
329 qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
330 if have_tools and have_vhost_user_blk_server
331 qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
335 foreach test : target_qtests
336 # Executables are shared across targets, declare them only the first time we
338 if not qtest_executables.has_key(test)
340 deps = [qemuutil, qos]
342 # use a sourceset to quickly separate sources and deps
343 test_ss = ss.source_set()
344 test_ss.add(qtests[test])
345 src += test_ss.all_sources()
346 deps += test_ss.all_dependencies()
348 qtest_executables += {
349 test: executable(test, src, dependencies: deps)
352 test('qtest-@0@/@1@'.format(target_base, test),
353 qtest_executables[test],
354 depends: [test_deps, qtest_emulator, emulator_modules],
356 args: ['--tap', '-k'],
358 timeout: slow_qtests.get(test, 30),
359 priority: slow_qtests.get(test, 30),
360 suite: ['qtest', 'qtest-' + target_base])