RFC: Pass tests for x86_64 machine types compiled individually
cover RFC: Pass tests for x86_64 machine types compiled individually
Hi
This is a continuation on top of my previous series:
tests: Make expliction defaults for tests
Based-on: <[email protected]>
After the series is applied, the following combinations for x86_64-softmmu-devices.conf pass "make check"
CONFIG_ISAPC=yCONFIG_I440FX=yCONFIG_Q35=yCONFIG_MICROVM=y
CONFIG_ISAPC=nCONFIG_I440FX=yCONFIG_Q35=nCONFIG_MICROVM=n
CONFIG_ISAPC=nCONFIG_I440FX=nCONFIG_Q35=yCONFIG_MICROVM=n
ISAPC requires I440FX, so it can't be compiled alone. MICROVM is a mess, and you can't compile it right now without having CONFIG_PC defined, problem is at:
/scratch/qemu/full/m64/../../../../mnt/code/qemu/full/hw/i386/acpi-common.c:39:
multiple definition of `pc_madt_cpu_entry'; libcommon.fa.p/hw_acpi_acpi-x86-stub.c.o:/scratch/qemu/full/m64/../../../../mnt/code/qemu/full/hw/acpi/acpi-x86-stub.c:9:
first defined here
Basically the problem is that it expect CONFIG_PC to be defined. That happens if any other machine is defined, but if only MICROVM is defined it is not.
So, now that I explained what I wanted to do, what it does:
- make oem-fields consistent, only renames of functions
- sort bios-tables-tests by machine type, so
- it is easy to only run the things that are compiled in.
Once this is done, we make tests depend on CONFIG_Q35 or CONFIG_I440FX in meson.build file.
There are interesting cases, and are the tests are run with the default machine type (pc) but that work with either of them:
qtests_i386_require_default = \
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
(config_host.has_key('CONFIG_POSIX') and
config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
(config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-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_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \
(config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \
(config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \
(config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
(config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
(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'] : []) + \
['boot-order-test',
'fw_cfg-test',
'migration-test',
'numa-test',
'rtc-test',
'test-filter-redirector',
'test-x86-cpuid-compat',
'vmgenid-test'
]
This tests can be run with both machine types, but as we can't easily put -machine on them (several of them are supposed to run on other architectures), it is not "trivial to fix". I have a "hack" on my tree that gets the 1st machine available for this kind of tests and changed qtest_init() to qtest_init_first() that does exactly that. But I am not sure that is the way to go. Another way for me to fix it is just to change the Q35 machine to be the default for x86_64 when I400FX is not compiled in, but it has other kind of troubles. I started this wanting than all tests showed an explicit machine type, but there is nothing easier to be done for this multiarch tests. Notice that the problem already exist, and some tests do funny things to make sure that they get the "-machine pc".
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
machine_addition = "-machine pc";
}
QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
machine_addition);But this is not clear in my book.
So, what I am doing this again. Number of files to compile and be able to run "make check" with minimal configurations (for x86_64-softmmu):
- everything under the sun: 2757 files
- everything that you can disable with configure: 1838 files
- same than previous but only CONFIG_Q35 and this patches: 1759 files
- on my tree with other multiple hacks: around 1500 files compiled.
My goal would be that compiling with --without-default-devices, make check pass, but even after my changes, we get:
Summary of Failures:
2/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/migration-test ERROR 0.16s killed by signal 6 SIGABRT 3/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/bios-tables-test ERROR 0.17s killed by signal 6 SIGABRT 4/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/test-hmp ERROR 0.19s killed by signal 6 SIGABRT 1/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/qom-test ERROR 0.33s killed by signal 6 SIGABRT 81/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/lpc-ich9-test ERROR 0.14s killed by signal 6 SIGABRT 83/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/q35-test ERROR 0.16s killed by signal 6 SIGABRT 85/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/tco-test ERROR 0.16s killed by signal 6 SIGABRT 86/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/device-plug-test ERROR 0.14s killed by signal 6 SIGABRT 88/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/drive_del-test ERROR 0.21s killed by signal 6 SIGABRT 89/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/fdc-test ERROR 0.21s killed by signal 6 SIGABRT 91/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/ide-test ERROR 0.13s killed by signal 6 SIGABRT 92/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/display-vga-test ERROR 0.14s killed by signal 6 SIGABRT 90/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/i440fx-test ERROR 0.33s killed by signal 6 SIGABRT 93/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/erst-test ERROR 0.15s killed by signal 6 SIGABRT 95/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/test-filter-mirror ERROR 0.14s killed by signal 6 SIGABRT 96/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/fw_cfg-test ERROR 0.13s killed by signal 6 SIGABRT 98/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/rtc-test ERROR 0.15s killed by signal 6 SIGABRT 99/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/test-filter-redirector ERROR 0.14s killed by signal 6 SIGABRT 100/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/vmgenid-test ERROR 0.18s killed by signal 6 SIGABRT 102/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/cpu-plug-test ERROR 0.18s killed by signal 6 SIGABRT 97/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/numa-test ERROR 0.46s killed by signal 6 SIGABRT 104/124 qemu:qtest+qtest-x86_64 / qtest-x86_64/test-x86-cpuid-compat ERROR 0.38s killed by signal 6 SIGABRT
And we are not even starting to remove stuff that nobody is going to use in a modern guest (i.e. e1000e for instance is required).
So, the question is, I am the only one that think this need to be improved, or should we left this as a hack on my devel tree.
Please, comment.
Thanks, Juan.
Juan Quintela (8):
bios-tables-test: Make oem-fields tests be consistent
bios-tables-test: Sort all x86_64 tests by machine type
bios-tables-test: Only run test for machine types compiled in
tests: Only run intel-hda-tests if machine type is compiled in
tests: sb16 has both pc and q35 tests
tests: Make all tests that use q35 depend on it being compiled in
tests: Unfold qtest_pci
tests: Make all tests that depend on I440FX state that
tests/qtest/bios-tables-test.c | 155 ++++++++++++++++++--------------- tests/qtest/fuzz-sb16-test.c | 10 ++- tests/qtest/intel-hda-test.c | 13 +-- tests/qtest/meson.build | 97 +++++++++++---------- 4 files changed, 154 insertions(+), 121 deletions(-)
Signature · 1 line
2.37.2
PATCH 1/8 bios-tables-test: Make oem-fields tests be consistent
Every other test function is named:
test_acpi_<machine>_<test>()
Just make this test the same. Once there, rename "acpi/oem-fields" to "acpi/piix4/oem-fields" so it is consistent with everything else.
--- tests/qtest/bios-tables-test.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tests/qtest/bios-tables-test.c +8 -8
@@ -1671,7 +1671,7 @@ static void test_oem_fields(test_data *data) } } -static void test_acpi_oem_fields_pc (void ) +static void test_acpi_piix4_oem_fields (void ) {test_data data;char *args;
@@ -1691,7 +1691,7 @@ static void test_acpi_oem_fields_pc(void)g_free (args); } -static void test_acpi_oem_fields_q35 (void ) +static void test_acpi_q35_oem_fields (void ) {test_data data;char *args;
@@ -1711,7 +1711,7 @@ static void test_acpi_oem_fields_q35(void)g_free (args); } -static void test_acpi_oem_fields_microvm (void ) +static void test_acpi_microvm_oem_fields (void ) {test_data data;char *args;
@@ -1728,7 +1728,7 @@ static void test_acpi_oem_fields_microvm(void)g_free (args); } -static void test_acpi_oem_fields_virt (void ) +static void test_acpi_virt_oem_fields (void ) {test_data data = { .machine ="virt" ,
@@ -1766,13 +1766,13 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_oem_fields_q35); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields);if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) {qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis);qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); }qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); -qtest_add_func ("acpi/oem-fields" , test_acpi_oem_fields_pc); +qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields);qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge);qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , test_acpi_piix4_no_root_hotplug);
@@ -1819,7 +1819,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg);qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg);qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg); -qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_oem_fields_microvm); +qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields);if (has_tcg) {qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs);if (strcmp (arch,"x86_64" ) ==0 ) {
@@ -1844,7 +1844,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/virt/numamem" , test_acpi_virt_tcg_numamem);qtest_add_func ("acpi/virt/memhp" , test_acpi_virt_tcg_memhp);qtest_add_func ("acpi/virt/pxb" , test_acpi_virt_tcg_pxb); -qtest_add_func ("acpi/virt/oem-fields" , test_acpi_oem_fields_virt); +qtest_add_func ("acpi/virt/oem-fields" , test_acpi_virt_oem_fields);qtest_add_func ("acpi/virt/viot" , test_acpi_virt_viot); } }
Signature · 1 line
2.37.2
Re: [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent
Quoted 8 lines · Juan Quintela
Every other test function is named:
test_acpi_<machine>_<test>()Just make this test the same. Once there, rename "acpi/oem-fields" to "acpi/piix4/oem-fields" so it is consistent with everything else.
Signed-off-by Juan Quintela <[email protected]>
Quoted 82 lines
--- tests/qtest/bios-tables-test.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)tests/qtest/bios-tables-test.c +8
-9@@ -1671,7 +1671,7 @@ static void test_oem_fields(test_data *data) } } -static void test_acpi_oem_fields_pc (void ) +static void test_acpi_piix4_oem_fields (void ) {test_data data;char *args;@@ -1691,7 +1691,7 @@ static void test_acpi_oem_fields_pc(void)g_free (args); } -static void test_acpi_oem_fields_q35 (void ) +static void test_acpi_q35_oem_fields (void ) {test_data data;char *args;@@ -1711,7 +1711,7 @@ static void test_acpi_oem_fields_q35(void)g_free (args); } -static void test_acpi_oem_fields_microvm (void ) +static void test_acpi_microvm_oem_fields (void ) {test_data data;char *args;@@ -1728,7 +1728,7 @@ static void test_acpi_oem_fields_microvm(void)g_free (args); } -static void test_acpi_oem_fields_virt (void ) +static void test_acpi_virt_oem_fields (void ) {test_data data = { .machine ="virt" ,@@ -1766,13 +1766,13 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_oem_fields_q35); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields);if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) {qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis);qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); }qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); -qtest_add_func ("acpi/oem-fields" , test_acpi_oem_fields_pc); +qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields);qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge);qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , test_acpi_piix4_no_root_hotplug);@@ -1819,7 +1819,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg);qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg);qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg); -qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_oem_fields_microvm); +qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields);if (has_tcg) {qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs);if (strcmp (arch,"x86_64" ) ==0 ) {@@ -1844,7 +1844,7 @@ int main(int argc, char *argv[])qtest_add_func ("acpi/virt/numamem" , test_acpi_virt_tcg_numamem);qtest_add_func ("acpi/virt/memhp" , test_acpi_virt_tcg_memhp);qtest_add_func ("acpi/virt/pxb" , test_acpi_virt_tcg_pxb); -qtest_add_func ("acpi/virt/oem-fields" , test_acpi_oem_fields_virt); +qtest_add_func ("acpi/virt/oem-fields" , test_acpi_virt_oem_fields);qtest_add_func ("acpi/virt/viot" , test_acpi_virt_viot); } } --2.37.2
Re: [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent
In reply to Juan QuintelaQuoted 11 lines · Juan Quintela
Every other test function is named:
test_acpi_<machine>_<test>()Just make this test the same. Once there, rename "acpi/oem-fields" to "acpi/piix4/oem-fields" so it is consistent with everything else.
Signed-off-by Juan Quintela <[email protected]>--- tests/qtest/bios-tables-test.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
PATCH 2/8 bios-tables-test: Sort all x86_64 tests by machine type
In reply to Juan QuintelaNo code change here, just move test around.
--- tests/qtest/bios-tables-test.c | 60 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 27 deletions(-)
tests/qtest/bios-tables-test.c +33 -27
@@ -1766,11 +1766,6 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); -if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { -qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); -qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); - }qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg);qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields);qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge);
@@ -1780,48 +1775,68 @@ int main(int argc, char *argv[]) test_acpi_piix4_no_bridge_hotplug);qtest_add_func ("acpi/piix4/pci-hotplug/off" , test_acpi_piix4_no_acpi_pci_hotplug); -qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); -qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); -qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); -qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64);qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); -qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); -qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi);qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); -qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp);qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp); -qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp);qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); -qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem);qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm);qtest_add_func ("acpi/piix4/smm-compat" , test_acpi_piix4_tcg_smm_compat);qtest_add_func ("acpi/piix4/smm-compat-nosmm" , test_acpi_piix4_tcg_smm_compat_nosmm);qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); +qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); +qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat); +#ifdef CONFIG_POSIX +qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst); +#endif + +qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); +if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { +qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); +qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); + } +qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); +qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); +qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); +qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); +qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); +qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); +qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); +qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem);qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm);qtest_add_func ("acpi/q35/smm-compat" , test_acpi_q35_tcg_smm_compat);qtest_add_func ("acpi/q35/smm-compat-nosmm" , test_acpi_q35_tcg_smm_compat_nosmm);qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); -qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm);qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); -qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat);qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst);qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst);#endif qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc);qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); +if (has_tcg) { +qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); + } +if (has_kvm) { +qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); +qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); + } +qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); +#ifdef CONFIG_POSIX +qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); +#endif +qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); +qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg);qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg);qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg);qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg);qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields);if (has_tcg) { -qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs);if (strcmp (arch,"x86_64" ) ==0 ) {qtest_add_func ("acpi/microvm/pcie" , test_acpi_microvm_pcie_tcg);#ifdef CONFIG_POSIX
@@ -1829,15 +1844,6 @@ int main(int argc, char *argv[])#endif } } -if (has_kvm) { -qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); -qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); - } -qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); -#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); -#endif -qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); }else if (strcmp (arch,"aarch64" ) ==0 ) {if (has_tcg) {qtest_add_func ("acpi/virt" , test_acpi_virt_tcg);
Signature · 1 line
2.37.2
Re: [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type
Quoted 3 lines · Juan Quintela
No code change here, just move test around.
Signed-off-by Juan Quintela <[email protected]>
Quoted 122 lines
--- tests/qtest/bios-tables-test.c | 60 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 27 deletions(-)tests/qtest/bios-tables-test.c +33
-28@@ -1766,11 +1766,6 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); -if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { -qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); -qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); - }qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg);qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields);qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge);@@ -1780,48 +1775,68 @@ int main(int argc, char *argv[]) test_acpi_piix4_no_bridge_hotplug);qtest_add_func ("acpi/piix4/pci-hotplug/off" , test_acpi_piix4_no_acpi_pci_hotplug); -qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); -qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); -qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); -qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64);qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); -qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); -qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi);qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); -qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp);qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp); -qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp);qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); -qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem);qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm);qtest_add_func ("acpi/piix4/smm-compat" , test_acpi_piix4_tcg_smm_compat);qtest_add_func ("acpi/piix4/smm-compat-nosmm" , test_acpi_piix4_tcg_smm_compat_nosmm);qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); +qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); +qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat); +#ifdef CONFIG_POSIX +qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst); +#endif + +qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); +if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { +qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); +qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); + } +qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); +qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); +qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); +qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); +qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); +qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); +qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); +qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem);qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm);qtest_add_func ("acpi/q35/smm-compat" , test_acpi_q35_tcg_smm_compat);qtest_add_func ("acpi/q35/smm-compat-nosmm" , test_acpi_q35_tcg_smm_compat_nosmm);qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); -qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm);qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); -qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat);qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst);qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst);#endif qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc);qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); +if (has_tcg) { +qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); + } +if (has_kvm) { +qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); +qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); + } +qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); +#ifdef CONFIG_POSIX +qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); +#endif +qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); +qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg);qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg);qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg);qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg);qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields);if (has_tcg) { -qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs);if (strcmp (arch,"x86_64" ) ==0 ) {qtest_add_func ("acpi/microvm/pcie" , test_acpi_microvm_pcie_tcg);#ifdef CONFIG_POSIX @@ -1829,15 +1844,6 @@ int main(int argc, char *argv[])#endif } } -if (has_kvm) { -qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); -qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); - } -qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); -#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); -#endif -qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); }else if (strcmp (arch,"aarch64" ) ==0 ) {if (has_tcg) {qtest_add_func ("acpi/virt" , test_acpi_virt_tcg); --2.37.2
PATCH 3/8 bios-tables-test: Only run test for machine types compiled in
In reply to Juan Quintela--- tests/qtest/bios-tables-test.c | 145 ++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 67 deletions(-)
tests/qtest/bios-tables-test.c +78 -67
@@ -1766,82 +1766,93 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); -qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields); -qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge); -qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , - test_acpi_piix4_no_root_hotplug); -qtest_add_func ("acpi/piix4/pci-hotplug/no_bridge_hotplug" , - test_acpi_piix4_no_bridge_hotplug); -qtest_add_func ("acpi/piix4/pci-hotplug/off" , - test_acpi_piix4_no_acpi_pci_hotplug); -qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); -qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); -qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp); -qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); -qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm); -qtest_add_func ("acpi/piix4/smm-compat" , - test_acpi_piix4_tcg_smm_compat); -qtest_add_func ("acpi/piix4/smm-compat-nosmm" , - test_acpi_piix4_tcg_smm_compat_nosmm); -qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); -qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); -qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat); +if (qtest_has_machine (MACHINE_PC )) { +qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); +qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields); +qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge); +qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , + test_acpi_piix4_no_root_hotplug); +qtest_add_func ("acpi/piix4/pci-hotplug/no_bridge_hotplug" , + test_acpi_piix4_no_bridge_hotplug); +qtest_add_func ("acpi/piix4/pci-hotplug/off" , + test_acpi_piix4_no_acpi_pci_hotplug); +qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); +qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); +qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp); +qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); +qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm); +qtest_add_func ("acpi/piix4/smm-compat" , + test_acpi_piix4_tcg_smm_compat); +qtest_add_func ("acpi/piix4/smm-compat-nosmm" , + test_acpi_piix4_tcg_smm_compat_nosmm); +qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); +qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); +qtest_add_func ("acpi/piix4/acpihmat" , + test_acpi_piix4_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst); +qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst);#endif - -qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); -if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { -qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); -qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); } -qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); -qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); -qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); -qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); -qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); -qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); -qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); -qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem); -qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm); -qtest_add_func ("acpi/q35/smm-compat" , - test_acpi_q35_tcg_smm_compat); -qtest_add_func ("acpi/q35/smm-compat-nosmm" , - test_acpi_q35_tcg_smm_compat_nosmm); -qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); -qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); -qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat); +if (qtest_has_machine (MACHINE_Q35 )) { +qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); +if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { +qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); +qtest_add_func ("acpi/q35/tpm12-tis" , + test_acpi_q35_tcg_tpm12_tis); + } +qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); +qtest_add_func ("acpi/q35/multif-bridge" , + test_acpi_q35_multif_bridge); +qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); +qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); +qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); +qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); +qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); +qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem); +qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm); +qtest_add_func ("acpi/q35/smm-compat" , + test_acpi_q35_tcg_smm_compat); +qtest_add_func ("acpi/q35/smm-compat-nosmm" , + test_acpi_q35_tcg_smm_compat_nosmm); +qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); +qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); +qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst); +qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst);#endif -qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc); -qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); -if (has_tcg) { -qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); - } -if (has_kvm) { -qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); -qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); - } -qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); +qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc); +qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); +if (has_tcg) { +qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); + } +if (has_kvm) { +qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); +qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); + } +qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); +qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl);#endif -qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); - -qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg); -qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg); -qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg); -qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg); -qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields); -if (has_tcg) { -if (strcmp (arch,"x86_64" ) ==0 ) { -qtest_add_func ("acpi/microvm/pcie" , test_acpi_microvm_pcie_tcg); +qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); + } +if (qtest_has_machine ("microvm" )) { +qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg); +qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg); +qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg); +qtest_add_func ("acpi/microvm/ioapic2" , + test_acpi_microvm_ioapic2_tcg); +qtest_add_func ("acpi/microvm/oem-fields" , + test_acpi_microvm_oem_fields); +if (has_tcg) { +if (strcmp (arch,"x86_64" ) ==0 ) { +qtest_add_func ("acpi/microvm/pcie" , + test_acpi_microvm_pcie_tcg);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/microvm/acpierst" , test_acpi_microvm_acpi_erst); +qtest_add_func ("acpi/microvm/acpierst" , + test_acpi_microvm_acpi_erst);#endif + } } } }else if (strcmp (arch,"aarch64" ) ==0 ) {
Signature · 1 line
2.37.2
Re: [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in
Quoted 25 lines · Juan Quintela
Signed-off-by Juan Quintela <[email protected]>--- tests/qtest/bios-tables-test.c | 145 ++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 67 deletions(-)tests/qtest/bios-tables-test.c +0
-12@@ -1766,82 +1766,93 @@ int main(int argc, char *argv[])if (ret) {return ret; } -qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); -qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields); -qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge); -qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , - test_acpi_piix4_no_root_hotplug); -qtest_add_func ("acpi/piix4/pci-hotplug/no_bridge_hotplug" , - test_acpi_piix4_no_bridge_hotplug); -qtest_add_func ("acpi/piix4/pci-hotplug/off" , - test_acpi_piix4_no_acpi_pci_hotplug); -qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); -qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); -qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp);
tests/qtest/bios-tables-test.c int main(int argc, char *argv[]) · line 1769
Quoted 10 lines
tests/qtest/bios-tables-test.c +1
-9-qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); -qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm); -qtest_add_func ("acpi/piix4/smm-compat" , - test_acpi_piix4_tcg_smm_compat); -qtest_add_func ("acpi/piix4/smm-compat-nosmm" , - test_acpi_piix4_tcg_smm_compat_nosmm); -qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); -qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); -qtest_add_func ("acpi/piix4/acpihmat" , test_acpi_piix4_tcg_acpi_hmat); +if (qtest_has_machine (MACHINE_PC )) {
Using qtest_has_device(TYPE_PIIX4_PM) seems more appropriate, anyhow:
Quoted 135 lines
tests/qtest/bios-tables-test.c +77
-46+qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg); +qtest_add_func ("acpi/piix4/oem-fields" , test_acpi_piix4_oem_fields); +qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge); +qtest_add_func ("acpi/piix4/pci-hotplug/no_root_hotplug" , + test_acpi_piix4_no_root_hotplug); +qtest_add_func ("acpi/piix4/pci-hotplug/no_bridge_hotplug" , + test_acpi_piix4_no_bridge_hotplug); +qtest_add_func ("acpi/piix4/pci-hotplug/off" , + test_acpi_piix4_no_acpi_pci_hotplug); +qtest_add_func ("acpi/piix4/ipmi" , test_acpi_piix4_tcg_ipmi); +qtest_add_func ("acpi/piix4/cpuhp" , test_acpi_piix4_tcg_cphp); +qtest_add_func ("acpi/piix4/memhp" , test_acpi_piix4_tcg_memhp); +qtest_add_func ("acpi/piix4/numamem" , test_acpi_piix4_tcg_numamem); +qtest_add_func ("acpi/piix4/nosmm" , test_acpi_piix4_tcg_nosmm); +qtest_add_func ("acpi/piix4/smm-compat" , + test_acpi_piix4_tcg_smm_compat); +qtest_add_func ("acpi/piix4/smm-compat-nosmm" , + test_acpi_piix4_tcg_smm_compat_nosmm); +qtest_add_func ("acpi/piix4/nohpet" , test_acpi_piix4_tcg_nohpet); +qtest_add_func ("acpi/piix4/dimmpxm" , test_acpi_piix4_tcg_dimm_pxm); +qtest_add_func ("acpi/piix4/acpihmat" , + test_acpi_piix4_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst); +qtest_add_func ("acpi/piix4/acpierst" , test_acpi_piix4_acpi_erst);#endif - -qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); -qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); -if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { -qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); -qtest_add_func ("acpi/q35/tpm12-tis" , test_acpi_q35_tcg_tpm12_tis); } -qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); -qtest_add_func ("acpi/q35/multif-bridge" , test_acpi_q35_multif_bridge); -qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); -qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); -qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); -qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); -qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); -qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem); -qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm); -qtest_add_func ("acpi/q35/smm-compat" , - test_acpi_q35_tcg_smm_compat); -qtest_add_func ("acpi/q35/smm-compat-nosmm" , - test_acpi_q35_tcg_smm_compat_nosmm); -qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); -qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); -qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat); +if (qtest_has_machine (MACHINE_Q35 )) { +qtest_add_func ("acpi/q35" , test_acpi_q35_tcg); +qtest_add_func ("acpi/q35/oem-fields" , test_acpi_q35_oem_fields); +if (tpm_model_is_available ("-machine q35" ,"tpm-tis" )) { +qtest_add_func ("acpi/q35/tpm2-tis" , test_acpi_q35_tcg_tpm2_tis); +qtest_add_func ("acpi/q35/tpm12-tis" , + test_acpi_q35_tcg_tpm12_tis); + } +qtest_add_func ("acpi/q35/bridge" , test_acpi_q35_tcg_bridge); +qtest_add_func ("acpi/q35/multif-bridge" , + test_acpi_q35_multif_bridge); +qtest_add_func ("acpi/q35/mmio64" , test_acpi_q35_tcg_mmio64); +qtest_add_func ("acpi/q35/ipmi" , test_acpi_q35_tcg_ipmi); +qtest_add_func ("acpi/q35/smbus/ipmi" , test_acpi_q35_tcg_smbus_ipmi); +qtest_add_func ("acpi/q35/cpuhp" , test_acpi_q35_tcg_cphp); +qtest_add_func ("acpi/q35/memhp" , test_acpi_q35_tcg_memhp); +qtest_add_func ("acpi/q35/numamem" , test_acpi_q35_tcg_numamem); +qtest_add_func ("acpi/q35/nosmm" , test_acpi_q35_tcg_nosmm); +qtest_add_func ("acpi/q35/smm-compat" , + test_acpi_q35_tcg_smm_compat); +qtest_add_func ("acpi/q35/smm-compat-nosmm" , + test_acpi_q35_tcg_smm_compat_nosmm); +qtest_add_func ("acpi/q35/nohpet" , test_acpi_q35_tcg_nohpet); +qtest_add_func ("acpi/q35/dimmpxm" , test_acpi_q35_tcg_dimm_pxm); +qtest_add_func ("acpi/q35/acpihmat" , test_acpi_q35_tcg_acpi_hmat);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst); +qtest_add_func ("acpi/q35/acpierst" , test_acpi_q35_acpi_erst);#endif -qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc); -qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); -if (has_tcg) { -qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); - } -if (has_kvm) { -qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); -qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); - } -qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot); +qtest_add_func ("acpi/q35/applesmc" , test_acpi_q35_applesmc); +qtest_add_func ("acpi/q35/pvpanic-isa" , test_acpi_q35_pvpanic_isa); +if (has_tcg) { +qtest_add_func ("acpi/q35/ivrs" , test_acpi_q35_tcg_ivrs); + } +if (has_kvm) { +qtest_add_func ("acpi/q35/kvm/xapic" , test_acpi_q35_kvm_xapic); +qtest_add_func ("acpi/q35/kvm/dmar" , test_acpi_q35_kvm_dmar); + } +qtest_add_func ("acpi/q35/viot" , test_acpi_q35_viot);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl); +qtest_add_func ("acpi/q35/cxl" , test_acpi_q35_cxl);#endif -qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); - -qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg); -qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg); -qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg); -qtest_add_func ("acpi/microvm/ioapic2" , test_acpi_microvm_ioapic2_tcg); -qtest_add_func ("acpi/microvm/oem-fields" , test_acpi_microvm_oem_fields); -if (has_tcg) { -if (strcmp (arch,"x86_64" ) ==0 ) { -qtest_add_func ("acpi/microvm/pcie" , test_acpi_microvm_pcie_tcg); +qtest_add_func ("acpi/q35/slic" , test_acpi_q35_slic); + } +if (qtest_has_machine ("microvm" )) { +qtest_add_func ("acpi/microvm" , test_acpi_microvm_tcg); +qtest_add_func ("acpi/microvm/usb" , test_acpi_microvm_usb_tcg); +qtest_add_func ("acpi/microvm/rtc" , test_acpi_microvm_rtc_tcg); +qtest_add_func ("acpi/microvm/ioapic2" , + test_acpi_microvm_ioapic2_tcg); +qtest_add_func ("acpi/microvm/oem-fields" , + test_acpi_microvm_oem_fields); +if (has_tcg) { +if (strcmp (arch,"x86_64" ) ==0 ) { +qtest_add_func ("acpi/microvm/pcie" , + test_acpi_microvm_pcie_tcg);#ifdef CONFIG_POSIX -qtest_add_func ("acpi/microvm/acpierst" , test_acpi_microvm_acpi_erst); +qtest_add_func ("acpi/microvm/acpierst" , + test_acpi_microvm_acpi_erst);#endif + } } } }else if (strcmp (arch,"aarch64" ) ==0 ) {
PATCH 4/8 tests: Only run intel-hda-tests if machine type is compiled in
In reply to Juan Quintela--- tests/qtest/intel-hda-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
tests/qtest/intel-hda-test.c +8 -5
@@ -18,7 +18,7 @@/* Tests only initialization so far. TODO: Replace with functional tests */ static void ich6_test (void ) { -qtest_start ("-device intel-hda,id=" HDA_ID CODEC_DEVICES ); +qtest_start ("-machine pc -device intel-hda,id=" HDA_ID CODEC_DEVICES );qtest_end (); }
@@ -65,9 +65,12 @@ static void test_issue542_ich6(void)int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/intel-hda/ich6" , ich6_test); -qtest_add_func ("/intel-hda/ich9" , ich9_test); -qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6); - +if (qtest_has_machine ("pc" )) { +qtest_add_func ("/intel-hda/ich6" , ich6_test); + } +if (qtest_has_machine ("q35" )) { +qtest_add_func ("/intel-hda/ich9" , ich9_test); +qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6); + }return g_test_run (); }
Signature · 1 line
2.37.2
Re: [PATCH 4/8] tests: Only run intel-hda-tests if machine type is compiled in
Quoted 25 lines · Juan Quintela
Signed-off-by Juan Quintela <[email protected]>--- tests/qtest/intel-hda-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)tests/qtest/intel-hda-test.c +1
-4@@ -18,7 +18,7 @@/* Tests only initialization so far. TODO: Replace with functional tests */ static void ich6_test (void ) { -qtest_start ("-device intel-hda,id=" HDA_ID CODEC_DEVICES ); +qtest_start ("-machine pc -device intel-hda,id=" HDA_ID CODEC_DEVICES );qtest_end (); }@@ -65,9 +65,12 @@ static void test_issue542_ich6(void)int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/intel-hda/ich6" , ich6_test); -qtest_add_func ("/intel-hda/ich9" , ich9_test); -qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6);
tests/qtest/intel-hda-test.c static void test_issue542_ich6(void) · line 76
Quoted 10 lines
tests/qtest/intel-hda-test.c +7
-1- +if (qtest_has_machine ("pc" )) { +qtest_add_func ("/intel-hda/ich6" , ich6_test); + } +if (qtest_has_machine ("q35" )) { +qtest_add_func ("/intel-hda/ich9" , ich9_test); +qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6); + }return g_test_run (); }
Generically, we should really test for available devices, not particular machines... As new machines using tested devices could be added.
Could qtest_has_device(TYPE_INTEL_HDA_GENERIC) work here?
Re: [PATCH 4/8] tests: Only run intel-hda-tests if machine type is compiled in
In reply to Juan QuintelaOn Fri, 2 Sep 2022, Juan Quintela wrote:
Quoted 40 lines
Signed-off-by Juan Quintela <[email protected]>--- tests/qtest/intel-hda-test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)tests/qtest/intel-hda-test.c +8
-6@@ -18,7 +18,7 @@/* Tests only initialization so far. TODO: Replace with functional tests */ static void ich6_test (void ) { -qtest_start ("-device intel-hda,id=" HDA_ID CODEC_DEVICES ); +qtest_start ("-machine pc -device intel-hda,id=" HDA_ID CODEC_DEVICES );qtest_end (); }@@ -65,9 +65,12 @@ static void test_issue542_ich6(void)int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL ); -qtest_add_func ("/intel-hda/ich6" , ich6_test); -qtest_add_func ("/intel-hda/ich9" , ich9_test); -qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6); - +if (qtest_has_machine ("pc" )) { +qtest_add_func ("/intel-hda/ich6" , ich6_test); + } +if (qtest_has_machine ("q35" )) { +qtest_add_func ("/intel-hda/ich9" , ich9_test); +qtest_add_func ("/intel-hda/fuzz/issue542" , test_issue542_ich6); + }return g_test_run (); } --2.37.2
PATCH 5/8 tests: sb16 has both pc and q35 tests
In reply to Juan QuintelaCheck that the machines are compiled in before calling it
--- tests/qtest/fuzz-sb16-test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
tests/qtest/fuzz-sb16-test.c +7 -3
@@ -57,9 +57,13 @@ int main(int argc, char **argv) {g_test_init (&argc, &argv,NULL ); -qtest_add_func ("fuzz/test_fuzz_sb16/1c" , test_fuzz_sb16_0x1c); -qtest_add_func ("fuzz/test_fuzz_sb16/91" , test_fuzz_sb16_0x91); -qtest_add_func ("fuzz/test_fuzz_sb16/d4" , test_fuzz_sb16_0xd4); +if (qtest_has_machine ("q35" )) { +qtest_add_func ("fuzz/test_fuzz_sb16/1c" , test_fuzz_sb16_0x1c); + } +if (qtest_has_machine ("pc" )) { +qtest_add_func ("fuzz/test_fuzz_sb16/91" , test_fuzz_sb16_0x91); +qtest_add_func ("fuzz/test_fuzz_sb16/d4" , test_fuzz_sb16_0xd4); + }return g_test_run (); }
Signature · 1 line
2.37.2
PATCH 6/8 tests: Make all tests that use q35 depend on it being compiled in
In reply to Juan Quintela--- tests/qtest/meson.build | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
tests/qtest/meson.build +17 -10
@@ -51,13 +51,16 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \ - (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \ + (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_LPC_ICH9') ? ['lpc-ich9-test'] : []) + \ - (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_LPC_ICH9') and + config_all_devices.has_key('CONFIG_Q35') ? ['lpc-ich9-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') and + config_all_devices.has_key('CONFIG_Q35') ? ['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_EHCI') and + config_all_devices.has_key('CONFIG_Q35') ? ['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'] : []) + \
@@ -65,10 +68,14 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \ (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \ - (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \ - (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \ - (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \ - (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \ + (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') and + config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-megasas-test'] : []) + \ + (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') and + config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-lsi53c895a-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') and + config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-virtio-scsi-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SB16') and + config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-sb16-test'] : []) + \ (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ (config_host.has_key('CONFIG_POSIX') and \
@@ -77,6 +84,8 @@ qtests_i386 = \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ + (config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) + \ + (config_all_devices.has_key('CONFIG_Q35') ? ['tco-test'] : []) + \ (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ qtests_pci + \ qtests_cxl + \
@@ -89,9 +98,7 @@ qtests_i386 = \ 'fw_cfg-test', 'device-plug-test', 'drive_del-test', - 'tco-test', 'cpu-plug-test', - 'q35-test', 'vmgenid-test', 'migration-test', 'test-x86-cpuid-compat',
Signature · 1 line
2.37.2
Re: [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in
Quoted 10 lines · Juan Quintela
Signed-off-by Juan Quintela <[email protected]>--- tests/qtest/meson.build | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)tests/qtest/meson.build +0
-0
tests/qtest/meson.build qtests_i386 = \ · line 54
Quoted 5 lines
tests/qtest/meson.build +1
-1@@ -51,13 +51,16 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \ (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \ - (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \ + (config_all_devices.has_key('CONFIG_HDA') ? ['intel-hda-test'] : []) + \
White space damage?
tests/qtest/meson.build qtests_i386 = \ · line 60
Quoted 8 lines
tests/qtest/meson.build +4
-2(config_all_devices.has_key('CONFIG_I82801B11') ? ['i82801b11-test'] : []) + \ (config_all_devices.has_key('CONFIG_IOH3420') ? ['ioh3420-test'] : []) + \ - (config_all_devices.has_key('CONFIG_LPC_ICH9') ? ['lpc-ich9-test'] : []) + \ - (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_LPC_ICH9') and + config_all_devices.has_key('CONFIG_Q35') ? ['lpc-ich9-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') and + config_all_devices.has_key('CONFIG_Q35') ? ['usb-hcd-uhci-test'] : []) + \
Are you sure about the UHCI test? I did not spot any "q35" in tests/qtest/usb-hcd-uhci-test.c ...?
Thomas
PATCH 7/8 tests: Unfold qtest_pci
In reply to Juan QuintelaWe will need to configure depending on machine type for x86_64 on the following patch. It has only two users anyways.
--- tests/qtest/meson.build | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
tests/qtest/meson.build +5 -6
@@ -32,10 +32,6 @@ 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_cxl = \ (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
@@ -84,10 +80,11 @@ qtests_i386 = \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ + (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : []) + \ (config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) + \ (config_all_devices.has_key('CONFIG_Q35') ? ['tco-test'] : []) + \ (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ - qtests_pci + \ qtests_cxl + \ ['fdc-test', 'ide-test',
@@ -175,7 +172,9 @@ qtests_ppc64 = \ (slirp.found() ? ['pxe-test'] : []) + \ (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'] : []) + \ - qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test'] + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ + (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : []) + \ + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test'] qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) qtests_sh4eb = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : [])
Signature · 1 line
2.37.2
PATCH 8/8 tests: Make all tests that depend on I440FX state that
In reply to Juan QuintelaAll the tests that I have put in qtests_i386_require_default work with either "pc" or "q35".
--- tests/qtest/meson.build | 67 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 32 deletions(-)
tests/qtest/meson.build +35 -32
@@ -35,34 +35,48 @@ endif qtests_cxl = \ (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : []) +qtests_i386_require_default = \ + (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ + (config_host.has_key('CONFIG_POSIX') and + config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-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_ISA_IPMI_KCS') ? ['ipmi-kcs-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \ + (config_all_devices.has_key('CONFIG_WDT_IB700') ? ['wdt_ib700-test'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + (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'] : []) + \ + ['boot-order-test', + 'fw_cfg-test', + 'migration-test', + 'numa-test', + 'rtc-test', + 'test-filter-redirector', + 'test-x86-cpuid-compat', + 'vmgenid-test' + ] + qtests_i386 = \ (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ - (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_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'] : []) + \ - (config_all_devices.has_key('CONFIG_PVPANIC_ISA') ? ['pvpanic-test'] : []) + \ - (config_all_devices.has_key('CONFIG_PVPANIC_PCI') ? ['pvpanic-pci-test'] : []) + \ (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_LPC_ICH9') and config_all_devices.has_key('CONFIG_Q35') ? ['lpc-ich9-test'] : []) + \ - (config_all_devices.has_key('CONFIG_USB_UHCI') and - config_all_devices.has_key('CONFIG_Q35') ? ['usb-hcd-uhci-test'] : []) + \ (config_all_devices.has_key('CONFIG_USB_UHCI') and \ config_all_devices.has_key('CONFIG_USB_EHCI') and config_all_devices.has_key('CONFIG_Q35') ? ['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'] : []) + \ (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \ (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') and config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-megasas-test'] : []) + \
@@ -72,36 +86,25 @@ qtests_i386 = \ config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-virtio-scsi-test'] : []) + \ (config_all_devices.has_key('CONFIG_SB16') and config_all_devices.has_key('CONFIG_Q35') ? ['fuzz-sb16-test'] : []) + \ - (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ - (config_host.has_key('CONFIG_POSIX') and \ - config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ (config_all_devices.has_key('CONFIG_VIRTIO_NET') and \ config_all_devices.has_key('CONFIG_Q35') and \ config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \ slirp.found() ? ['virtio-net-failover'] : []) + \ - (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \ - (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : []) + \ + (config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') and + config_all_devices.has_key('CONFIG_I440FX') ? ['ivshmem-test'] : []) + \ (config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) + \ (config_all_devices.has_key('CONFIG_Q35') ? ['tco-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['device-plug-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['drive_del-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['fdc-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['hd-geo-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['i440fx-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? ['ide-test'] : []) + \ (unpack_edk2_blobs ? ['bios-tables-test'] : []) + \ + (config_all_devices.has_key('CONFIG_I440FX') ? qtests_i386_require_default: []) + \ qtests_cxl + \ - ['fdc-test', - 'ide-test', - 'hd-geo-test', - 'boot-order-test', - 'rtc-test', - 'i440fx-test', - 'fw_cfg-test', - 'device-plug-test', - 'drive_del-test', - 'cpu-plug-test', - 'vmgenid-test', - 'migration-test', - 'test-x86-cpuid-compat', - 'numa-test', - 'test-filter-redirector' - ] + ['cpu-plug-test'] if dbus_display qtests_i386 += ['dbus-display-test']
Signature · 1 line
2.37.2
On 02/09/2022 19.34, Juan Quintela wrote:
[...]
Quoted 2 lines
There are interesting cases, and are the tests are run with the default machine type (pc) but that work with either of them
[...]
Quoted 6 lines
This tests can be run with both machine types, but as we can't easily put -machine on them (several of them are supposed to run on other architectures), it is not "trivial to fix". I have a "hack" on my tree that gets the 1st machine available for this kind of tests and changed
qtest_init()toqtest_init_first()that does exactly that. But I am not sure that is the way to go.
I don't think that this would be a reliable solution, e.g. with qemu-system-ppc64 or -aarch64, there are plenty of different machine types and you cannot simply grab the first one to hope that it is good enough to run the tests.
Quoted 3 lines
Another way for me to fix it
is just to change the Q35 machine to be the default forx86_64when I400FX is not compiled in, but it has other kind of troubles.
I think there was a consensus in the past to rather get away from default machine types, so I think that's also the wrong way to go.
Quoted 3 lines
I
started this wanting than all tests showed an explicit machine type, but there is nothing easier to be done for this multiarch tests.
What about this idea: Introduce a "qtest_default_machine()" function that looks like this:
const char *qtest_default_machine(void)
{
if (g_strequal(arch, "i386") || g_strequal(arch, "x86_64")) {
if (qtest_has_machine("pc")) {
return "-machine pc";
} else if (qtest_has_machine("q35")) {
return "-machine q35";
} else {
abort(); // Or skip the test somehow?
}
}
if (g_strequal(arch, "arm") || g_strequal(arch, "aarch64")) {
/* ARM does not have a default machine, so use "virt" */
if (qtest_has_machine("virt")) {
return "-machine virt";
} else {
abort(); // Or skip the test somehow?
}
// ... similar logic for m68k, riscv, rx, avr and tricore ...
/* For all others use the default machine */
return "";
}Then you could use this à la:
qts = qtest_init("%s ...", gtest_default_machine(), ...);Or even add a wrapper function qtest_init_default_machine() for this?
HTH,
Thomas