aboutsummaryrefslogtreecommitdiff
path: root/tests/usb-hcd-ehci-test.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-09-26 09:28:14 +0000
committerAndreas Färber <afaerber@suse.de>2014-10-15 05:03:13 +0200
commitb3937683147481fba3406a01da4ce15f0b2deb21 (patch)
tree6b03dc1a4e4d72397e4f8757a813a5459beabecd /tests/usb-hcd-ehci-test.c
parentfbd942c993001f5276fcd1f25a56405fdd968472 (diff)
tests: usb: Generic usb device hotplug
use usb-tablet as a hotplugged usb device. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'tests/usb-hcd-ehci-test.c')
-rw-r--r--tests/usb-hcd-ehci-test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c
index 69f852230d..75073bf24e 100644
--- a/tests/usb-hcd-ehci-test.c
+++ b/tests/usb-hcd-ehci-test.c
@@ -128,6 +128,19 @@ static void pci_ehci_port_2(void)
}
}
+static void pci_ehci_port_3_hotplug(void)
+{
+ /* check for presence of hotplugged usb-tablet */
+ g_assert(pcibus != NULL);
+ ehci_port_test(&ehci1, 2, PORTSC_PPOWER | PORTSC_CONNECT);
+}
+
+static void pci_ehci_port_hotplug(void)
+{
+ usb_test_hotplug("ich9-ehci-1", 3, pci_ehci_port_3_hotplug);
+}
+
+
int main(int argc, char **argv)
{
int ret;
@@ -139,6 +152,7 @@ int main(int argc, char **argv)
qtest_add_func("/ehci/pci/ehci-config", pci_ehci_config);
qtest_add_func("/ehci/pci/uhci-port-2", pci_uhci_port_2);
qtest_add_func("/ehci/pci/ehci-port-2", pci_ehci_port_2);
+ qtest_add_func("/ehci/pci/ehci-port-3-hotplug", pci_ehci_port_hotplug);
qtest_start("-machine q35 -device ich9-usb-ehci1,bus=pcie.0,addr=1d.7,"
"multifunction=on,id=ich9-ehci-1 "