[libvirt] [PATCH v5 8/9] Add a test case to verify setting vxhs_tls=0 disables TLS for VxHS disks

Ashish Mittal posted 9 patches 8 years, 3 months ago
There is a newer version of this series
[libvirt] [PATCH v5 8/9] Add a test case to verify setting vxhs_tls=0 disables TLS for VxHS disks
Posted by Ashish Mittal 8 years, 3 months ago
Add a test case to verify that if vxhs_tls is disabled in qemu.conf
then adding "tls=yes" in the domain XML generates an error.

Signed-off-by: Ashish Mittal <Ashish.Mittal@veritas.com>
---
 ...ml2argv-disk-drive-network-tlsx509-err-vxhs.xml | 34 ++++++++++++++++++++++
 tests/qemuxml2argvtest.c                           |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml
new file mode 100644
index 0000000..951ad4e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <disk type='network' device='disk'>
+      <driver name='qemu' type='raw' cache='none'/>
+      <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251' tls='yes'>
+        <host name='192.168.0.1' port='9999'/>
+      </source>
+      <backingStore/>
+      <target dev='vda' bus='virtio'/>
+      <serial>eb90327c-8302-4725-9e1b-4e85ed4dc251</serial>
+      <alias name='virtio-disk0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 57b838d..d9723c4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -932,6 +932,8 @@ mymain(void)
     DO_TEST("disk-drive-network-rbd-ipv6", NONE);
     DO_TEST_FAILURE("disk-drive-network-rbd-no-colon", NONE);
     DO_TEST("disk-drive-network-vxhs", NONE);
+    DO_TEST_FAILURE("disk-drive-network-tlsx509-err-vxhs",
+                     QEMU_CAPS_OBJECT_TLS_CREDS_X509);
     driver.config->vxhsTLS = 1;
     DO_TEST("disk-drive-network-tlsx509-vxhs",
             QEMU_CAPS_OBJECT_TLS_CREDS_X509);
-- 
2.5.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 8/9] Add a test case to verify setting vxhs_tls=0 disables TLS for VxHS disks
Posted by John Ferlan 8 years, 3 months ago

On 08/29/2017 02:39 AM, Ashish Mittal wrote:
> Add a test case to verify that if vxhs_tls is disabled in qemu.conf
> then adding "tls=yes" in the domain XML generates an error.
> 
> Signed-off-by: Ashish Mittal <Ashish.Mittal@veritas.com>
> ---
>  ...ml2argv-disk-drive-network-tlsx509-err-vxhs.xml | 34 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  2 ++
>  2 files changed, 36 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml
> 

While this works as advertised, I'm not clear why it matters.  It's
something we can talk about/debate once I repost the series. I'll leave
it in the next posting, but I'm not sure it's desired.

John

> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml
> new file mode 100644
> index 0000000..951ad4e
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-tlsx509-err-vxhs.xml
> @@ -0,0 +1,34 @@
> +<domain type='qemu'>
> +  <name>QEMUGuest1</name>
> +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> +  <memory unit='KiB'>219136</memory>
> +  <currentMemory unit='KiB'>219136</currentMemory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='i686' machine='pc'>hvm</type>
> +    <boot dev='hd'/>
> +  </os>
> +  <clock offset='utc'/>
> +  <on_poweroff>destroy</on_poweroff>
> +  <on_reboot>restart</on_reboot>
> +  <on_crash>destroy</on_crash>
> +  <devices>
> +    <emulator>/usr/bin/qemu-system-x86_64</emulator>
> +    <disk type='network' device='disk'>
> +      <driver name='qemu' type='raw' cache='none'/>
> +      <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251' tls='yes'>
> +        <host name='192.168.0.1' port='9999'/>
> +      </source>
> +      <backingStore/>
> +      <target dev='vda' bus='virtio'/>
> +      <serial>eb90327c-8302-4725-9e1b-4e85ed4dc251</serial>
> +      <alias name='virtio-disk0'/>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
> +    </disk>
> +    <controller type='usb' index='0'/>
> +    <controller type='pci' index='0' model='pci-root'/>
> +    <input type='mouse' bus='ps2'/>
> +    <input type='keyboard' bus='ps2'/>
> +    <memballoon model='none'/>
> +  </devices>
> +</domain>
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index 57b838d..d9723c4 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -932,6 +932,8 @@ mymain(void)
>      DO_TEST("disk-drive-network-rbd-ipv6", NONE);
>      DO_TEST_FAILURE("disk-drive-network-rbd-no-colon", NONE);
>      DO_TEST("disk-drive-network-vxhs", NONE);
> +    DO_TEST_FAILURE("disk-drive-network-tlsx509-err-vxhs",
> +                     QEMU_CAPS_OBJECT_TLS_CREDS_X509);
>      driver.config->vxhsTLS = 1;
>      DO_TEST("disk-drive-network-tlsx509-vxhs",
>              QEMU_CAPS_OBJECT_TLS_CREDS_X509);
> 

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