[libvirt] [PATCH RFC 5/5] Add a usb hotplug testcase for reattachment

Tomasz Flendrich t.flendrich at gmail.com
Sat Aug 20 14:53:07 UTC 2016


In order to test the recent changes, a testcase to attach
a usb device after detaching one is added. It checks if addresses
are properly reused.
---
 tests/qemuhotplugtest.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index e0a7d70..2945fff 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -457,9 +457,12 @@ mymain(void)
     DO_TEST_ATTACH("base-live", "disk-usb", false, true,
                    "human-monitor-command", HMP("OK\\r\\n"),
                    "device_add", QMP_OK);
-    DO_TEST_DETACH("base-live", "disk-usb", false, false,
+    DO_TEST_DETACH("base-live", "disk-usb", false, true,
                    "device_del", QMP_OK,
                    "human-monitor-command", HMP(""));
+    DO_TEST_ATTACH("base-live", "disk-usb", false, false,
+                   "human-monitor-command", HMP("OK\\r\\n"),
+                   "device_add", QMP_OK);
 
     DO_TEST_ATTACH_EVENT("base-live", "disk-usb", false, true,
                          "human-monitor-command", HMP("OK\\r\\n"),
-- 
1.9.1




More information about the libvir-list mailing list