]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: qemuxml2argv: Test TLS certificate path containing a comma
authorPeter Krempa <pkrempa@redhat.com>
Thu, 17 May 2018 08:16:48 +0000 (10:16 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 18 May 2018 06:59:57 +0000 (08:59 +0200)
We have to escape commas when formatting them on the command line. Add a
test case of a TLS path containing a comma.

Note that the output is wrong, this test case is to prove there's a bug.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args
tests/qemuxml2argvtest.c

index 2e747392bebe63517aac83d09378b92d8d7fbda0..a2b4d2bcbd142063ca340fd47ec15ec30161d17a 100644 (file)
@@ -23,16 +23,16 @@ server,nowait \
 -no-acpi \
 -boot c \
 -usb \
--object tls-creds-x509,id=objvirtio-disk0_tls0,dir=/etc/pki/libvirt-vxhs,\
-endpoint=client,verify-peer=yes \
+-object tls-creds-x509,id=objvirtio-disk0_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
+,,,path,endpoint=client,verify-peer=yes \
 -drive file.driver=vxhs,file.tls-creds=objvirtio-disk0_tls0,\
 file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
 file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
 id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \
 -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
 id=virtio-disk0 \
--object tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs,\
-endpoint=client,verify-peer=yes \
+-object tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
+,,,path,endpoint=client,verify-peer=yes \
 -drive file.driver=vxhs,file.tls-creds=objvirtio-disk1_tls0,\
 file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc252,\
 file.server.host=192.168.0.2,file.server.port=9999,format=raw,if=none,\
index 07e5ba1d13afba7b33dc00accb0cf28c5e94162e..78454acb1a412dfeb3e24609831417fef32eeb77 100644 (file)
@@ -639,7 +639,7 @@ mymain(void)
     if (VIR_STRDUP_QUIET(driver.config->chardevTLSx509certdir, "/etc/pki/libvirt-chardev") < 0)
         return EXIT_FAILURE;
     VIR_FREE(driver.config->vxhsTLSx509certdir);
-    if (VIR_STRDUP_QUIET(driver.config->vxhsTLSx509certdir, "/etc/pki/libvirt-vxhs") < 0)
+    if (VIR_STRDUP_QUIET(driver.config->vxhsTLSx509certdir, "/etc/pki/libvirt-vxhs/dummy,path") < 0)
         return EXIT_FAILURE;
 
     VIR_FREE(driver.config->hugetlbfs);