On Sat, Jul 16, 2016 at 02:42:55AM +0200, Tomasz Flendrich wrote:
This is the first testcase for qemuhotplugtest for attaching and
detaching a device to the persistent domain.

---
tests/qemuhotplugtest.c                            |  7 ++++
.../qemuhotplug-base-config+qemu-agent+config.xml  | 45 ++++++++++++++++++++++
.../qemuhotplug-base-config.xml                    | 40 +++++++++++++++++++
3 files changed, 92 insertions(+)
create mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 5cf29e5..1f94e67 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -606,6 +606,13 @@ mymain(void)
                   "human-monitor-command", HMP("OK\\r\\n"),
                   "device_add", QMP_OK);

+    DO_TEST_ATTACH("base-config", "qemu-agent", false, true, 
VIR_DOMAIN_AFFECT_CONFIG,
+                   "chardev-add", QMP_OK,
+                   "device_add", QMP_OK);
+    DO_TEST_DETACH("base-config", "qemu-agent", false, false, 
VIR_DOMAIN_AFFECT_CONFIG,
+                   "device_del", QMP_OK,
+                   "chardev-remove", QMP_OK);
+
    qemuTestDriverFree(&driver);
    return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git 
a/tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml 
b/tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml
new file mode 100644
index 0000000..e209f67
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml
@@ -0,0 +1,45 @@
+<domain type='kvm'>
+  <name>hotplug</name>
+  <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+  <memory unit='KiB'>4194304</memory>
+  <currentMemory unit='KiB'>4194304</currentMemory>
+  <vcpu placement='static'>4</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <pae/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <emulator>/usr/libexec/qemu-kvm</emulator>
+    <controller type='usb' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
+    </controller>
+    <controller type='ide' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
+    </controller>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='virtio-serial' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
+    </controller>
+    <channel type='unix'>
+      <source mode='bind'/>

This line needs to be removed due to Jiri's patches.

Also the test fails for me, but that might be just another upstream
patch that was applied.

diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml 
b/tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml
new file mode 100644
index 0000000..20ad0a5
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml

I don't think we need two base files, the live one should parse cleanly
as config one.  Although having this one makes it way easier to just see
the diff of base and base+something to see the difference.  OK, let's
keep it here :)

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to