[libvirt] [PATCH v2 3/3] tests: qemublock: Test NBD with TLS in the JSON generator

Peter Krempa pkrempa at redhat.com
Thu May 31 18:51:14 UTC 2018


Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/qemublocktest.c                                 |  1 +
 tests/qemublocktestdata/xml2json/network-nbd-tls.json | 19 +++++++++++++++++++
 tests/qemublocktestdata/xml2json/network-nbd-tls.xml  | 18 ++++++++++++++++++
 3 files changed, 38 insertions(+)
 create mode 100644 tests/qemublocktestdata/xml2json/network-nbd-tls.json
 create mode 100644 tests/qemublocktestdata/xml2json/network-nbd-tls.xml

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index d0cd834b05..0c335abc5b 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -486,6 +486,7 @@ mymain(void)
     TEST_DISK_TO_JSON("file-backing_basic-cache-unsafe");
     TEST_DISK_TO_JSON("network-qcow2-backing-chain-cache-unsafe");
     TEST_DISK_TO_JSON("dir-fat-cache");
+    TEST_DISK_TO_JSON("network-nbd-tls");

     TEST_DISK_TO_JSON("block-raw-noopts");
     TEST_DISK_TO_JSON("block-raw-reservations");
diff --git a/tests/qemublocktestdata/xml2json/network-nbd-tls.json b/tests/qemublocktestdata/xml2json/network-nbd-tls.json
new file mode 100644
index 0000000000..a1529a6c44
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/network-nbd-tls.json
@@ -0,0 +1,19 @@
+{
+  "node-name": "node-b-f",
+  "read-only": false,
+  "driver": "qcow2",
+  "file": "node-a-s",
+  "backing": null
+}
+{
+  "driver": "nbd",
+  "server": {
+    "type": "inet",
+    "host": "host1.example.com",
+    "port": "10809"
+  },
+  "tls-creds": "node-a-s-tls0",
+  "node-name": "node-a-s",
+  "read-only": false,
+  "discard": "unmap"
+}
diff --git a/tests/qemublocktestdata/xml2json/network-nbd-tls.xml b/tests/qemublocktestdata/xml2json/network-nbd-tls.xml
new file mode 100644
index 0000000000..1330a5acc7
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/network-nbd-tls.xml
@@ -0,0 +1,18 @@
+<disk type='network' device='disk'>
+  <driver name='qemu' type='qcow2'/>
+  <source protocol='nbd' tls='yes'>
+    <host name='host1.example.com'/>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='node-a-s'/>
+        <nodename type='format' name='node-b-f'/>
+      </nodenames>
+      <objects>
+        <TLSx509 alias='node-a-s-tls0'/>
+      </objects>
+    </privateData>
+  </source>
+  <backingStore/>
+  <target dev='vda' bus='virtio'/>
+  <alias name='virtio-disk0'/>
+</disk>
-- 
2.16.2




More information about the libvir-list mailing list