]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: qemublock: Add testing of pure disk source specification JSON generator
authorPeter Krempa <pkrempa@redhat.com>
Mon, 17 Dec 2018 15:29:05 +0000 (16:29 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 18 Jul 2019 15:59:34 +0000 (17:59 +0200)
Add testing of the host specification part so that we can be sure that
no image/host specific data will be present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
33 files changed:
tests/qemublocktest.c
tests/qemublocktestdata/xml2json/block-raw-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/block-raw-reservations-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/dir-fat-cache-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/dir-fat-floppy-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/dir-fat-readonly-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-cache-none-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-detect-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-backing_basic-unmap-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-bochs-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-cloop-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-dmg-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-ploop-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-raw-aio_native-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-raw-luks-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-raw-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-vdi-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-vhd-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/file-vpc-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/network-nbd-tls-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth-srconly.json [new file with mode: 0644]

index 29ce27021f69d7d81d0ee540e482658759d05c2a..e5ed52e19b8583c248b8c8813e8a7e194a9edf9b 100644 (file)
@@ -115,6 +115,9 @@ struct testQemuDiskXMLToJSONData {
     virJSONValuePtr *props;
     size_t nprops;
 
+    virJSONValuePtr *propssrc;
+    size_t npropssrc;
+
     virQEMUCapsPtr qemuCaps;
 };
 
@@ -127,8 +130,13 @@ testQemuDiskXMLToPropsClear(struct testQemuDiskXMLToJSONData *data)
     for (i = 0; i < data->nprops; i++)
         virJSONValueFree(data->props[i]);
 
+    for (i = 0; i < data->npropssrc; i++)
+        virJSONValueFree(data->propssrc[i]);
+
     data->nprops = 0;
     VIR_FREE(data->props);
+    data->npropssrc = 0;
+    VIR_FREE(data->propssrc);
 }
 
 
@@ -180,6 +188,7 @@ testQemuDiskXMLToProps(const void *opaque)
     virStorageSourcePtr n;
     virJSONValuePtr formatProps = NULL;
     virJSONValuePtr storageProps = NULL;
+    VIR_AUTOPTR(virJSONValue) storageSrcOnlyProps = NULL;
     char *xmlpath = NULL;
     char *xmlstr = NULL;
     int ret = -1;
@@ -213,6 +222,7 @@ testQemuDiskXMLToProps(const void *opaque)
             goto cleanup;
 
         if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n)) ||
+            !(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, false, true)) ||
             !(storageProps = qemuBlockStorageSourceGetBackendProps(n, false, false))) {
             if (!data->fail) {
                 VIR_TEST_VERBOSE("failed to generate qemu blockdev props\n");
@@ -224,7 +234,8 @@ testQemuDiskXMLToProps(const void *opaque)
         }
 
         if (VIR_APPEND_ELEMENT(data->props, data->nprops, formatProps) < 0 ||
-            VIR_APPEND_ELEMENT(data->props, data->nprops, storageProps) < 0)
+            VIR_APPEND_ELEMENT(data->props, data->nprops, storageProps) < 0 ||
+            VIR_APPEND_ELEMENT(data->propssrc, data->npropssrc, storageSrcOnlyProps) < 0)
             goto cleanup;
     }
 
@@ -268,6 +279,23 @@ testQemuDiskXMLToPropsValidateSchema(const void *opaque)
 
         virBufferFreeAndReset(&debug);
     }
+
+    for (i = 0; i < data->npropssrc; i++) {
+        if (testQEMUSchemaValidate(data->propssrc[i], data->schemaroot,
+                                   data->schema, &debug) < 0) {
+            debugmsg = virBufferContentAndReset(&debug);
+            propsstr = virJSONValueToString(data->propssrc[i], true);
+            VIR_TEST_VERBOSE("json does not conform to QAPI schema");
+            VIR_TEST_DEBUG("json:\n%s\ndoes not match schema. Debug output:\n %s",
+                           propsstr, NULLSTR(debugmsg));
+            VIR_FREE(debugmsg);
+            VIR_FREE(propsstr);
+            ret = -1;
+        }
+
+        virBufferFreeAndReset(&debug);
+    }
+
     return ret;
 }
 
