qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: lvivier@redhat.com, thuth@redhat.com, f4bug@amsat.org, mst@redhat.com
Subject: [PATCH v2 15/15] tests: bios-tables-test: use qtest_has_accel() API to register TCG only tests
Date: Thu,  2 Sep 2021 07:35:51 -0400	[thread overview]
Message-ID: <20210902113551.461632-16-imammedo@redhat.com> (raw)
In-Reply-To: <20210902113551.461632-1-imammedo@redhat.com>

 .. only if TCG is available

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  - fix rebase conflict aftr dropping IORT test case

CC: thuth@redhat.com
CC: lvivier@redhat.com
CC: f4bug@amsat.org
---
 tests/qtest/bios-tables-test.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 068fcfd623..f6a77e9b5f 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -722,13 +722,6 @@ static void test_acpi_one(const char *params, test_data *data)
     char *args;
     bool use_uefi = data->uefi_fl1 && data->uefi_fl2;
 
-#ifndef CONFIG_TCG
-    if (data->tcg_only) {
-        g_test_skip("TCG disabled, skipping ACPI tcg_only test");
-        return;
-    }
-#endif /* CONFIG_TCG */
-
     args = test_acpi_create_args(data, params, use_uefi);
     data->qts = qtest_init(args);
     test_acpi_load_tables(data, use_uefi);
@@ -1541,6 +1534,7 @@ int main(int argc, char *argv[])
 {
     const char *arch = qtest_get_arch();
     const bool has_kvm = qtest_has_accel("kvm");
+    const bool has_tcg = qtest_has_accel("tcg");
     int ret;
 
     g_test_init(&argc, &argv, NULL);
@@ -1584,7 +1578,6 @@ int main(int argc, char *argv[])
         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/ivrs", test_acpi_q35_tcg_ivrs);
         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);
@@ -1594,19 +1587,24 @@ int main(int argc, char *argv[])
         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);
-        if (strcmp(arch, "x86_64") == 0) {
-            qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg);
+        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);
+            }
         }
         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);
         }
     } else if (strcmp(arch, "aarch64") == 0) {
-        qtest_add_func("acpi/virt", test_acpi_virt_tcg);
-        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);
+        if (has_tcg) {
+            qtest_add_func("acpi/virt", test_acpi_virt_tcg);
+            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);
+        }
     }
     ret = g_test_run();
     boot_sector_cleanup(disk);
-- 
2.27.0



  parent reply	other threads:[~2021-09-02 12:08 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 11:35 [PATCH v2 00/15] tests: acpi: add x2apic and various iommu tests Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 01/15] tests: acpi: dump table with failed checksum Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 02/15] tests: qtest: add qtest_has_accel() to check if tested binary supports accelerator Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 03/15] tests: acpi: whitelist expected tables for acpi/q35/xapic testcase Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 04/15] tests: acpi: q35: test for x2APIC entries in SRAT Igor Mammedov
2021-10-18 21:31   ` Michael S. Tsirkin
2021-10-19  9:48     ` Igor Mammedov
2021-10-19 10:23       ` Michael S. Tsirkin
2021-10-19 11:36         ` Igor Mammedov
2021-10-19 11:44           ` Michael S. Tsirkin
2021-10-20  8:16             ` Igor Mammedov
2021-10-20  8:18               ` Michael S. Tsirkin
2021-10-20  8:53                 ` Igor Mammedov
2021-10-20  8:58                   ` Thomas Huth
2021-10-20  9:43                     ` Igor Mammedov
2021-10-20  9:46                   ` Michael S. Tsirkin
2021-10-20 10:01                     ` Igor Mammedov
2021-10-20 10:03                       ` Michael S. Tsirkin
2021-09-02 11:35 ` [PATCH v2 05/15] tests: acpi: update expected tables blobs Igor Mammedov
2021-10-18 20:37   ` Michael S. Tsirkin
2021-10-19  9:56     ` Igor Mammedov
2021-10-19 10:27       ` Michael S. Tsirkin
2021-10-20  9:05         ` Igor Mammedov
2021-10-20  9:45           ` Michael S. Tsirkin
2021-10-20  9:57             ` Igor Mammedov
2021-10-20 10:02               ` Michael S. Tsirkin
2021-09-02 11:35 ` [PATCH v2 06/15] tests: acpi: whitelist new expected table tests/data/acpi/q35/DMAR.dmar Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 07/15] tests: acpi: add testcase for intel_iommu (DMAR table) Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 08/15] tests: acpi: add expected blob for DMAR table Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 09/15] tests: acpi: whitelist expected blobs for new acpi/q35/ivrs testcase Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 10/15] tests: acpi: add testcase for amd-iommu (IVRS table) Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 11/15] tests: acpi: update expected blobs Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 12/15] tests: acpi: arm/virt: drop redundant test_acpi_one() in test_acpi_virt_tcg() Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 13/15] tests: arm-cpu-features: use qtest_has_kvm() API Igor Mammedov
2021-09-02 11:35 ` [PATCH v2 14/15] tests: migration-test: use qtest_has_accel() API Igor Mammedov
2021-09-02 11:35 ` Igor Mammedov [this message]
2021-10-06 14:05 ` [PATCH v2 00/15] tests: acpi: add x2apic and various iommu tests Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210902113551.461632-16-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).