]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
tests: add vol-qcow2-zerocapacity test to storagevolxml2argvtest
authorChris J Arges <chris.j.arges@canonical.com>
Tue, 30 Jun 2015 20:19:04 +0000 (15:19 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 24 Jul 2015 15:23:45 +0000 (11:23 -0400)
Add a testcase for the previous change to ensure zero capacity volumes can be
defined without a backing store.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
tests/storagevolxml2argvdata/qcow2-zerocapacity.argv [new file with mode: 0644]
tests/storagevolxml2argvtest.c
tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml [new file with mode: 0644]

diff --git a/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv b/tests/storagevolxml2argvdata/qcow2-zerocapacity.argv
new file mode 100644 (file)
index 0000000..d83b08b
--- /dev/null
@@ -0,0 +1 @@
+qemu-img create -f qcow2 -o compat=0.10  0K
index ed002ce352819d2c01ad3fd487ebda0282f857c6..393123b60b1135e5001ce852202c0deda4d3a8dd 100644 (file)
@@ -284,6 +284,9 @@ mymain(void)
     DO_TEST("pool-dir", "vol-qcow2-nocapacity",
             "pool-dir", "vol-file",
             "qcow2-nocapacity-convert-prealloc", flags, FMT_OPTIONS);
+    DO_TEST("pool-dir", "vol-qcow2-zerocapacity",
+            NULL, NULL,
+            "qcow2-zerocapacity", 0, FMT_COMPAT);
     DO_TEST_FULL(false, VIR_VOL_XML_PARSE_OPT_CAPACITY,
                  "pool-dir", "vol-qcow2-nocapacity-backing", NULL, NULL,
                  "qcow2-nocapacity", 0, FMT_OPTIONS);
diff --git a/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml b/tests/storagevolxml2xmlin/vol-qcow2-zerocapacity.xml
new file mode 100644 (file)
index 0000000..1d1e6de
--- /dev/null
@@ -0,0 +1,7 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <target>
+    <format type="qcow2"/>
+  </target>
+  <capacity>0</capacity>
+</volume>