]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemublocktest: xml->json: Add test for NVMe
authorPeter Krempa <pkrempa@redhat.com>
Wed, 18 Mar 2020 17:49:10 +0000 (18:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 24 Mar 2020 13:17:47 +0000 (14:17 +0100)
Based on the configuration from the only qemuxml2argv test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/qemublocktest.c
tests/qemublocktestdata/xml2json/nvme-raw-noopts-srconly.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/nvme-raw-noopts.json [new file with mode: 0644]
tests/qemublocktestdata/xml2json/nvme-raw-noopts.xml [new file with mode: 0644]

index fca8939fbb93527faaccbe211b67727cc8f5da3e..4c3e05b6b5f0cbd4dba7e39ee946c92079e6f7c5 100644 (file)
@@ -1203,6 +1203,8 @@ mymain(void)
     TEST_DISK_TO_JSON("block-raw-noopts");
     TEST_DISK_TO_JSON("block-raw-reservations");
 
+    TEST_DISK_TO_JSON("nvme-raw-noopts");
+
 #define TEST_JSON_TO_JSON(nme) \
     do { \
         jsontojsondata.name = nme; \
diff --git a/tests/qemublocktestdata/xml2json/nvme-raw-noopts-srconly.json b/tests/qemublocktestdata/xml2json/nvme-raw-noopts-srconly.json
new file mode 100644 (file)
index 0000000..ed55c08
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "driver": "nvme",
+  "device": "0000:01:00.0",
+  "namespace": 1
+}
diff --git a/tests/qemublocktestdata/xml2json/nvme-raw-noopts.json b/tests/qemublocktestdata/xml2json/nvme-raw-noopts.json
new file mode 100644 (file)
index 0000000..e18e960
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "node-name": "0123456789ABCDEF0123456789ABCDE",
+  "read-only": false,
+  "driver": "raw",
+  "file": "0123456789ABCDEF0123456789ABCDE"
+}
+{
+  "driver": "nvme",
+  "device": "0000:01:00.0",
+  "namespace": 1,
+  "node-name": "0123456789ABCDEF0123456789ABCDE",
+  "auto-read-only": true,
+  "discard": "unmap"
+}
diff --git a/tests/qemublocktestdata/xml2json/nvme-raw-noopts.xml b/tests/qemublocktestdata/xml2json/nvme-raw-noopts.xml
new file mode 100644 (file)
index 0000000..1e4dbd6
--- /dev/null
@@ -0,0 +1,13 @@
+<disk type='nvme' device='disk'>
+  <driver name='qemu' type='raw'/>
+  <source type='pci' managed='yes' namespace='1'>
+    <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
+        <nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda' bus='virtio'/>
+</disk>