This patch adds a test for the qemu command line generation.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne(a)us.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi(a)linux.vnet.ibm.com>
---
tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 16 ++++++++++
tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml | 36 +++++++++++++++++++++++
tests/qemuxml2argvtest.c | 4 +++
3 files changed, 56 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args
b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args
new file mode 100644
index 0000000..8d2f21a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args
@@ -0,0 +1,16 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M s390-ccw-virtio -m 214 -smp 1 \
+-nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 -device \
+virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,id=virtio-disk0 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,\
+path=/export/to/guest -device virtio-9p-ccw,id=fs0,fsdev=fsdev-fs0,\
+mount_tag=/import/from/host,devno=fe.0.0001 \
+-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\
+path=/export/to/guest2 -device virtio-9p-ccw,id=fs1,fsdev=fsdev-fs1,\
+mount_tag=/import/from/host2,devno=fe.0.0002 \
+-fsdev handle,writeout=immediate,id=fsdev-fs2,\
+path=/export/to/guest3 -device virtio-9p-ccw,id=fs2,fsdev=fsdev-fs2,\
+mount_tag=/import/from/host3,devno=fe.0.0003 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0004
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
new file mode 100644
index 0000000..860e34b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</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</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ </disk>
+ <filesystem type='mount'>
+ <source dir='/export/to/guest'/>
+ <target dir='/import/from/host'/>
+ </filesystem>
+ <filesystem accessmode='mapped'>
+ <driver type='path' wrpolicy='immediate'/>
+ <source dir='/export/to/guest2'/>
+ <target dir='/import/from/host2'/>
+ </filesystem>
+ <filesystem>
+ <driver type='handle' wrpolicy='immediate'/>
+ <source dir='/export/to/guest3'/>
+ <target dir='/import/from/host3'/>
+ </filesystem>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 574777b..d3f09b1 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1219,6 +1219,10 @@ mymain(void)
DO_TEST("fs9p",
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV,
QEMU_CAPS_FSDEV_WRITEOUT);
+ DO_TEST("fs9p-ccw",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV,
+ QEMU_CAPS_FSDEV_WRITEOUT, QEMU_CAPS_DRIVE,
+ QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
DO_TEST("hostdev-usb-address", NONE);
DO_TEST("hostdev-usb-address-device",
--
1.8.1.4