Commit ed5aa85f371aebb0103e712f9a103d011ab9ae43
qemu: don't use chardev FD passing for vhostuser backend
altered the legacy DO_TEST macro.
Run the test against capabilities of QEMU 2.5.0 (which did not
support QEMU_CAPS_CHARDEV_FD_PASS) as well as the latest version.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
.../net-vhostuser.x86_64-2.5.0.args | 39 ++++++++++++++++++++
.../net-vhostuser.x86_64-latest.args | 42 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
3 files changed, 83 insertions(+)
create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args
diff --git a/tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args
b/tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args
new file mode 100644
index 0000000000..677a3c9e49
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-vhostuser.x86_64-2.5.0.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-machine pc-i440fx-2.5,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
+-netdev vhost-user,chardev=charnet0,id=hostnet0 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
+addr=0x2 \
+-chardev socket,id=charnet1,path=/tmp/vhost1.sock \
+-netdev vhost-user,chardev=charnet1,id=hostnet1 \
+-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
+addr=0x3 \
+-netdev socket,listen=:2015,id=hostnet2 \
+-device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,\
+addr=0x4 \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args
b/tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args
new file mode 100644
index 0000000000..7dee2bdf58
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-vhostuser.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
+-netdev vhost-user,chardev=charnet0,id=hostnet0 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
+addr=0x2 \
+-chardev socket,id=charnet1,path=/tmp/vhost1.sock \
+-netdev vhost-user,chardev=charnet1,id=hostnet1 \
+-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
+addr=0x3 \
+-netdev socket,listen=:2015,id=hostnet2 \
+-device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,\
+addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3d25e0a4ea..39a7f1f53c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1359,6 +1359,8 @@ mymain(void)
DO_TEST("misc-uuid", NONE);
DO_TEST_PARSE_ERROR("vhost_queues-invalid", NONE);
DO_TEST("net-vhostuser", QEMU_CAPS_CHARDEV_FD_PASS);
+ DO_TEST_CAPS_VER("net-vhostuser", "2.5.0");
+ DO_TEST_CAPS_LATEST("net-vhostuser");
DO_TEST("net-vhostuser-multiq",
QEMU_CAPS_VHOSTUSER_MULTIQUEUE);
DO_TEST_FAILURE("net-vhostuser-multiq", NONE);
--
2.16.4