[PATCH 0/4] tests/qtest: Check for devices before using them

Thomas Huth posted 4 patches 11 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230525081016.1870364-1-thuth@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
tests/qtest/bios-tables-test.c  | 2 +-
tests/qtest/cdrom-test.c        | 6 +++++-
tests/qtest/rtl8139-test.c      | 4 ++++
tests/qtest/usb-hcd-ehci-test.c | 5 +++++
tests/qtest/usb-hcd-uhci-test.c | 4 +++-
5 files changed, 18 insertions(+), 3 deletions(-)
[PATCH 0/4] tests/qtest: Check for devices before using them
Posted by Thomas Huth 11 months, 2 weeks ago
Here are some more patches that are required for running the qtests
with builds that have been configured with "--without-default-devices".
We need to check whether the required devices are really available
in the binaries before we can use them, otherwise the tests will
fail.

Thomas Huth (4):
  tests/qtest/usb-hcd-uhci-test: Check whether "usb-storage" is
    available
  tests/qtest: Check for virtio-blk before using -cdrom with the arm
    virt machine
  tests/qtest/rtl8139-test: Check whether the rtl8139 device is
    available
  tests/qtest/usb-hcd-ehci-test: Check for EHCI and UHCI HCDs before
    using them

 tests/qtest/bios-tables-test.c  | 2 +-
 tests/qtest/cdrom-test.c        | 6 +++++-
 tests/qtest/rtl8139-test.c      | 4 ++++
 tests/qtest/usb-hcd-ehci-test.c | 5 +++++
 tests/qtest/usb-hcd-uhci-test.c | 4 +++-
 5 files changed, 18 insertions(+), 3 deletions(-)

-- 
2.31.1
Re: [PATCH 0/4] tests/qtest: Check for devices before using them
Posted by Michael S. Tsirkin 10 months, 2 weeks ago
On Thu, May 25, 2023 at 10:10:12AM +0200, Thomas Huth wrote:
> Here are some more patches that are required for running the qtests
> with builds that have been configured with "--without-default-devices".
> We need to check whether the required devices are really available
> in the binaries before we can use them, otherwise the tests will
> fail.
> 
> Thomas Huth (4):
>   tests/qtest/usb-hcd-uhci-test: Check whether "usb-storage" is
>     available
>   tests/qtest: Check for virtio-blk before using -cdrom with the arm
>     virt machine
>   tests/qtest/rtl8139-test: Check whether the rtl8139 device is
>     available
>   tests/qtest/usb-hcd-ehci-test: Check for EHCI and UHCI HCDs before
>     using them
> 
>  tests/qtest/bios-tables-test.c  | 2 +-
>  tests/qtest/cdrom-test.c        | 6 +++++-
>  tests/qtest/rtl8139-test.c      | 4 ++++
>  tests/qtest/usb-hcd-ehci-test.c | 5 +++++
>  tests/qtest/usb-hcd-uhci-test.c | 4 +++-
>  5 files changed, 18 insertions(+), 3 deletions(-)

I am worried that if an uninitentional change disables some devices
by default our CI will no longer catch this.
Any way to address this? E.g. maybe introduce a "for CI" or
"test all" configure flag and then make test fail if something
hasn't been configured?

> -- 
> 2.31.1