2020-08-04 20:00:40 +02:00
|
|
|
# All QTests for now are POSIX-only, but the dependencies are
|
|
|
|
# really in libqtest, not in the testcases themselves.
|
|
|
|
if not config_host.has_key('CONFIG_POSIX')
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
|
|
|
qtests_generic = [
|
|
|
|
'cdrom-test',
|
|
|
|
'device-introspect-test',
|
|
|
|
'machine-none-test',
|
|
|
|
'qmp-test',
|
|
|
|
'qmp-cmd-test',
|
|
|
|
'qom-test',
|
|
|
|
'test-hmp',
|
|
|
|
'qos-test',
|
|
|
|
]
|
|
|
|
if config_host.has_key('CONFIG_MODULES')
|
|
|
|
qtests_generic += [ 'modules-test' ]
|
|
|
|
endif
|
|
|
|
|
|
|
|
qtests_pci = \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
|
|
|
|
|
|
|
|
qtests_i386 = \
|
2020-10-05 11:31:15 +02:00
|
|
|
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
|
|
|
|
(have_tools ? ['ahci-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['test-filter-redirector'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
|
|
|
|
(config_host.has_key('CONFIG_LINUX') and \
|
|
|
|
config_all_devices.has_key('CONFIG_ISA_IPMI_BT') ? ['ipmi-bt-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
|
2021-01-27 15:59:27 +01:00
|
|
|
(config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
|
2021-01-27 15:59:30 +01:00
|
|
|
(config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
(config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_USB_UHCI') and \
|
|
|
|
config_all_devices.has_key('CONFIG_USB_EHCI') ? ['usb-hcd-ehci-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_CRB') ? ['tpm-crb-swtpm-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
|
|
|
|
qtests_pci + \
|
|
|
|
['fdc-test',
|
|
|
|
'ide-test',
|
|
|
|
'hd-geo-test',
|
|
|
|
'boot-order-test',
|
|
|
|
'bios-tables-test',
|
|
|
|
'rtc-test',
|
|
|
|
'i440fx-test',
|
2020-09-21 18:06:05 +02:00
|
|
|
'fuzz-test',
|
2020-08-04 20:00:40 +02:00
|
|
|
'fw_cfg-test',
|
|
|
|
'device-plug-test',
|
|
|
|
'drive_del-test',
|
|
|
|
'tco-test',
|
|
|
|
'cpu-plug-test',
|
|
|
|
'q35-test',
|
|
|
|
'vmgenid-test',
|
|
|
|
'migration-test',
|
|
|
|
'test-x86-cpuid-compat',
|
|
|
|
'numa-test']
|
|
|
|
|
|
|
|
dbus_daemon = find_program('dbus-daemon', required: false)
|
|
|
|
if dbus_daemon.found() and config_host.has_key('GDBUS_CODEGEN')
|
|
|
|
# Temporarily disabled due to Patchew failures:
|
|
|
|
#qtests_i386 += ['dbus-vmstate-test']
|
|
|
|
dbus_vmstate1 = custom_target('dbus-vmstate description',
|
|
|
|
output: ['dbus-vmstate1.h', 'dbus-vmstate1.c'],
|
|
|
|
input: files('dbus-vmstate1.xml'),
|
|
|
|
command: [config_host['GDBUS_CODEGEN'],
|
|
|
|
'@INPUT@',
|
|
|
|
'--interface-prefix', 'org.qemu',
|
|
|
|
'--generate-c-code', '@BASENAME@']).to_list()
|
|
|
|
else
|
|
|
|
dbus_vmstate1 = []
|
|
|
|
endif
|
|
|
|
|
|
|
|
qtests_x86_64 = qtests_i386
|
|
|
|
|
|
|
|
qtests_alpha = [ 'boot-serial-test' ] + \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
|
|
|
|
|
|
|
|
qtests_avr = [ 'boot-serial-test' ]
|
|
|
|
|
|
|
|
qtests_hppa = [ 'boot-serial-test' ] + \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
|
|
|
|
|
|
|
|
qtests_m68k = [ 'boot-serial-test' ]
|
|
|
|
qtests_microblaze = [ 'boot-serial-test' ]
|
|
|
|
qtests_microblazeel = qtests_microblaze
|
|
|
|
|
|
|
|
qtests_mips = \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
|
|
|
|
|
|
|
|
qtests_mips64 = \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
|
|
|
|
|
|
|
|
qtests_mips64el = \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
|
|
|
|
|
|
|
|
qtests_moxie = [ 'boot-serial-test' ]
|
|
|
|
|
|
|
|
qtests_ppc = \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \
|
2020-10-07 12:43:03 +02:00
|
|
|
['boot-order-test', 'prom-env-test', 'boot-serial-test'] \
|
2020-08-04 20:00:40 +02:00
|
|
|
|
|
|
|
qtests_ppc64 = \
|
|
|
|
(config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \
|
2020-10-05 11:31:15 +02:00
|
|
|
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
(config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \
|
|
|
|
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
|
2020-10-07 12:43:03 +02:00
|
|
|
qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test']
|
2020-08-04 20:00:40 +02:00
|
|
|
|
|
|
|
qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
|
|
|
|
qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
|
|
|
|
|
|
|
|
qtests_sparc = ['prom-env-test', 'm48t59-test', 'boot-serial-test']
|
|
|
|
|
|
|
|
qtests_sparc64 = \
|
|
|
|
(config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \
|
|
|
|
['prom-env-test', 'boot-serial-test']
|
|
|
|
|
2020-10-23 23:06:35 +02:00
|
|
|
qtests_npcm7xx = \
|
2021-01-08 20:09:42 +01:00
|
|
|
['npcm7xx_adc-test',
|
|
|
|
'npcm7xx_gpio-test',
|
2021-01-08 20:09:44 +01:00
|
|
|
'npcm7xx_pwm-test',
|
2020-10-23 23:06:37 +02:00
|
|
|
'npcm7xx_rng-test',
|
2020-10-23 23:06:35 +02:00
|
|
|
'npcm7xx_timer-test',
|
|
|
|
'npcm7xx_watchdog_timer-test']
|
2020-08-04 20:00:40 +02:00
|
|
|
qtests_arm = \
|
2021-01-28 12:41:25 +01:00
|
|
|
(config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \
|
2021-01-28 12:41:23 +01:00
|
|
|
(config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \
|
2021-01-28 12:41:24 +01:00
|
|
|
(config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
(config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
|
2020-10-23 23:06:32 +02:00
|
|
|
(config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
['arm-cpu-features',
|
|
|
|
'microbit-test',
|
|
|
|
'm25p80-test',
|
|
|
|
'test-arm-mptimer',
|
|
|
|
'boot-serial-test',
|
|
|
|
'hexloader-test']
|
|
|
|
|
|
|
|
# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
|
|
|
|
qtests_aarch64 = \
|
|
|
|
(cpu != 'arm' ? ['bios-tables-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
|
|
|
|
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
|
2020-10-01 08:17:17 +02:00
|
|
|
['arm-cpu-features',
|
|
|
|
'numa-test',
|
2020-08-04 20:00:40 +02:00
|
|
|
'boot-serial-test',
|
2020-11-18 20:48:45 +01:00
|
|
|
'xlnx-can-test',
|
2020-08-04 20:00:40 +02:00
|
|
|
'migration-test']
|
|
|
|
|
|
|
|
qtests_s390x = \
|
2020-10-05 11:31:15 +02:00
|
|
|
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
|
2020-08-04 20:00:40 +02:00
|
|
|
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
|
|
|
|
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \
|
|
|
|
['boot-serial-test',
|
|
|
|
'drive_del-test',
|
|
|
|
'device-plug-test',
|
|
|
|
'virtio-ccw-test',
|
|
|
|
'cpu-plug-test',
|
|
|
|
'migration-test']
|
|
|
|
|
|
|
|
qos_test_ss = ss.source_set()
|
|
|
|
qos_test_ss.add(
|
|
|
|
'ac97-test.c',
|
|
|
|
'ds1338-test.c',
|
|
|
|
'e1000-test.c',
|
|
|
|
'e1000e-test.c',
|
|
|
|
'eepro100-test.c',
|
|
|
|
'es1370-test.c',
|
|
|
|
'ipoctal232-test.c',
|
|
|
|
'megasas-test.c',
|
|
|
|
'ne2000-test.c',
|
|
|
|
'tulip-test.c',
|
|
|
|
'nvme-test.c',
|
|
|
|
'pca9552-test.c',
|
|
|
|
'pci-test.c',
|
|
|
|
'pcnet-test.c',
|
|
|
|
'sdhci-test.c',
|
|
|
|
'spapr-phb-test.c',
|
|
|
|
'tmp105-test.c',
|
2020-12-10 12:11:03 +01:00
|
|
|
'emc141x-test.c',
|
2020-08-04 20:00:40 +02:00
|
|
|
'usb-hcd-ohci-test.c',
|
|
|
|
'virtio-test.c',
|
|
|
|
'virtio-blk-test.c',
|
|
|
|
'virtio-net-test.c',
|
|
|
|
'virtio-rng-test.c',
|
|
|
|
'virtio-scsi-test.c',
|
|
|
|
'virtio-serial-test.c',
|
|
|
|
'vmxnet3-test.c',
|
|
|
|
)
|
2021-01-07 15:57:18 +01:00
|
|
|
if have_virtfs
|
|
|
|
qos_test_ss.add(files('virtio-9p-test.c'))
|
|
|
|
endif
|
2020-08-04 20:00:40 +02:00
|
|
|
qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user-test.c'))
|
|
|
|
|
2020-10-06 14:44:00 +02:00
|
|
|
tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
|
|
|
|
|
|
|
|
qtests = {
|
|
|
|
'bios-tables-test': [io, 'boot-sector.c', 'acpi-utils.c', 'tpm-emu.c'],
|
2020-08-04 20:00:40 +02:00
|
|
|
'cdrom-test': files('boot-sector.c'),
|
|
|
|
'dbus-vmstate-test': files('migration-helpers.c') + dbus_vmstate1,
|
2020-10-06 14:44:00 +02:00
|
|
|
'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'],
|
|
|
|
'migration-test': files('migration-helpers.c'),
|
|
|
|
'pxe-test': files('boot-sector.c'),
|
|
|
|
'qos-test': [chardev, io, qos_test_ss.apply(config_host, strict: false).sources()],
|
|
|
|
'tpm-crb-swtpm-test': [io, tpmemu_files],
|
|
|
|
'tpm-crb-test': [io, tpmemu_files],
|
|
|
|
'tpm-tis-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
|
|
|
|
'tpm-tis-test': [io, tpmemu_files, 'tpm-tis-util.c'],
|
|
|
|
'tpm-tis-device-swtpm-test': [io, tpmemu_files, 'tpm-tis-util.c'],
|
|
|
|
'tpm-tis-device-test': [io, tpmemu_files, 'tpm-tis-util.c'],
|
2020-08-04 20:00:40 +02:00
|
|
|
'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'),
|
|
|
|
}
|
|
|
|
|
|
|
|
qtest_executables = {}
|
|
|
|
foreach dir : target_dirs
|
|
|
|
if not dir.endswith('-softmmu')
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
|
|
|
|
target_base = dir.split('-')[0]
|
2020-09-16 11:00:53 +02:00
|
|
|
qtest_emulator = emulators['qemu-system-' + target_base]
|
2020-10-06 14:44:00 +02:00
|
|
|
target_qtests = get_variable('qtests_' + target_base, []) + qtests_generic
|
2020-08-04 20:00:40 +02:00
|
|
|
|
2020-09-16 11:00:53 +02:00
|
|
|
test_deps = []
|
2020-08-04 20:00:40 +02:00
|
|
|
qtest_env = environment()
|
2020-09-16 11:00:53 +02:00
|
|
|
if have_tools
|
|
|
|
qtest_env.set('QTEST_QEMU_IMG', './qemu-img')
|
|
|
|
test_deps += [qemu_img]
|
|
|
|
endif
|
2020-08-04 20:00:40 +02:00
|
|
|
qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh')
|
2020-08-03 17:04:25 +02:00
|
|
|
qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base)
|
2020-08-04 20:00:40 +02:00
|
|
|
|
2020-10-06 14:44:00 +02:00
|
|
|
foreach test : target_qtests
|
2020-08-04 20:00:40 +02:00
|
|
|
# Executables are shared across targets, declare them only the first time we
|
|
|
|
# encounter them
|
|
|
|
if not qtest_executables.has_key(test)
|
2020-10-06 14:44:00 +02:00
|
|
|
src = [test + '.c']
|
|
|
|
deps = [qemuutil, qos]
|
|
|
|
if test in qtests
|
|
|
|
# use a sourceset to quickly separate sources and deps
|
|
|
|
test_ss = ss.source_set()
|
|
|
|
test_ss.add(qtests[test])
|
|
|
|
src += test_ss.all_sources()
|
|
|
|
deps += test_ss.all_dependencies()
|
|
|
|
endif
|
2020-08-04 20:00:40 +02:00
|
|
|
qtest_executables += {
|
2020-10-06 14:44:00 +02:00
|
|
|
test: executable(test, src, dependencies: deps)
|
2020-08-04 20:00:40 +02:00
|
|
|
}
|
|
|
|
endif
|
|
|
|
# FIXME: missing dependency on the emulator binary and qemu-img
|
2020-10-19 12:22:43 +02:00
|
|
|
test('qtest-@0@/@1@'.format(target_base, test),
|
2020-08-04 20:00:40 +02:00
|
|
|
qtest_executables[test],
|
2020-09-16 11:00:53 +02:00
|
|
|
depends: [test_deps, qtest_emulator],
|
2020-08-04 20:00:40 +02:00
|
|
|
env: qtest_env,
|
|
|
|
args: ['--tap', '-k'],
|
|
|
|
protocol: 'tap',
|
|
|
|
suite: ['qtest', 'qtest-' + target_base])
|
|
|
|
endforeach
|
|
|
|
endforeach
|