aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-05-25 10:10:13 +0200
committerThomas Huth <thuth@redhat.com>2023-05-26 09:10:49 +0200
commit54c8ff27f60dfef7909b4a4a5a9ed96fc2ce8197 (patch)
tree4443f2e7a7ba1b57f80f0208aa2ebe36015964dc /tests
parentbdc20bf5d1a750003f36d0c9e1b6065b61af5f2f (diff)
tests/qtest/usb-hcd-uhci-test: Check whether "usb-storage" is available
The "usb-storage" device might not have been compiled into the binary (e.g. when compiling with "--without-default-devices"), so we have to check first before using it. Message-Id: <20230525081016.1870364-2-thuth@redhat.com> Reviewed-by: Ani Sinha <anisinha@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/usb-hcd-uhci-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/qtest/usb-hcd-uhci-test.c b/tests/qtest/usb-hcd-uhci-test.c
index 84ac2f3c1a..28751f53da 100644
--- a/tests/qtest/usb-hcd-uhci-test.c
+++ b/tests/qtest/usb-hcd-uhci-test.c
@@ -74,7 +74,9 @@ int main(int argc, char **argv)
qtest_add_func("/uhci/pci/init", test_uhci_init);
qtest_add_func("/uhci/pci/port1", test_port_1);
qtest_add_func("/uhci/pci/hotplug", test_uhci_hotplug);
- qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotplug);
+ if (qtest_has_device("usb-storage")) {
+ qtest_add_func("/uhci/pci/hotplug/usb-storage", test_usb_storage_hotplug);
+ }
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
qs = qtest_pc_boot("%s", cmd);