From e191a3e6997d12b7ce51e9ef8b800fbb7ec8178d Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Fri, 26 Jul 2013 14:44:52 +0200 Subject: [PATCH] qemuhotplugtest: Add tests for USB disk hotplug --- tests/qemuhotplugtest.c | 17 +++++++ .../qemuhotplug-disk-usb.xml | 7 +++ .../qemuhotplug-hotplug-base+disk-usb.xml | 45 +++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index cd57a2e177..a916bf6a7e 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -442,6 +442,23 @@ mymain(void) "device_del", QMP_DEVICE_DELETED("virtio-disk4") QMP_OK, "human-monitor-command", HMP("")); + DO_TEST_ATTACH("hotplug-base", "disk-usb", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + DO_TEST_DETACH("hotplug-base", "disk-usb", false, false, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + + DO_TEST_ATTACH_EVENT("hotplug-base", "disk-usb", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + DO_TEST_DETACH("hotplug-base", "disk-usb", true, true, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + DO_TEST_DETACH("hotplug-base", "disk-usb", false, false, + "device_del", QMP_DEVICE_DELETED("usb-disk16") QMP_OK, + "human-monitor-command", HMP("")); + virObjectUnref(driver.caps); virObjectUnref(driver.xmlopt); virObjectUnref(driver.config); diff --git a/tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml b/tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml new file mode 100644 index 0000000000..3f0c31889a --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-disk-usb.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml new file mode 100644 index 0000000000..1ea0f88313 --- /dev/null +++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml @@ -0,0 +1,45 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + +
+ + +
+ + + +
+ + + + + -- GitLab