[PATCH 02/14] qemublocktest: xml->json: Add test for NVMe

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

 



Based on the configuration from the only qemuxml2argv test.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/qemublocktest.c                              |  2 ++
 .../xml2json/nvme-raw-noopts-srconly.json          |  5 +++++
 .../xml2json/nvme-raw-noopts.json                  | 14 ++++++++++++++
 .../qemublocktestdata/xml2json/nvme-raw-noopts.xml | 13 +++++++++++++
 4 files changed, 34 insertions(+)
 create mode 100644 tests/qemublocktestdata/xml2json/nvme-raw-noopts-srconly.json
 create mode 100644 tests/qemublocktestdata/xml2json/nvme-raw-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/nvme-raw-noopts.xml

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index fca8939fbb..4c3e05b6b5 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -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
index 0000000000..ed55c08cbf
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/nvme-raw-noopts-srconly.json
@@ -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
index 0000000000..e18e96099c
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/nvme-raw-noopts.json
@@ -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
index 0000000000..1e4dbd6e56
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/nvme-raw-noopts.xml
@@ -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>
-- 
2.24.1





[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