diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-04 09:03:08 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-04 10:02:57 +0100 |
commit | d03361b1afee09135b0cbd92a2cc180c66c5f84e (patch) | |
tree | fd49a7379225c886020317de3ed33af722e4ac74 /generator | |
parent | 4ed981bd5f0a158db3cfb87794628806bf00d443 (diff) | |
download | libguestfs-d03361b1afee09135b0cbd92a2cc180c66c5f84e.tar.gz libguestfs-d03361b1afee09135b0cbd92a2cc180c66c5f84e.tar.xz libguestfs-d03361b1afee09135b0cbd92a2cc180c66c5f84e.zip |
lib: Add tests to the disk-{format,virtual-size,has-backing-file} APIs.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/actions.ml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/generator/actions.ml b/generator/actions.ml index 5e85164d..a3ff9ade 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -2275,6 +2275,14 @@ data." }; { defaults with name = "disk_format"; style = RString "format", [String "filename"], []; + tests = [ + InitEmpty, Always, TestOutput ( + [["disk_format"; "test1.img"]], "raw"); + InitEmpty, Always, TestOutput ( + [["disk_format"; "test2.img"]], "raw"); + InitEmpty, Always, TestOutput ( + [["disk_format"; "test3.img"]], "raw"); + ]; shortdesc = "detect the disk format of a disk image"; longdesc = "\ Detect and return the format of the disk image called C<filename>. @@ -2289,6 +2297,14 @@ See also: L<guestfs(3)/DISK IMAGE FORMATS>" }; { defaults with name = "disk_virtual_size"; style = RInt64 "size", [String "filename"], []; + tests = [ + InitEmpty, Always, TestOutputInt ( + [["disk_virtual_size"; "test1.img"]], 524288000); + InitEmpty, Always, TestOutputInt ( + [["disk_virtual_size"; "test2.img"]], 52428800); + InitEmpty, Always, TestOutputInt ( + [["disk_virtual_size"; "test3.img"]], 10485760); + ]; shortdesc = "return virtual size of a disk"; longdesc = "\ Detect and return the virtual size in bytes of the disk image @@ -2300,6 +2316,14 @@ circumstances. See L<guestfs(3)/CVE-2010-3851>." }; { defaults with name = "disk_has_backing_file"; style = RBool "backingfile", [String "filename"], []; + tests = [ + InitEmpty, Always, TestOutputFalse ( + [["disk_has_backing_file"; "test1.img"]]); + InitEmpty, Always, TestOutputFalse ( + [["disk_has_backing_file"; "test2.img"]]); + InitEmpty, Always, TestOutputFalse ( + [["disk_has_backing_file"; "test3.img"]]); + ]; shortdesc = "return whether disk has a backing file"; longdesc = "\ Detect and return whether the disk image C<filename> has a |