]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add storagevol tests for format=iso
authorCole Robinson <crobinso@redhat.com>
Tue, 7 Mar 2017 15:50:59 +0000 (10:50 -0500)
committerCole Robinson <crobinso@redhat.com>
Wed, 8 Mar 2017 18:22:33 +0000 (13:22 -0500)
Demonstrates the bug fix in commit 0e5db762627

tests/storagevolxml2argvdata/iso-input.argv [new file with mode: 0644]
tests/storagevolxml2argvdata/iso.argv [new file with mode: 0644]
tests/storagevolxml2argvtest.c
tests/storagevolxml2xmlin/vol-file-iso.xml [new file with mode: 0644]
tests/storagevolxml2xmlout/vol-file-iso.xml [new file with mode: 0644]
tests/storagevolxml2xmltest.c

diff --git a/tests/storagevolxml2argvdata/iso-input.argv b/tests/storagevolxml2argvdata/iso-input.argv
new file mode 100644 (file)
index 0000000..1db0265
--- /dev/null
@@ -0,0 +1,2 @@
+qemu-img convert -f raw -O raw /var/lib/libvirt/images/test.iso \
+/var/lib/libvirt/images/sparse.img
diff --git a/tests/storagevolxml2argvdata/iso.argv b/tests/storagevolxml2argvdata/iso.argv
new file mode 100644 (file)
index 0000000..172a255
--- /dev/null
@@ -0,0 +1 @@
+qemu-img create -f raw /var/lib/libvirt/images/test.iso 1024K
index bf9dbe5e080ae233c118bcdb8fec1fd392dd62ec..24c3bac20d399e316ad4171376d0390d48c79438 100644 (file)
@@ -272,6 +272,13 @@ mymain(void)
                  "pool-dir", "vol-qcow2-nocapacity-backing", NULL, NULL,
                  "qcow2-nocapacity", 0, FMT_OPTIONS);
 
+    DO_TEST("pool-dir", "vol-file-iso",
+            NULL, NULL,
+            "iso", 0, FMT_OPTIONS);
+    DO_TEST("pool-dir", "vol-file",
+            "pool-dir", "vol-file-iso",
+            "iso-input", 0, FMT_OPTIONS);
+
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
diff --git a/tests/storagevolxml2xmlin/vol-file-iso.xml b/tests/storagevolxml2xmlin/vol-file-iso.xml
new file mode 100644 (file)
index 0000000..b1f0756
--- /dev/null
@@ -0,0 +1,10 @@
+<volume>
+  <name>test.iso</name>
+  <source/>
+  <capacity unit="MiB">1</capacity>
+  <allocation unit="MiB">1</allocation>
+  <target>
+    <format type='iso'/>
+    <path>/var/lib/libvirt/images/test.iso</path>
+  </target>
+</volume>
diff --git a/tests/storagevolxml2xmlout/vol-file-iso.xml b/tests/storagevolxml2xmlout/vol-file-iso.xml
new file mode 100644 (file)
index 0000000..9783124
--- /dev/null
@@ -0,0 +1,11 @@
+<volume type='file'>
+  <name>test.iso</name>
+  <source>
+  </source>
+  <capacity unit='bytes'>1048576</capacity>
+  <allocation unit='bytes'>1048576</allocation>
+  <target>
+    <path>/var/lib/libvirt/images/test.iso</path>
+    <format type='iso'/>
+  </target>
+</volume>
index db82bea5be04cd8bcc162af593facd49a76afe9a..18e8016cb3c8ddbd167d44548549145f641c3bed 100644 (file)
@@ -100,6 +100,7 @@ mymain(void)
     DO_TEST("pool-dir", "vol-file");
     DO_TEST("pool-dir", "vol-file-naming");
     DO_TEST("pool-dir", "vol-file-backing");
+    DO_TEST("pool-dir", "vol-file-iso");
     DO_TEST("pool-dir", "vol-qcow2");
     DO_TEST("pool-dir", "vol-qcow2-1.1");
     DO_TEST("pool-dir", "vol-qcow2-lazy");