Test for virtio-{keyboard, mouse, tablet}-ccw.
Signed-off-by: Farhan Ali <alifm(a)linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
tests/qemuxml2argvdata/input-virtio-ccw.args | 26 +++++++++++++++++++
tests/qemuxml2argvdata/input-virtio-ccw.xml | 29 +++++++++++++++++++++
tests/qemuxml2argvtest.c | 8 ++++++
tests/qemuxml2xmloutdata/input-virtio-ccw.xml | 36 +++++++++++++++++++++++++++
tests/qemuxml2xmltest.c | 9 +++++++
5 files changed, 108 insertions(+)
create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/input-virtio-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/input-virtio-ccw.xml
diff --git a/tests/qemuxml2argvdata/input-virtio-ccw.args
b/tests/qemuxml2argvdata/input-virtio-ccw.args
new file mode 100644
index 0000000..6ee318c
--- /dev/null
+++ b/tests/qemuxml2argvdata/input-virtio-ccw.args
@@ -0,0 +1,26 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name QEMUGuest1 \
+-S \
+-M s390-ccw-virtio \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1803 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-boot c \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-device virtio-keyboard-ccw,id=input0,devno=fe.0.0002 \
+-device virtio-mouse-ccw,id=input1,devno=fe.0.0003 \
+-device virtio-tablet-ccw,id=input2,devno=fe.0.0004 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001
diff --git a/tests/qemuxml2argvdata/input-virtio-ccw.xml
b/tests/qemuxml2argvdata/input-virtio-ccw.xml
new file mode 100644
index 0000000..a971662
--- /dev/null
+++ b/tests/qemuxml2argvdata/input-virtio-ccw.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1803</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x1'/>
+ </memballoon>
+ <input type='keyboard' bus='virtio'/>
+ <input type='mouse' bus='virtio'/>
+ <input type='tablet' bus='virtio'/>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 59e5bda..9c1d3b5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2973,6 +2973,14 @@ mymain(void)
QEMU_CAPS_VNC,
QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
+ DO_TEST("input-virtio-ccw", QEMU_CAPS_VIRTIO_CCW,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW,
+ QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW,
+ QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW);
+
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
virFileDeleteTree(fakerootdir);
diff --git a/tests/qemuxml2xmloutdata/input-virtio-ccw.xml
b/tests/qemuxml2xmloutdata/input-virtio-ccw.xml
new file mode 100644
index 0000000..693472b
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/input-virtio-ccw.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1803</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>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-system-s390x</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0000'/>
+ </disk>
+ <input type='keyboard' bus='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0002'/>
+ </input>
+ <input type='mouse' bus='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0003'/>
+ </input>
+ <input type='tablet' bus='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0004'/>
+ </input>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0001'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 766f143..61abf66 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1358,6 +1358,15 @@ mymain(void)
DO_TEST("user-aliases", NONE);
+ DO_TEST("input-virtio-ccw",
+ QEMU_CAPS_VIRTIO_CCW,
+ QEMU_CAPS_VIRTIO_KEYBOARD,
+ QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_TABLET,
+ QEMU_CAPS_DEVICE_VIRTIO_KEYBOARD_CCW,
+ QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW,
+ QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW);
+
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
virFileDeleteTree(fakerootdir);
--
2.7.4