Use the 'chardev-backends' test data as symlink to invoke the test case
again asserting QEMU_CAPS_CHARDEV_JSON which will make the commandline
generator use the JSON representation of the -chardev backend instead
allowing us to validate it agains the QMP schema.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
.../chardev-backends-json.x86_64-latest.args | 79 +++++++++++++++++++
.../chardev-backends-json.x86_64-latest.xml | 1 +
.../qemuxmlconfdata/chardev-backends-json.xml | 1 +
tests/qemuxmlconftest.c | 4 +
4 files changed, 85 insertions(+)
create mode 100644 tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.args
create mode 120000 tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.xml
create mode 120000 tests/qemuxmlconfdata/chardev-backends-json.xml
diff --git a/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.args
b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.args
new file mode 100644
index 0000000000..98929ab39f
--- /dev/null
+++ b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.args
@@ -0,0 +1,79 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}'
\
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel tcg \
+-cpu qemu64 \
+-m size=219136k \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-no-user-config \
+-nodefaults \
+-chardev
'{"id":"charmonitor","backend":{"type":"socket","data":{"addr":{"type":"fd","data":{"str":"1729"}},"server":true,"wait":false}}}'
\
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device
'{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}'
\
+-device
'{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.0","addr":"0x3"}'
\
+-chardev
'{"id":"charparallel0","backend":{"type":"parallel","data":{"device":"/dev/parport0"}}}'
\
+-device
'{"driver":"isa-parallel","chardev":"charparallel0","id":"parallel0"}'
\
+-add-fd set=0,fd=1751,opaque=channel0-log \
+-chardev
'{"id":"charchannel0","backend":{"type":"null","data":{"logfile":"/dev/fdset/0","logappend":true}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"chardev-null"}'
\
+-add-fd set=1,fd=1751,opaque=channel1-log \
+-chardev
'{"id":"charchannel1","backend":{"type":"vc","data":{"logfile":"/dev/fdset/1","logappend":true}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"chardev-vc"}'
\
+-chardev
'{"id":"charchannel2","backend":{"type":"pty","data":{}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":3,"chardev":"charchannel2","id":"channel2","name":"chardev-pty"}'
\
+-chardev
'{"id":"charchannel3","backend":{"type":"stdio","data":{}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":4,"chardev":"charchannel3","id":"channel3","name":"chardev-stdio"}'
\
+-add-fd set=2,fd=1750,opaque=channel4-source \
+-chardev
'{"id":"charchannel4","backend":{"type":"file","data":{"out":"/dev/fdset/2","append":true}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":5,"chardev":"charchannel4","id":"channel4","name":"chardev-file"}'
\
+-chardev
'{"id":"charchannel5","backend":{"type":"pipe","data":{"device":"/path/to/pipe"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":6,"chardev":"charchannel5","id":"channel5","name":"chardev-pipe"}'
\
+-chardev
'{"id":"charchannel6","backend":{"type":"serial","data":{"device":"/path/to/device"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":7,"chardev":"charchannel6","id":"channel6","name":"chardev-dev"}'
\
+-chardev
'{"id":"charchannel7","backend":{"type":"socket","data":{"addr":{"type":"fd","data":{"str":"1729"}},"server":true,"wait":false}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":8,"chardev":"charchannel7","id":"channel7","name":"chardev-unix-listen"}'
\
+-chardev
'{"id":"charchannel8","backend":{"type":"socket","data":{"addr":{"type":"unix","data":{"path":"/path/to/unix-listen"}},"server":false,"reconnect":2}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":9,"chardev":"charchannel8","id":"channel8","name":"chardev-unix-connect"}'
\
+-chardev
'{"id":"charchannel9","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5678"}},"telnet":false,"server":true,"wait":false}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":10,"chardev":"charchannel9","id":"channel9","name":"chardev-tcp-listen-raw"}'
\
+-chardev
'{"id":"charchannel10","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5679"}},"telnet":true,"server":true,"wait":false}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":11,"chardev":"charchannel10","id":"channel10","name":"chardev-tcp-listen-telnet"}'
\
+-object
'{"qom-type":"tls-creds-x509","id":"objcharchannel11_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}'
\
+-chardev
'{"id":"charchannel11","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"1.2.3.4","port":"5678"}},"telnet":false,"server":false,"reconnect":2,"tls-creds":"objcharchannel11_tls0"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":12,"chardev":"charchannel11","id":"channel11","name":"chardev-tcp-connect-raw"}'
\
+-object
'{"qom-type":"tls-creds-x509","id":"objcharchannel12_tls0","dir":"/etc/pki/libvirt-chardev","endpoint":"client","verify-peer":true}'
\
+-chardev
'{"id":"charchannel12","backend":{"type":"socket","data":{"addr":{"type":"inet","data":{"host":"hostname.global.","port":"5679"}},"telnet":true,"server":false,"reconnect":2,"tls-creds":"objcharchannel12_tls0"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":13,"chardev":"charchannel12","id":"channel12","name":"chardev-tcp-connect-telnet"}'
\
+-chardev
'{"id":"charchannel13","backend":{"type":"udp","data":{"remote":{"type":"inet","data":{"host":"127.0.0.1","port":"2222"}}}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":14,"chardev":"charchannel13","id":"channel13","name":"chardev-udp-nobind"}'
\
+-chardev
'{"id":"charchannel14","backend":{"type":"udp","data":{"remote":{"type":"inet","data":{"host":"127.0.0.1","port":"2222"}},"local":{"type":"inet","data":{"host":"127.0.0.1","port":"1111"}}}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":15,"chardev":"charchannel14","id":"channel14","name":"chardev-udp-bind"}'
\
+-chardev
'{"id":"charchannel15","backend":{"type":"spicevmc","data":{"type":"vdagent"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":16,"chardev":"charchannel15","id":"channel15","name":"com.redhat.spice.0"}'
\
+-chardev
'{"id":"charchannel16","backend":{"type":"qemu-vdagent","data":{"clipboard":false,"mouse":false}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":17,"chardev":"charchannel16","id":"channel16","name":"chardev-vdagent"}'
\
+-chardev
'{"id":"charchannel17","backend":{"type":"dbus","data":{"name":"test.channel.0"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":18,"chardev":"charchannel17","id":"channel17","name":"chardev-dbus"}'
\
+-chardev
'{"id":"charchannel18","backend":{"type":"spiceport","data":{"fqdn":"test.channel.0"}}}'
\
+-device
'{"driver":"virtserialport","bus":"virtio-serial0.0","nr":19,"chardev":"charchannel18","id":"channel18","name":"chardev-spiceport"}'
\
+-audiodev
'{"id":"audio1","driver":"spice"}' \
+-spice port=5901,addr=0.0.0.0,seamless-migration=on \
+-device
'{"driver":"cirrus-vga","id":"video0","bus":"pci.0","addr":"0x2"}'
\
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.xml
b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.xml
new file mode 120000
index 0000000000..39fa243d0a
--- /dev/null
+++ b/tests/qemuxmlconfdata/chardev-backends-json.x86_64-latest.xml
@@ -0,0 +1 @@
+chardev-backends.x86_64-latest.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/chardev-backends-json.xml
b/tests/qemuxmlconfdata/chardev-backends-json.xml
new file mode 120000
index 0000000000..b6ebea2ae3
--- /dev/null
+++ b/tests/qemuxmlconfdata/chardev-backends-json.xml
@@ -0,0 +1 @@
+chardev-backends.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 914326bc3c..08dc8a10e3 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -1832,6 +1832,10 @@ mymain(void)
DO_TEST_CAPS_LATEST("console-compat-crash");
DO_TEST_CAPS_LATEST("chardev-backends");
+ /* As qemu doesn't yet support JSON syntax for -chardev we use the
+ * QEMU_CAPS_CHARDEV_JSON capability just in the tests to have QMP schema
+ * validation also for the QMP mode of the -chardev props generator */
+ DO_TEST_CAPS_ARCH_LATEST_FULL("chardev-backends-json", "x86_64",
ARG_QEMU_CAPS, QEMU_CAPS_CHARDEV_JSON, QEMU_CAPS_LAST);
DO_TEST_CAPS_LATEST("serial-vc-chardev");
DO_TEST_CAPS_LATEST("serial-pty-chardev");
--
2.46.0