[PATCH 2/4] tests: qemuxml2argv: Test TLS certificate path containing a comma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args | 8 ++++----
 tests/qemuxml2argvtest.c                                    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args b/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args
index 2e747392be..a2b4d2bcbd 100644
--- a/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args
+++ b/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args
@@ -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,\
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 07e5ba1d13..78454acb1a 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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);
-- 
2.16.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux