[PATCH 35/35] tests: qemublock: Test handling of block devices

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

 



Make sure that 'host_device' is generated for type='block'.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/qemublocktest.c                                  |  2 ++
 tests/qemublocktestdata/xml2json/block-raw-noopts.json | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/block-raw-noopts.xml  | 12 ++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 tests/qemublocktestdata/xml2json/block-raw-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/block-raw-noopts.xml

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index a888eab524..08f165d7e0 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -478,6 +478,8 @@ mymain(void)
     TEST_DISK_TO_JSON("network-qcow2-backing-chain-cache-unsafe");
     TEST_DISK_TO_JSON("dir-fat-cache");

+    TEST_DISK_TO_JSON("block-raw-noopts");
+
  cleanup:
     virHashFree(diskxmljsondata.schema);
     qemuTestDriverFree(&driver);
diff --git a/tests/qemublocktestdata/xml2json/block-raw-noopts.json b/tests/qemublocktestdata/xml2json/block-raw-noopts.json
new file mode 100644
index 0000000000..25bf77d5aa
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/block-raw-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "0123456789ABCDEF0123456789ABCDE",
+  "read-only": false,
+  "driver": "raw",
+  "file": {
+    "driver": "host_device",
+    "filename": "/dev/blah",
+    "node-name": "0123456789ABCDEF0123456789ABCDE",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/block-raw-noopts.xml b/tests/qemublocktestdata/xml2json/block-raw-noopts.xml
new file mode 100644
index 0000000000..2f319d26d0
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/block-raw-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk' type='block'>
+  <driver name='qemu' type='raw'/>
+  <source dev='/dev/blah'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
+        <nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
-- 
2.16.2

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



[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