edecca
From 0f5bad99762f92f7b7a0e65e68fbb83bad787a4a Mon Sep 17 00:00:00 2001
edecca
Message-Id: <0f5bad99762f92f7b7a0e65e68fbb83bad787a4a@dist-git>
edecca
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
edecca
Date: Tue, 28 Aug 2018 12:46:44 +0200
edecca
Subject: [PATCH] tests: qemu: test more versions for graphics-vnc-tls
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
Add a test with QEMU 2.4.0 capabilites, as well as the latest caps.
edecca
edecca
The code paths for formatting TLS options will be altered and
edecca
2.4.0 is the newest version where QEMU_CAPS_OBJECT_TLS_CREDS_X509
edecca
is not supported.
edecca
edecca
Signed-off-by: Ján Tomko <jtomko@redhat.com>
edecca
(cherry picked from commit 11b5396ceabe2ca91d8110f172f3ccf0d3901111)
edecca
Signed-off-by: Ján Tomko <jtomko@redhat.com>
edecca
edecca
https: //bugzilla.redhat.com/show_bug.cgi?id=1598167
edecca
Reviewed-by: Erik Skultety <eskultet@redhat.com>
edecca
---
edecca
 .../graphics-vnc-tls.x86_64-2.4.0.args        | 28 +++++++++++++++++
edecca
 .../graphics-vnc-tls.x86_64-latest.args       | 31 +++++++++++++++++++
edecca
 tests/qemuxml2argvtest.c                      |  2 ++
edecca
 3 files changed, 61 insertions(+)
edecca
 create mode 100644 tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-2.4.0.args
edecca
 create mode 100644 tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
edecca
edecca
diff --git a/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-2.4.0.args b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-2.4.0.args
edecca
new file mode 100644
edecca
index 0000000000..7b8e3a4aa6
edecca
--- /dev/null
edecca
+++ b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-2.4.0.args
edecca
@@ -0,0 +1,28 @@
edecca
+LC_ALL=C \
edecca
+PATH=/bin \
edecca
+HOME=/home/test \
edecca
+USER=test \
edecca
+LOGNAME=test \
edecca
+SASL_CONF_PATH=/root/.sasl2 \
edecca
+QEMU_AUDIO_DRV=none \
edecca
+/usr/bin/qemu-system-i686 \
edecca
+-name guest=QEMUGuest1,debug-threads=on \
edecca
+-S \
edecca
+-machine pc-i440fx-2.4,accel=tcg,usb=off,dump-guest-core=off \
edecca
+-m 214 \
edecca
+-realtime mlock=off \
edecca
+-smp 1,sockets=1,cores=1,threads=1 \
edecca
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
edecca
+-no-user-config \
edecca
+-nodefaults \
edecca
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
edecca
+server,nowait \
edecca
+-mon chardev=charmonitor,id=monitor,mode=control \
edecca
+-rtc base=utc \
edecca
+-no-shutdown \
edecca
+-no-acpi \
edecca
+-boot strict=on \
edecca
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
edecca
+-vnc 127.0.0.1:3,tls,x509verify=/etc/pki/libvirt-vnc,sasl \
edecca
+-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
edecca
+-msg timestamp=on
edecca
diff --git a/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
edecca
new file mode 100644
edecca
index 0000000000..01743eff2a
edecca
--- /dev/null
edecca
+++ b/tests/qemuxml2argvdata/graphics-vnc-tls.x86_64-latest.args
edecca
@@ -0,0 +1,31 @@
edecca
+LC_ALL=C \
edecca
+PATH=/bin \
edecca
+HOME=/home/test \
edecca
+USER=test \
edecca
+LOGNAME=test \
edecca
+SASL_CONF_PATH=/root/.sasl2 \
edecca
+QEMU_AUDIO_DRV=none \
edecca
+/usr/bin/qemu-system-i686 \
edecca
+-name guest=QEMUGuest1,debug-threads=on \
edecca
+-S \
edecca
+-object secret,id=masterKey0,format=raw,\
edecca
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
edecca
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
edecca
+-m 214 \
edecca
+-realtime mlock=off \
edecca
+-smp 1,sockets=1,cores=1,threads=1 \
edecca
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
edecca
+-no-user-config \
edecca
+-nodefaults \
edecca
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
edecca
+-mon chardev=charmonitor,id=monitor,mode=control \
edecca
+-rtc base=utc \
edecca
+-no-shutdown \
edecca
+-no-acpi \
edecca
+-boot strict=on \
edecca
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
edecca
+-vnc 127.0.0.1:3,tls,x509verify=/etc/pki/libvirt-vnc,sasl \
edecca
+-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
edecca
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
edecca
+resourcecontrol=deny \
edecca
+-msg timestamp=on
edecca
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
edecca
index 02bb9889ee..608a2b6ce3 100644
edecca
--- a/tests/qemuxml2argvtest.c
edecca
+++ b/tests/qemuxml2argvtest.c
edecca
@@ -1207,6 +1207,8 @@ mymain(void)
edecca
     driver.config->vncTLS = 1;
edecca
     driver.config->vncTLSx509verify = 1;
edecca
     DO_TEST("graphics-vnc-tls", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
edecca
+    DO_TEST_CAPS_VER("graphics-vnc-tls", "2.4.0");
edecca
+    DO_TEST_CAPS_LATEST("graphics-vnc-tls");
edecca
     driver.config->vncSASL = driver.config->vncTLSx509verify = driver.config->vncTLS = 0;
edecca
     VIR_FREE(driver.config->vncSASLdir);
edecca
     VIR_FREE(driver.config->vncTLSx509certdir);
edecca
-- 
edecca
2.18.0
edecca