diff mbox

[5/5] usb-hcd-ehci-test: add ehci hotplug/unplug qtest

Message ID 1402992243-10224-6-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) June 17, 2014, 8:04 a.m. UTC
From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 tests/usb-hcd-ehci-test.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c
index e1427f5..831e868 100644
--- a/tests/usb-hcd-ehci-test.c
+++ b/tests/usb-hcd-ehci-test.c
@@ -175,6 +175,19 @@  static void pci_qtest_stop(void)
     qtest_end();
 }
 
+static void test_ehci_hotplug(void)
+{
+    qtest_start("");
+
+    /* hotplug an ehci controller */
+    qmp_exec_hmp_cmd("", "device_add usb-ehci,id=ehci");
+
+    /* hot unplug an ehci controller */
+    qmp_exec_hmp_cmd("", "device_del ehci");
+
+    qtest_end();
+}
+
 int main(int argc, char **argv)
 {
     int ret;
@@ -191,6 +204,8 @@  int main(int argc, char **argv)
     qtest_add_func("/ehci/pci/ehci-port-2", pci_ehci_port_2);
     qtest_add_func("/ehci/pci/qtest_stop", pci_qtest_stop);
 
+    qtest_add_func("/ehci/pci/ehci-hotplug", test_ehci_hotplug);
+
     ret = g_test_run();
 
     return ret;