All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>
Subject: Re: [PATCH 08/12] tests/qtest: Check for devices in bios-tables-test
Date: Mon, 6 Feb 2023 10:21:44 -0500	[thread overview]
Message-ID: <20230206102128-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20230206150416.4604-9-farosas@suse.de>

On Mon, Feb 06, 2023 at 12:04:12PM -0300, Fabiano Rosas wrote:
> Do not include tests that require devices that are not available in
> the QEMU build.
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

feel free to merge with rest of the patchset.

> ---
>  tests/qtest/bios-tables-test.c | 75 ++++++++++++++++++++++++++++++++--
>  1 file changed, 71 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index d8c8cda58e..d29a4e47af 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -1008,6 +1008,12 @@ static void test_acpi_q35_multif_bridge(void)
>          .machine = MACHINE_Q35,
>          .variant = ".multi-bridge",
>      };
> +
> +    if (!qtest_has_device("pcie-root-port")) {
> +        g_test_skip("Device pcie-root-port is not available");
> +        goto out;
> +    }
> +
>      test_vm_prepare("-S"
>          " -device virtio-balloon,id=balloon0,addr=0x4.0x2"
>          " -device pcie-root-port,id=rp0,multifunction=on,"
> @@ -1043,6 +1049,7 @@ static void test_acpi_q35_multif_bridge(void)
>      /* check that reboot/reset doesn't change any ACPI tables  */
>      qtest_qmp_send(data.qts, "{'execute':'system_reset' }");
>      process_acpi_tables(&data);
> +out:
>      free_test_data(&data);
>  }
>  
> @@ -1396,6 +1403,11 @@ static void test_acpi_tcg_dimm_pxm(const char *machine)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("nvdimm")) {
> +        g_test_skip("Device nvdimm is not available");
> +        return;
> +    }
> +
>      memset(&data, 0, sizeof(data));
>      data.machine = machine;
>      data.variant = ".dimmpxm";
> @@ -1444,6 +1456,11 @@ static void test_acpi_virt_tcg_memhp(void)
>          .scan_len = 256ULL * 1024 * 1024,
>      };
>  
> +    if (!qtest_has_device("nvdimm")) {
> +        g_test_skip("Device nvdimm is not available");
> +        goto out;
> +    }
> +
>      data.variant = ".memhp";
>      test_acpi_one(" -machine nvdimm=on"
>                    " -cpu cortex-a57"
> @@ -1457,7 +1474,7 @@ static void test_acpi_virt_tcg_memhp(void)
>                    " -device pc-dimm,id=dimm0,memdev=ram2,node=0"
>                    " -device nvdimm,id=dimm1,memdev=nvm0,node=1",
>                    &data);
> -
> +out:
>      free_test_data(&data);
>  
>  }
> @@ -1475,6 +1492,11 @@ static void test_acpi_microvm_tcg(void)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off",
>                    &data);
> @@ -1485,6 +1507,11 @@ static void test_acpi_microvm_usb_tcg(void)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      data.variant = ".usb";
>      test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,usb=on,rtc=off",
> @@ -1496,6 +1523,11 @@ static void test_acpi_microvm_rtc_tcg(void)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      data.variant = ".rtc";
>      test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=on",
> @@ -1507,6 +1539,11 @@ static void test_acpi_microvm_pcie_tcg(void)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      data.variant = ".pcie";
>      data.tcg_only = true; /* need constant host-phys-bits */
> @@ -1519,6 +1556,11 @@ static void test_acpi_microvm_ioapic2_tcg(void)
>  {
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      data.variant = ".ioapic2";
>      test_acpi_one(" -machine microvm,acpi=on,ioapic2=on,rtc=off",
> @@ -1558,6 +1600,12 @@ static void test_acpi_virt_tcg_pxb(void)
>          .ram_start = 0x40000000ULL,
>          .scan_len = 128ULL * 1024 * 1024,
>      };
> +
> +    if (!qtest_has_device("pcie-root-port")) {
> +        g_test_skip("Device pcie-root-port is not available");
> +        goto out;
> +    }
> +
>      /*
>       * While using -cdrom, the cdrom would auto plugged into pxb-pcie,
>       * the reason is the bus of pxb-pcie is also root bus, it would lead
> @@ -1576,7 +1624,7 @@ static void test_acpi_virt_tcg_pxb(void)
>                    " -cpu cortex-a57"
>                    " -device pxb-pcie,bus_nr=128",
>                    &data);
> -
> +out:
>      free_test_data(&data);
>  }
>  
> @@ -1764,6 +1812,12 @@ static void test_acpi_microvm_acpi_erst(void)
>      gchar *params;
>      test_data data;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        g_free(tmp_path);
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>      data.variant = ".pcie";
>      data.tcg_only = true; /* need constant host-phys-bits */
> @@ -1824,6 +1878,11 @@ static void test_acpi_q35_viot(void)
>          .variant = ".viot",
>      };
>  
> +    if (!qtest_has_device("virtio-iommu")) {
> +        g_test_skip("Device virtio-iommu is not available");
> +        goto out;
> +    }
> +
>      /*
>       * To keep things interesting, two buses bypass the IOMMU.
>       * VIOT should only describes the other two buses.
> @@ -1834,6 +1893,7 @@ static void test_acpi_q35_viot(void)
>                    "-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on "
>                    "-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0",
>                    &data);
> +out:
>      free_test_data(&data);
>  }
>  
> @@ -1894,8 +1954,10 @@ static void test_acpi_virt_viot(void)
>          .scan_len = 128ULL * 1024 * 1024,
>      };
>  
> -    test_acpi_one("-cpu cortex-a57 "
> -                  "-device virtio-iommu-pci", &data);
> +    if (qtest_has_device("virtio-iommu")) {
> +        test_acpi_one("-cpu cortex-a57 "
> +                       "-device virtio-iommu-pci", &data);
> +    }
>      free_test_data(&data);
>  }
>  
> @@ -2004,6 +2066,11 @@ static void test_acpi_microvm_oem_fields(void)
>      test_data data;
>      char *args;
>  
> +    if (!qtest_has_device("virtio-blk-device")) {
> +        g_test_skip("Device virtio-blk-device is not available");
> +        return;
> +    }
> +
>      test_acpi_microvm_prepare(&data);
>  
>      args = test_acpi_create_args(&data,
> -- 
> 2.35.3



  reply	other threads:[~2023-02-06 15:23 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 15:04 [PATCH 00/12] qtests vs. default devices Fabiano Rosas
2023-02-06 15:04 ` [PATCH 01/12] tests/qtest: Skip PXE tests for missing devices Fabiano Rosas
2023-02-07 13:14   ` Thomas Huth
2023-02-06 15:04 ` [PATCH 02/12] tests/qtest: Do not run lsi53c895a test if device is not present Fabiano Rosas
2023-02-06 15:31   ` Philippe Mathieu-Daudé
2023-02-06 17:46     ` Fabiano Rosas
2023-02-06 18:52       ` Philippe Mathieu-Daudé
2023-02-07 13:12   ` Thomas Huth
2023-02-07 14:02     ` Fabiano Rosas
2023-02-07 14:12       ` Thomas Huth
2023-02-06 15:04 ` [PATCH 03/12] tests/qtest: Add dependence on PCIE_ROOT for virtio-net-failover.c Fabiano Rosas
2023-02-07 13:22   ` Thomas Huth
2023-02-07 15:02     ` Fabiano Rosas
2023-02-06 15:04 ` [PATCH 04/12] tests/qtest: Skip virtio-serial-console tests if device not present Fabiano Rosas
2023-02-07 13:25   ` Thomas Huth
2023-02-07 15:35     ` Laurent Vivier
2023-02-07 13:37   ` Thomas Huth
2023-02-06 15:04 ` [PATCH 05/12] tests/qtest: hd-geo-test: Check for missing devices Fabiano Rosas
2023-02-07 13:52   ` Thomas Huth
2023-02-06 15:04 ` [PATCH 06/12] tests/qtest: Skip unplug tests that use " Fabiano Rosas
2023-02-07 13:59   ` Thomas Huth
2023-02-07 14:17     ` Fabiano Rosas
2023-02-07 14:22       ` Thomas Huth
2023-02-06 15:04 ` [PATCH 07/12] tests/qtest: drive_del-test: Skip tests that require " Fabiano Rosas
2023-02-07 14:20   ` Thomas Huth
2023-02-07 14:32     ` Fabiano Rosas
2023-02-06 15:04 ` [PATCH 08/12] tests/qtest: Check for devices in bios-tables-test Fabiano Rosas
2023-02-06 15:21   ` Michael S. Tsirkin [this message]
2023-02-06 15:04 ` [PATCH 09/12] tests/qtest: Do not include hexloader-test if loader device is not present Fabiano Rosas
2023-02-07 14:30   ` Thomas Huth
2023-02-06 15:04 ` [PATCH 10/12] tests/qemu-iotests: Require virtio-scsi-pci Fabiano Rosas
2023-02-07 14:32   ` Thomas Huth
2023-02-06 15:04 ` [PATCH 11/12] tests/qtest: bios-tables-test: Skip if missing configs Fabiano Rosas
2023-02-07 14:35   ` Thomas Huth
2023-02-07 14:42     ` Michael S. Tsirkin
2023-02-08 10:52       ` Igor Mammedov
2023-02-08 14:25         ` Michael S. Tsirkin
2023-02-06 15:04 ` [PATCH 12/12] [NOT FOR MERGE] tests/qtest: Introduce qtest_validate_args Fabiano Rosas
2023-02-07 14:55   ` Thomas Huth
2023-02-07 15:35     ` Fabiano Rosas

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=20230206102128-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=farosas@suse.de \
    --cc=imammedo@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 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.