Skip to content

Commit

Permalink
tests: Add storagevol tests for format=iso
Browse files Browse the repository at this point in the history
Demonstrates the bug fix in commit 0e5db76
  • Loading branch information
crobinso committed Mar 8, 2017
1 parent d7dcea6 commit 0de1066
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/storagevolxml2argvdata/iso-input.argv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
qemu-img convert -f raw -O raw /var/lib/libvirt/images/test.iso \
/var/lib/libvirt/images/sparse.img
1 change: 1 addition & 0 deletions tests/storagevolxml2argvdata/iso.argv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qemu-img create -f raw /var/lib/libvirt/images/test.iso 1024K
7 changes: 7 additions & 0 deletions tests/storagevolxml2argvtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 10 additions & 0 deletions tests/storagevolxml2xmlin/vol-file-iso.xml
Original file line number Diff line number Diff line change
@@ -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>
11 changes: 11 additions & 0 deletions tests/storagevolxml2xmlout/vol-file-iso.xml
Original file line number Diff line number Diff line change
@@ -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>
1 change: 1 addition & 0 deletions tests/storagevolxml2xmltest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 0de1066

Please sign in to comment.