All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually
@ 2022-09-02 17:34 Juan Quintela
  2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

Hi

This is a continuation on top of my previous series:

tests: Make expliction defaults for tests
Based-on: <20220902165126.1482-1-quintela@redhat.com>

After the series is applied, the following combinations for
x86_64-softmmu-devices.conf pass "make check"

CONFIG_ISAPC=y
CONFIG_I440FX=y
CONFIG_Q35=y
CONFIG_MICROVM=y

CONFIG_ISAPC=n
CONFIG_I440FX=y
CONFIG_Q35=n
CONFIG_MICROVM=n

CONFIG_ISAPC=n
CONFIG_I440FX=n
CONFIG_Q35=y
CONFIG_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(-)

-- 
2.37.2



^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-04  6:43   ` Ani Sinha
  2022-09-04 13:53   ` Philippe Mathieu-Daudé via
  2022-09-02 17:34 ` [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type Juan Quintela
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	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 <quintela@redhat.com>
---
 tests/qtest/bios-tables-test.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index a0853744ae..1e808b0864 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
  2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-05  6:22   ` Ani Sinha
  2022-09-02 17:34 ` [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in Juan Quintela
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

No code change here, just move test around.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/bios-tables-test.c | 60 +++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 1e808b0864..757db2bc40 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
  2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
  2022-09-02 17:34 ` [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-04 13:57   ` Philippe Mathieu-Daudé via
  2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/bios-tables-test.c | 145 ++++++++++++++++++---------------
 1 file changed, 78 insertions(+), 67 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 757db2bc40..bc216cac95 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -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) {
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/8] tests: Only run intel-hda-tests if machine type is compiled in
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (2 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-04 14:01   ` Philippe Mathieu-Daudé via
  2022-09-05  6:29   ` Ani Sinha
  2022-09-02 17:34 ` [PATCH 5/8] tests: sb16 has both pc and q35 tests Juan Quintela
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/intel-hda-test.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c
index a58c98e4d1..d4a8db6fd6 100644
--- a/tests/qtest/intel-hda-test.c
+++ b/tests/qtest/intel-hda-test.c
@@ -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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/8] tests: sb16 has both pc and q35 tests
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (3 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-02 17:34 ` [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in Juan Quintela
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

Check that the machines are compiled in before calling it

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/fuzz-sb16-test.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/fuzz-sb16-test.c b/tests/qtest/fuzz-sb16-test.c
index dd1b4b307f..fc445b1871 100644
--- a/tests/qtest/fuzz-sb16-test.c
+++ b/tests/qtest/fuzz-sb16-test.c
@@ -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();
 }
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (4 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 5/8] tests: sb16 has both pc and q35 tests Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-11 16:02   ` Thomas Huth
  2022-09-02 17:34 ` [PATCH 7/8] tests: Unfold qtest_pci Juan Quintela
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/meson.build | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index e910cb32ca..67b3b678d3 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -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',
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 7/8] tests: Unfold qtest_pci
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (5 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-02 17:34 ` [PATCH 8/8] tests: Make all tests that depend on I440FX state that Juan Quintela
  2022-09-20  7:55 ` [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Thomas Huth
  8 siblings, 0 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

We will need to configure depending on machine type for x86_64 on the
following patch.  It has only two users anyways.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/meson.build | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 67b3b678d3..6f17d901ba 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -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'] : [])
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 8/8] tests: Make all tests that depend on I440FX state that
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (6 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 7/8] tests: Unfold qtest_pci Juan Quintela
@ 2022-09-02 17:34 ` Juan Quintela
  2022-09-20  7:55 ` [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Thomas Huth
  8 siblings, 0 replies; 17+ messages in thread
From: Juan Quintela @ 2022-09-02 17:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier,
	Juan Quintela

All the tests that I have put in qtests_i386_require_default
work with either "pc" or "q35".

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 tests/qtest/meson.build | 67 +++++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 6f17d901ba..11bf970400 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -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']
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent
  2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
@ 2022-09-04  6:43   ` Ani Sinha
  2022-09-04 13:53   ` Philippe Mathieu-Daudé via
  1 sibling, 0 replies; 17+ messages in thread
From: Ani Sinha @ 2022-09-04  6:43 UTC (permalink / raw)
  To: Juan Quintela
  Cc: qemu-devel, Bandan Das, Darren Kenny, Alexander Bulekov,
	Paolo Bonzini, Stefan Hajnoczi, Igor Mammedov, Thomas Huth,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier



On Fri, 2 Sep 2022, Juan Quintela wrote:

> 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 <quintela@redhat.com>

Reviewed-by: Ani Sinha <ani@anisinha.ca>

> ---
>  tests/qtest/bios-tables-test.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index a0853744ae..1e808b0864 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -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
>
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent
  2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
  2022-09-04  6:43   ` Ani Sinha
@ 2022-09-04 13:53   ` Philippe Mathieu-Daudé via
  1 sibling, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-09-04 13:53 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier

On 2/9/22 19:34, Juan Quintela wrote:
> 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 <quintela@redhat.com>
> ---
>   tests/qtest/bios-tables-test.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in
  2022-09-02 17:34 ` [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in Juan Quintela
@ 2022-09-04 13:57   ` Philippe Mathieu-Daudé via
  0 siblings, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-09-04 13:57 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier

On 2/9/22 19:34, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>   tests/qtest/bios-tables-test.c | 145 ++++++++++++++++++---------------
>   1 file changed, 78 insertions(+), 67 deletions(-)
> 
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 757db2bc40..bc216cac95 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -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)) {

Using qtest_has_device(TYPE_PIIX4_PM) seems more appropriate, anyhow:

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> +            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) {



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/8] tests: Only run intel-hda-tests if machine type is compiled in
  2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
@ 2022-09-04 14:01   ` Philippe Mathieu-Daudé via
  2022-09-05  6:29   ` Ani Sinha
  1 sibling, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé via @ 2022-09-04 14:01 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Thomas Huth, Ani Sinha,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier

On 2/9/22 19:34, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>   tests/qtest/intel-hda-test.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c
> index a58c98e4d1..d4a8db6fd6 100644
> --- a/tests/qtest/intel-hda-test.c
> +++ b/tests/qtest/intel-hda-test.c
> @@ -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();
>   }

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?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type
  2022-09-02 17:34 ` [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type Juan Quintela
@ 2022-09-05  6:22   ` Ani Sinha
  0 siblings, 0 replies; 17+ messages in thread
From: Ani Sinha @ 2022-09-05  6:22 UTC (permalink / raw)
  To: Juan Quintela
  Cc: qemu-devel, Bandan Das, Darren Kenny, Alexander Bulekov,
	Paolo Bonzini, Stefan Hajnoczi, Igor Mammedov, Thomas Huth,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier



On Fri, 2 Sep 2022, Juan Quintela wrote:

> No code change here, just move test around.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Ani Sinha <ani@anisinha.ca>

> ---
>  tests/qtest/bios-tables-test.c | 60 +++++++++++++++++++---------------
>  1 file changed, 33 insertions(+), 27 deletions(-)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index 1e808b0864..757db2bc40 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -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
>
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/8] tests: Only run intel-hda-tests if machine type is compiled in
  2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
  2022-09-04 14:01   ` Philippe Mathieu-Daudé via
@ 2022-09-05  6:29   ` Ani Sinha
  1 sibling, 0 replies; 17+ messages in thread
From: Ani Sinha @ 2022-09-05  6:29 UTC (permalink / raw)
  To: Juan Quintela
  Cc: qemu-devel, Bandan Das, Darren Kenny, Alexander Bulekov,
	Paolo Bonzini, Stefan Hajnoczi, Igor Mammedov, Thomas Huth,
	Gerd Hoffmann, Qiuhao Li, Michael S. Tsirkin, Laurent Vivier



On Fri, 2 Sep 2022, Juan Quintela wrote:

Reviewed-by: Ani Sinha <ani@anisinha.ca>

> Signed-off-by: Juan Quintela <quintela@redhat.com>

> ---
>  tests/qtest/intel-hda-test.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c
> index a58c98e4d1..d4a8db6fd6 100644
> --- a/tests/qtest/intel-hda-test.c
> +++ b/tests/qtest/intel-hda-test.c
> @@ -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
>
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in
  2022-09-02 17:34 ` [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in Juan Quintela
@ 2022-09-11 16:02   ` Thomas Huth
  0 siblings, 0 replies; 17+ messages in thread
From: Thomas Huth @ 2022-09-11 16:02 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Ani Sinha, Gerd Hoffmann,
	Qiuhao Li, Michael S. Tsirkin, Laurent Vivier

On 02/09/2022 19.34, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>   tests/qtest/meson.build | 27 +++++++++++++++++----------
>   1 file changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index e910cb32ca..67b3b678d3 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -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?

>     (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



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually
  2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
                   ` (7 preceding siblings ...)
  2022-09-02 17:34 ` [PATCH 8/8] tests: Make all tests that depend on I440FX state that Juan Quintela
@ 2022-09-20  7:55 ` Thomas Huth
  8 siblings, 0 replies; 17+ messages in thread
From: Thomas Huth @ 2022-09-20  7:55 UTC (permalink / raw)
  To: Juan Quintela, qemu-devel
  Cc: Bandan Das, Darren Kenny, Alexander Bulekov, Paolo Bonzini,
	Stefan Hajnoczi, Igor Mammedov, Ani Sinha, Gerd Hoffmann,
	Qiuhao Li, Michael S. Tsirkin, Laurent Vivier

On 02/09/2022 19.34, Juan Quintela wrote:
[...]
> There are interesting cases, and are the tests are run with the
> default machine type (pc) but that work with either of them
[...]
> 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.

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.

> 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 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.

> 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



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-09-20  7:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 17:34 [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Juan Quintela
2022-09-02 17:34 ` [PATCH 1/8] bios-tables-test: Make oem-fields tests be consistent Juan Quintela
2022-09-04  6:43   ` Ani Sinha
2022-09-04 13:53   ` Philippe Mathieu-Daudé via
2022-09-02 17:34 ` [PATCH 2/8] bios-tables-test: Sort all x86_64 tests by machine type Juan Quintela
2022-09-05  6:22   ` Ani Sinha
2022-09-02 17:34 ` [PATCH 3/8] bios-tables-test: Only run test for machine types compiled in Juan Quintela
2022-09-04 13:57   ` Philippe Mathieu-Daudé via
2022-09-02 17:34 ` [PATCH 4/8] tests: Only run intel-hda-tests if machine type is " Juan Quintela
2022-09-04 14:01   ` Philippe Mathieu-Daudé via
2022-09-05  6:29   ` Ani Sinha
2022-09-02 17:34 ` [PATCH 5/8] tests: sb16 has both pc and q35 tests Juan Quintela
2022-09-02 17:34 ` [PATCH 6/8] tests: Make all tests that use q35 depend on it being compiled in Juan Quintela
2022-09-11 16:02   ` Thomas Huth
2022-09-02 17:34 ` [PATCH 7/8] tests: Unfold qtest_pci Juan Quintela
2022-09-02 17:34 ` [PATCH 8/8] tests: Make all tests that depend on I440FX state that Juan Quintela
2022-09-20  7:55 ` [PATCH 0/8] RFC: Pass tests for x86_64 machine types compiled individually Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.