Skip to content

Commit

Permalink
tests/qtest/usb-hcd-xhci-test: Check availability of devices before u…
Browse files Browse the repository at this point in the history
…sing them

The "usb-uas" and "usb-ccid" might not be compiled into the QEMU binary,
so let's better check first whether they are available.

Message-Id: <20230822163024.61529-1-thuth@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed Aug 31, 2023
1 parent c3513ce commit 0a1e462
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/qtest/usb-hcd-xhci-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ int main(int argc, char **argv)

qtest_add_func("/xhci/pci/init", test_xhci_init);
qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug);
qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug);
if (qtest_has_device("usb-uas")) {
qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug);
}
if (qtest_has_device("usb-ccid")) {
qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug);
}

qtest_start("-device nec-usb-xhci,id=xhci"
" -drive id=drive0,if=none,file=null-co://,"
Expand Down

0 comments on commit 0a1e462

Please sign in to comment.