[PATCH 26/35] tests: qemublock: Add tests for all other format without special options

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

 



Similarly to the 'raw' case add tests for bochs, cloop, dmg, ploop, vdi
vhd, and vpc. Covering all supproted non-backing formats.

Note that the JSON name for 'ploop' maps to 'parallels' and 'vhd' maps
to 'vhdx'.

Files added here would result in the followint configs:

file-bochs-noopts.xml:
-drive file=/path/to/i.img,format=bochs,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-cloop-noopts.xml:
-drive file=/path/to/i.img,format=cloop,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-dmg-noopts.xml:
-drive file=/path/to/i.img,format=dmg,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-ploop-noopts.xml:
-drive file=/path/to/i.img,format=ploop,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vdi-noopts.xml:
-drive file=/path/to/i.img,format=vdi,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vhd-noopts.xml:
-drive file=/path/to/i.img,format=vhd,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-vpc-noopts.xml:
-drive file=/path/to/i.img,format=vpc,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/qemublocktest.c                                   |  7 +++++++
 tests/qemublocktestdata/xml2json/file-bochs-noopts.json | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-bochs-noopts.xml  | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-cloop-noopts.json | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-cloop-noopts.xml  | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-dmg-noopts.json   | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-dmg-noopts.xml    | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-ploop-noopts.json | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-ploop-noopts.xml  | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vdi-noopts.json   | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vdi-noopts.xml    | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vhd-noopts.json   | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vhd-noopts.xml    | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vpc-noopts.json   | 12 ++++++++++++
 tests/qemublocktestdata/xml2json/file-vpc-noopts.xml    | 12 ++++++++++++
 15 files changed, 175 insertions(+)
 create mode 100644 tests/qemublocktestdata/xml2json/file-bochs-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-bochs-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-cloop-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-cloop-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-dmg-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-dmg-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-ploop-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-ploop-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-vdi-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-vdi-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-vhd-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-vhd-noopts.xml
 create mode 100644 tests/qemublocktestdata/xml2json/file-vpc-noopts.json
 create mode 100644 tests/qemublocktestdata/xml2json/file-vpc-noopts.xml

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index c9a2f91992..feb25c69e3 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -405,6 +405,13 @@ mymain(void)
     TEST_DISK_TO_JSON_FULL("nodename-long-protocol", true);

     TEST_DISK_TO_JSON("file-raw-noopts");
+    TEST_DISK_TO_JSON("file-bochs-noopts");
+    TEST_DISK_TO_JSON("file-cloop-noopts");
+    TEST_DISK_TO_JSON("file-dmg-noopts");
+    TEST_DISK_TO_JSON("file-ploop-noopts");
+    TEST_DISK_TO_JSON("file-vdi-noopts");
+    TEST_DISK_TO_JSON("file-vhd-noopts");
+    TEST_DISK_TO_JSON("file-vpc-noopts");

  cleanup:
     virHashFree(diskxmljsondata.schema);
diff --git a/tests/qemublocktestdata/xml2json/file-bochs-noopts.json b/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
new file mode 100644
index 0000000000..22e2560998
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-bochs-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "bochs",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-bochs-noopts.xml b/tests/qemublocktestdata/xml2json/file-bochs-noopts.xml
new file mode 100644
index 0000000000..23da6c4feb
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-bochs-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='bochs'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-cloop-noopts.json b/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
new file mode 100644
index 0000000000..b72bb5df56
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-cloop-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "cloop",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-cloop-noopts.xml b/tests/qemublocktestdata/xml2json/file-cloop-noopts.xml
new file mode 100644
index 0000000000..4dff296983
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-cloop-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='cloop'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-dmg-noopts.json b/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
new file mode 100644
index 0000000000..9f2912b8d3
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-dmg-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "dmg",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-dmg-noopts.xml b/tests/qemublocktestdata/xml2json/file-dmg-noopts.xml
new file mode 100644
index 0000000000..3650a1758f
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-dmg-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='dmg'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-ploop-noopts.json b/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
new file mode 100644
index 0000000000..64006d28a3
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-ploop-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "parallels",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-ploop-noopts.xml b/tests/qemublocktestdata/xml2json/file-ploop-noopts.xml
new file mode 100644
index 0000000000..5435c4d8d7
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-ploop-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='ploop'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-vdi-noopts.json b/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
new file mode 100644
index 0000000000..ce8e359c91
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vdi-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "vdi",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vdi-noopts.xml b/tests/qemublocktestdata/xml2json/file-vdi-noopts.xml
new file mode 100644
index 0000000000..3fa489e24b
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vdi-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='vdi'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-vhd-noopts.json b/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
new file mode 100644
index 0000000000..d4b8e1f55a
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vhd-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "vhdx",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vhd-noopts.xml b/tests/qemublocktestdata/xml2json/file-vhd-noopts.xml
new file mode 100644
index 0000000000..25fd1ba7b0
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vhd-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='vhd'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </nodenames>
+    </privateData>
+  </source>
+  <target dev='vda'/>
+</disk>
diff --git a/tests/qemublocktestdata/xml2json/file-vpc-noopts.json b/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
new file mode 100644
index 0000000000..be1ec795a7
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vpc-noopts.json
@@ -0,0 +1,12 @@
+{
+  "node-name": "test1",
+  "read-only": false,
+  "driver": "vpc",
+  "file": {
+    "driver": "file",
+    "filename": "/path/to/i.img",
+    "node-name": "test2",
+    "read-only": false,
+    "discard": "unmap"
+  }
+}
diff --git a/tests/qemublocktestdata/xml2json/file-vpc-noopts.xml b/tests/qemublocktestdata/xml2json/file-vpc-noopts.xml
new file mode 100644
index 0000000000..d761bb33cc
--- /dev/null
+++ b/tests/qemublocktestdata/xml2json/file-vpc-noopts.xml
@@ -0,0 +1,12 @@
+<disk device='disk'>
+  <driver name='qemu' type='vpc'/>
+  <source file='/path/to/i.img'>
+    <privateData>
+      <nodenames>
+        <nodename type='storage' name='test2'/>
+        <nodename type='format' name='test1'/>
+      </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