From 573def3a3fed94960dab198aebdb1175db726f07 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 2 Mar 2023 20:23:37 +0100 Subject: [PATCH] tests: Limit use of SPICE TLS Follow the example of other similar settings and only enable it for the few test cases that are actually about the specific functionality, disabling it immediately afterwards. A few test cases that were completely unrelated to SPICE TLS no longer see the effects of having the feature enabled. Signed-off-by: Andrea Bolognani Reviewed-by: Martin Kletzander --- tests/qemuxml2argvdata/controller-order.args | 2 +- .../q35-virt-manager-basic.x86_64-4.2.0.args | 2 +- .../q35-virt-manager-basic.x86_64-latest.args | 2 +- tests/qemuxml2argvtest.c | 10 +++++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args index 242639591c..cc45b1f946 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -43,7 +43,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-fdr/.config \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1.2 \ -audiodev '{"id":"audio1","driver":"spice"}' \ --spice port=5901,tls-port=5902,addr=0.0.0.0,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \ +-spice port=5901,addr=0.0.0.0,seamless-migration=on \ -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \ -device intel-hda,id=sound0,bus=pci.0,addr=0x4 \ -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0,audiodev=audio1 \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args index 042f965183..86da1e46ab 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-4.2.0.args @@ -49,7 +49,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-virt-manager-basic/.config \ -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \ -audiodev '{"id":"audio1","driver":"spice"}' \ --spice port=5901,tls-port=5902,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,image-compression=off,seamless-migration=on \ +-spice port=5901,addr=127.0.0.1,image-compression=off,seamless-migration=on \ -device qxl-vga,id=video0,max_outputs=1,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,bus=pcie.0,addr=0x1 \ -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b \ -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0,audiodev=audio1 \ diff --git a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args index e659f0bd34..c9f93006cd 100644 --- a/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args +++ b/tests/qemuxml2argvdata/q35-virt-manager-basic.x86_64-latest.args @@ -49,7 +49,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-virt-manager-basic/.config \ -device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":2,"chardev":"charchannel1","id":"channel1","name":"com.redhat.spice.0"}' \ -device '{"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"}' \ -audiodev '{"id":"audio1","driver":"spice"}' \ --spice port=5901,tls-port=5902,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,image-compression=off,seamless-migration=on \ +-spice port=5901,addr=127.0.0.1,image-compression=off,seamless-migration=on \ -device '{"driver":"qxl-vga","id":"video0","max_outputs":1,"ram_size":67108864,"vram_size":67108864,"vram64_size_mb":0,"vgamem_mb":16,"bus":"pcie.0","addr":"0x1"}' \ -device '{"driver":"ich9-intel-hda","id":"sound0","bus":"pcie.0","addr":"0x1b"}' \ -device '{"driver":"hda-duplex","id":"sound0-codec0","bus":"sound0.0","cad":0,"audiodev":"audio1"}' \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 86a18c87d7..888b535934 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -858,7 +858,6 @@ mymain(void) driver.config->hugetlbfs[0].size = 2048; driver.config->hugetlbfs[0].deflt = true; driver.config->hugetlbfs[1].size = 1048576; - driver.config->spiceTLS = 1; driver.config->spicePassword = g_strdup("123456"); VIR_FREE(driver.config->memoryBackingDir); driver.config->memoryBackingDir = g_strdup("/var/lib/libvirt/qemu/ram"); @@ -1404,6 +1403,8 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("graphics-sdl-egl-headless"); DO_TEST("graphics-sdl-fullscreen", QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_SDL); + + driver.config->spiceTLS = 1; DO_TEST_CAPS_LATEST("graphics-spice"); DO_TEST_CAPS_LATEST("graphics-spice-no-args"); driver.config->spiceSASL = 1; @@ -1423,6 +1424,7 @@ mymain(void) DO_TEST_CAPS_LATEST("graphics-spice-egl-headless"); DO_TEST_CAPS_LATEST_PARSE_ERROR("graphics-spice-invalid-egl-headless"); DO_TEST_CAPS_LATEST("graphics-spice-gl-auto-rendernode"); + driver.config->spiceTLS = 0; DO_TEST("graphics-dbus", QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_DISPLAY_DBUS); @@ -1505,10 +1507,12 @@ mymain(void) DO_TEST("serial-file-log", QEMU_CAPS_DEVICE_ISA_SERIAL); + driver.config->spiceTLS = 1; DO_TEST("serial-spiceport", QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_ISA_SERIAL); + driver.config->spiceTLS = 0; DO_TEST("console-compat", QEMU_CAPS_DEVICE_ISA_SERIAL); @@ -1528,7 +1532,9 @@ mymain(void) DO_TEST("serial-unix-chardev", QEMU_CAPS_DEVICE_ISA_SERIAL); DO_TEST_CAPS_LATEST("serial-file-log"); + driver.config->spiceTLS = 1; DO_TEST_CAPS_LATEST("serial-spiceport"); + driver.config->spiceTLS = 0; DO_TEST_CAPS_LATEST("serial-debugcon"); DO_TEST_CAPS_LATEST("console-compat"); @@ -1597,9 +1603,11 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("console-virtio-ccw", "s390x"); DO_TEST_CAPS_LATEST("console-virtio-unix"); DO_TEST_CAPS_ARCH_LATEST("console-sclp", "s390x"); + driver.config->spiceTLS = 1; DO_TEST("channel-spicevmc", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); + driver.config->spiceTLS = 0; DO_TEST_CAPS_LATEST("channel-qemu-vdagent"); DO_TEST_CAPS_LATEST("channel-qemu-vdagent-features"); DO_TEST("channel-virtio-default",