From: Tomasz Flendrich Date: Fri, 22 Jul 2016 18:10:47 +0000 (+0200) Subject: qemuhotplugtest: Add tests for ccw devices X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ed8f23649192d48d3277873f95c7203870cd32f9;p=libvirt.git qemuhotplugtest: Add tests for ccw devices There's a plan to rework the address handling, so testcases that verify hotplugging ccw devices will help in avoiding regression. In this commit, some files are duplicated because of the way qemuhotplug.c calculates the expected xml filenames. I plan on changing that to explicitly stating the basis domain xml, the device xml, and the expected xml. --- diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index f2e7567c86..0a5f06834c 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -73,6 +73,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI); virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE); + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW); if (event) virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT); @@ -523,6 +524,42 @@ mymain(void) "device_del", QMP_OK, "chardev-remove", QMP_OK); + DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + DO_TEST_DETACH("base-ccw-live", "ccw-virtio", false, false, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + + DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + + DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, false, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + + DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + + DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, false, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + + /* Attach a second device, then detach the first one. Then attach the first one again. */ + DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + + DO_TEST_DETACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-explicit", false, true, + "device_del", QMP_OK, + "human-monitor-command", HMP("")); + + DO_TEST_ATTACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-reverse", false, false, + "human-monitor-command", HMP("OK\\r\\n"), + "device_add", QMP_OK); + qemuTestDriverFree(&driver); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml new file mode 100644 index 0000000000..74bd6a95a4 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml new file mode 100644 index 0000000000..d62e8a4255 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml new file mode 100644 index 0000000000..93e38e28a1 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml new file mode 100644 index 0000000000..ef1d329690 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml new file mode 100644 index 0000000000..7cf469ebb9 --- /dev/null +++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml @@ -0,0 +1,8 @@ + + + + + + +
+ diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml new file mode 100644 index 0000000000..2a27e11dc8 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml new file mode 100644 index 0000000000..1683174f08 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml @@ -0,0 +1,73 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml new file mode 100644 index 0000000000..7d2c3ab970 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml @@ -0,0 +1,73 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml new file mode 100644 index 0000000000..0821028620 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml new file mode 100644 index 0000000000..a262b9f254 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml @@ -0,0 +1,73 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml new file mode 100644 index 0000000000..a262b9f254 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml @@ -0,0 +1,73 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml new file mode 100644 index 0000000000..2a27e11dc8 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml @@ -0,0 +1,63 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml new file mode 100644 index 0000000000..17a0dc2285 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml @@ -0,0 +1,53 @@ + + hotplug + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + destroy + restart + restart + + /usr/libexec/qemu-kvm + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + +