[libvirt] [PATCH 4/6] tests: add a few qemuxml2argv virtio-gpu tests

Marc-André Lureau marcandre.lureau at gmail.com
Fri Nov 20 15:30:43 UTC 2015


Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
---
 .../qemuxml2argv-video-virtio-gpu-device.args      | 23 +++++++++++++++++
 .../qemuxml2argv-video-virtio-gpu-device.xml       | 29 ++++++++++++++++++++++
 .../qemuxml2argv-video-virtio-gpu-nodevice.args    | 24 ++++++++++++++++++
 .../qemuxml2argv-video-virtio-gpu-nodevice.xml     | 29 ++++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |  4 +++
 5 files changed, 109 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args
new file mode 100644
index 0000000..762a987
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args
@@ -0,0 +1,23 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 1024 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/var/lib/libvirt/images/QEMUGuest1,if=none,id=drive-ide0-0-0,format=qcow2,cache=none \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-device virtio-vga,id=video0,bus=pci.0,addr=0x2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml
new file mode 100644
index 0000000..36805c8
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/var/lib/libvirt/images/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <video>
+      <model type='virtio' heads='1'/>
+    </video>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args
new file mode 100644
index 0000000..83e6a55
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.args
@@ -0,0 +1,24 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 1024 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/var/lib/libvirt/images/QEMUGuest1,if=ide,bus=0,unit=0,format=qcow2,\
+cache=none \
+-net none \
+-serial none \
+-parallel none \
+-vga virtio
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml
new file mode 100644
index 0000000..36805c8
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-nodevice.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/var/lib/libvirt/images/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'/>
+    <video>
+      <model type='virtio' heads='1'/>
+    </video>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index dc8654e..cfb0243 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1748,6 +1748,10 @@ mymain(void)
     DO_TEST("qemu-ns-commandline-ns0", NONE);
     DO_TEST("qemu-ns-commandline-ns1", NONE);
 
+    DO_TEST("video-virtio-gpu-nodevice", QEMU_CAPS_VGA_VIRTIO);
+    DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE,
+            QEMU_CAPS_DEVICE_VIRTIO_VGA,
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
     qemuTestDriverFree(&driver);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-- 
2.5.0




More information about the libvir-list mailing list