@@ -313,6 +341,40 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque)
 }
 
 
+static int
+testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque)
+{
+    struct testQemuDiskXMLToJSONData *data = (void *) opaque;
+    VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
+    VIR_AUTOFREE(char *) jsonpath = NULL;
+    VIR_AUTOFREE(char *) actual = NULL;
+    size_t i;
+
+    if (data->fail)
+        return EXIT_AM_SKIP;
+
+    if (virAsprintf(&jsonpath, "%s%s-srconly.json",
+                    testQemuDiskXMLToJSONPath, data->name) < 0)
+        return -1;
+
+    for (i = 0; i < data->npropssrc; i++) {
+        VIR_AUTOFREE(char *) jsonstr = NULL;
+
+        if (!(jsonstr = virJSONValueToString(data->propssrc[i], true)))
+            return -1;
+
+        virBufferAdd(&buf, jsonstr, -1);
+    }
+
+    if (virBufferCheckError(&buf) < 0)
+        return -1;
+
+    actual = virBufferContentAndReset(&buf);
+
+    return virTestCompareToFile(actual, jsonpath);
+}
+
+
 static int
 mymain(void)
 {
@@ -411,6 +473,8 @@ mymain(void)
         diskxmljsondata.name = nme; \
         diskxmljsondata.props = NULL; \
         diskxmljsondata.nprops = 0; \
+        diskxmljsondata.propssrc = NULL; \
+        diskxmljsondata.npropssrc = 0; \
         diskxmljsondata.fail = fl; \
         if (virTestRun("disk xml to props " nme, testQemuDiskXMLToProps, \
                        &diskxmljsondata) < 0) \
@@ -421,6 +485,9 @@ mymain(void)
         if (virTestRun("disk xml to props validate file " nme, \
                        testQemuDiskXMLToPropsValidateFile,  &diskxmljsondata) < 0) \
             ret = -1; \
+        if (virTestRun("disk xml to props source only validate file " nme, \
+                       testQemuDiskXMLToPropsValidateFileSrcOnly,  &diskxmljsondata) < 0) \
+            ret = -1; \
         testQemuDiskXMLToPropsClear(&diskxmljsondata); \
     } while (0)
 
diff --git a/tests/qemublocktestdata/xml2json/block-raw-noopts-srconly.json b/tests/qemublocktestdata/xml2json/block-raw-noopts-srconly.json
new file mode 100644 (file)
index 0000000..72f9067
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "host_device",
+  "filename": "/dev/blah"
+}
diff --git a/tests/qemublocktestdata/xml2json/block-raw-reservations-srconly.json b/tests/qemublocktestdata/xml2json/block-raw-reservations-srconly.json
new file mode 100644 (file)
index 0000000..72f9067
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "host_device",
+  "filename": "/dev/blah"
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-cache-srconly.json b/tests/qemublocktestdata/xml2json/dir-fat-cache-srconly.json
new file mode 100644 (file)
index 0000000..6ec4f78
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "driver": "vvfat",
+  "dir": "/var/somefiles",
+  "floppy": false
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-floppy-srconly.json b/tests/qemublocktestdata/xml2json/dir-fat-floppy-srconly.json
new file mode 100644 (file)
index 0000000..6b0388b
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "driver": "vvfat",
+  "dir": "/var/somefiles",
+  "floppy": true
+}
diff --git a/tests/qemublocktestdata/xml2json/dir-fat-readonly-srconly.json b/tests/qemublocktestdata/xml2json/dir-fat-readonly-srconly.json
new file mode 100644 (file)
index 0000000..6ec4f78
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "driver": "vvfat",
+  "dir": "/var/somefiles",
+  "floppy": false
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-aio_threads-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-directsync-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-none-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-unsafe-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writeback-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-cache-writethrough-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-detect-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-detect-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts-srconly.json
new file mode 100644 (file)
index 0000000..dbdf6e5
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/c"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-detect-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-ignore-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-srconly.json b/tests/qemublocktestdata/xml2json/file-backing_basic-unmap-srconly.json
new file mode 100644 (file)
index 0000000..ea490b0
--- /dev/null
@@ -0,0 +1,24 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
+{
+  "driver": "gluster",
+  "volume": "images",
+  "path": "c",
+  "server": [
+    {
+      "type": "inet",
+      "host": "test.org",
+      "port": "24007"
+    }
+  ]
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/d"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-bochs-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-bochs-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-cloop-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-cloop-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-dmg-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-dmg-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-ploop-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-ploop-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption-srconly.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption-srconly.json
new file mode 100644 (file)
index 0000000..316dbc9
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/a"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/b"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts-srconly.json
new file mode 100644 (file)
index 0000000..d998acc
--- /dev/null
@@ -0,0 +1,40 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1507297895"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1484071872"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483615252"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483605924"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483605920"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483546244"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483545901"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483545313"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1483536402"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.qcow2"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated-srconly.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated-srconly.json
new file mode 100644 (file)
index 0000000..e0bce3b
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1507297895"
+}
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/rhel7.3.1484071872"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native-srconly.json b/tests/qemublocktestdata/xml2json/file-raw-aio_native-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-luks-srconly.json b/tests/qemublocktestdata/xml2json/file-raw-luks-srconly.json
new file mode 100644 (file)
index 0000000..6d70882
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/luks.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-raw-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-raw-noopts-srconly.json
new file mode 100644 (file)
index 0000000..bb3e8af
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/var/lib/libvirt/images/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vdi-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-vdi-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vhd-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-vhd-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vpc-noopts-srconly.json b/tests/qemublocktestdata/xml2json/file-vpc-noopts-srconly.json
new file mode 100644 (file)
index 0000000..c50fa90
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "driver": "file",
+  "filename": "/path/to/i.img"
+}
diff --git a/tests/qemublocktestdata/xml2json/network-nbd-tls-srconly.json b/tests/qemublocktestdata/xml2json/network-nbd-tls-srconly.json
new file mode 100644 (file)
index 0000000..455f4e5
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "driver": "nbd",
+  "server": {
+    "type": "inet",
+    "host": "host1.example.com",
+    "port": "10809"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe-srconly.json b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-cache-unsafe-srconly.json
new file mode 100644 (file)
index 0000000..69ca9ca
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "driver": "rbd",
+  "pool": "rbdpool",
+  "image": "rbdimg",
+  "server": [
+    {
+      "host": "host1.example.com",
+      "port": "0"
+    },
+    {
+      "host": "host2.example.com",
+      "port": "0"
+    }
+  ]
+}
+{
+  "driver": "iscsi",
+  "portal": "example.org:3260",
+  "target": "iscsitarget",
+  "lun": 1,
+  "transport": "tcp"
+}
diff --git a/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth-srconly.json b/tests/qemublocktestdata/xml2json/network-qcow2-backing-chain-encryption_auth-srconly.json
new file mode 100644 (file)
index 0000000..6298329
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "driver": "rbd",
+  "pool": "rbdpool",
+  "image": "rbdimg",
+  "server": [
+    {
+      "host": "host1.example.com",
+      "port": "0"
+    },
+    {
+      "host": "host2.example.com",
+      "port": "0"
+    }
+  ]
+}
+{
+  "driver": "iscsi",
+  "portal": "example.org:3260",
+  "target": "iqn.2016-09.com.example:iscsitarget",
+  "lun": 1,
+  "transport": "tcp"
+}