X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_actions.ml;h=7a5d786b451f1fbe85c43910b2319bbf813aa2bb;hp=9844b9408ef5fb5dac007bceb404e796027baa14;hb=cd077b8229731e292798f34dd56892cbfa6f1e0e;hpb=b893294dcc948d4b41318a400fc4235a190d306b diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 9844b94..7a5d786 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -747,6 +747,10 @@ FreeBSD. NetBSD. +=item \"hurd\" + +GNU/Hurd. + =item \"unknown\" The operating system type could not be determined. @@ -2257,7 +2261,7 @@ example C."); ("sfdisk", (RErr, [Device "device"; Int "cyls"; Int "heads"; Int "sectors"; - StringList "lines"], []), 43, [DangerWillRobinson; DeprecatedBy "part_add"], + StringList "lines"], []), 43, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -2358,7 +2362,7 @@ This unmounts all mounted filesystems. Some internal mounts are not unmounted by this call."); - ("lvm_remove_all", (RErr, [], []), 48, [DangerWillRobinson; Optional "lvm2"], + ("lvm_remove_all", (RErr, [], []), 48, [Optional "lvm2"], [], "remove all LVM LVs, VGs and PVs", "\ @@ -2585,7 +2589,10 @@ C should be a file or directory in the mounted file system This is the same as the C system call."); ("tune2fs_l", (RHashtable "superblock", [Device "device"], []), 55, [], - [], (* XXX test *) + [InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs_l"; "/dev/sdb1"]], + ["Filesystem magic number", "0xEF53"; + "Filesystem OS type", "Linux"])], "get ext2/ext3/ext4 superblock details", "\ This returns the contents of the ext2, ext3 or ext4 filesystem @@ -2711,7 +2718,7 @@ This uses the L command."); [InitScratchFS, Always, TestOutput ( (* Pick a file from cwd which isn't likely to change. *) [["mkdir"; "/upload"]; - ["upload"; "../COPYING.LIB"; "/upload/COPYING.LIB"]; + ["upload"; "../../COPYING.LIB"; "/upload/COPYING.LIB"]; ["checksum"; "md5"; "/upload/COPYING.LIB"]], Digest.to_hex (Digest.file "COPYING.LIB"))], "upload a file from the local machine", @@ -2727,7 +2734,7 @@ See also C."); [InitScratchFS, Always, TestOutput ( (* Pick a file from cwd which isn't likely to change. *) [["mkdir"; "/download"]; - ["upload"; "../COPYING.LIB"; "/download/COPYING.LIB"]; + ["upload"; "../../COPYING.LIB"; "/download/COPYING.LIB"]; ["download"; "/download/COPYING.LIB"; "testdownload.tmp"]; ["upload"; "testdownload.tmp"; "/download/upload"]; ["checksum"; "md5"; "/download/upload"]], @@ -2811,7 +2818,7 @@ To get the checksums for many files, use C."); ("tar_in", (RErr, [FileIn "tarfile"; Pathname "directory"], []), 69, [], [InitScratchFS, Always, TestOutput ( [["mkdir"; "/tar_in"]; - ["tar_in"; "../images/helloworld.tar"; "/tar_in"]; + ["tar_in"; "../data/helloworld.tar"; "/tar_in"]; ["cat"; "/tar_in/hello"]], "hello\n")], "unpack tarfile to directory", "\ @@ -2834,7 +2841,7 @@ or C."); ("tgz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 71, [], [InitScratchFS, Always, TestOutput ( [["mkdir"; "/tgz_in"]; - ["tgz_in"; "../images/helloworld.tar.gz"; "/tgz_in"]; + ["tgz_in"; "../data/helloworld.tar.gz"; "/tgz_in"]; ["cat"; "/tgz_in/hello"]], "hello\n")], "unpack compressed tarball to directory", "\ @@ -3371,7 +3378,7 @@ volume to match the new size of the underlying device."); ("sfdisk_N", (RErr, [Device "device"; Int "partnum"; Int "cyls"; Int "heads"; Int "sectors"; - String "line"], []), 99, [DangerWillRobinson; DeprecatedBy "part_add"], + String "line"], []), 99, [DeprecatedBy "part_add"], [], "modify a single partition on a block device", "\ @@ -3617,7 +3624,7 @@ It is just a wrapper around the C L function with flags C. See that manual page for more details."); - ("scrub_device", (RErr, [Device "device"], []), 114, [DangerWillRobinson; Optional "scrub"], + ("scrub_device", (RErr, [Device "device"], []), 114, [Optional "scrub"], [InitNone, Always, TestRun ( (* use /dev/sdc because it's smaller *) [["scrub_device"; "/dev/sdc"]])], "scrub (securely wipe) a device", @@ -3996,7 +4003,7 @@ This function is primarily intended for use by programs. To get a simple list of names, use C. To get a printable directory for human consumption, use C."); - ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DangerWillRobinson; DeprecatedBy "part_add"], + ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -4812,10 +4819,31 @@ for the file until you write to it). To create a non-sparse file of zeroes, use C instead."); ("utimens", (RErr, [Pathname "path"; Int64 "atsecs"; Int64 "atnsecs"; Int64 "mtsecs"; Int64 "mtnsecs"], []), 201, [], + (* Test directories, named pipes etc (RHBZ#761451, RHBZ#761460) *) [InitScratchFS, Always, TestOutputStruct ( - [["touch"; "/utimens"]; - ["utimens"; "/utimens"; "12345"; "67890"; "9876"; "5432"]; - ["stat"; "/utimens"]], [CompareWithInt ("mtime", 9876)])], + [["touch"; "/utimens-file"]; + ["utimens"; "/utimens-file"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-file"]], [CompareWithInt ("mtime", 9876)]); + InitScratchFS, Always, TestOutputStruct ( + [["mkdir"; "/utimens-dir"]; + ["utimens"; "/utimens-dir"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-dir"]], [CompareWithInt ("mtime", 9876)]); + InitScratchFS, Always, TestOutputStruct ( + [["mkfifo"; "0o644"; "/utimens-fifo"]; + ["utimens"; "/utimens-fifo"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-fifo"]], [CompareWithInt ("mtime", 9876)]); + InitScratchFS, Always, TestOutputStruct ( + [["ln_sf"; "/utimens-file"; "/utimens-link"]; + ["utimens"; "/utimens-link"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-link"]], [CompareWithInt ("mtime", 9876)]); + InitScratchFS, Always, TestOutputStruct ( + [["mknod_b"; "0o644"; "8"; "0"; "/utimens-block"]; + ["utimens"; "/utimens-block"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-block"]], [CompareWithInt ("mtime", 9876)]); + InitScratchFS, Always, TestOutputStruct ( + [["mknod_c"; "0o644"; "1"; "3"; "/utimens-char"]; + ["utimens"; "/utimens-char"; "12345"; "67890"; "9876"; "5432"]; + ["stat"; "/utimens-char"]], [CompareWithInt ("mtime", 9876)])], "set timestamp of a file with nanosecond precision", "\ This command sets the timestamps of a file with nanosecond @@ -5059,7 +5087,7 @@ backwards from the end of the disk (C<-1> is the last sector). Creating a partition which covers the whole disk is not so easy. Use C to do that."); - ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [DangerWillRobinson], + ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [], [InitEmpty, Always, TestRun ( [["part_disk"; "/dev/sda"; "mbr"]]); InitEmpty, Always, TestRun ( @@ -5341,7 +5369,7 @@ or file C to another destination device or file C. Note this will fail if the source is too short or if the destination is not large enough."); - ("zero_device", (RErr, [Device "device"], []), 228, [DangerWillRobinson; Progress], + ("zero_device", (RErr, [Device "device"], []), 228, [Progress], [InitBasicFSonLVM, Always, TestRun ( [["zero_device"; "/dev/VG/LV"]])], "write zeroes to an entire device", @@ -5357,7 +5385,7 @@ or growing unnecessarily."); ("txz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 229, [Optional "xz"], [InitScratchFS, Always, TestOutput ( [["mkdir"; "/txz_in"]; - ["txz_in"; "../images/helloworld.tar.xz"; "/txz_in"]; + ["txz_in"; "../data/helloworld.tar.xz"; "/txz_in"]; ["cat"; "/txz_in/hello"]], "hello\n")], "unpack compressed tarball to directory", "\ @@ -5454,7 +5482,7 @@ types (see C)."); ("checksum_device", (RString "checksum", [String "csumtype"; Device "device"], []), 237, [], [InitISOFS, Always, TestOutputFileMD5 ( [["checksum_device"; "md5"; "/dev/sdd"]], - "../images/test.iso")], + "../data/test.iso")], "compute MD5, SHAx or CRC checksum of the contents of a device", "\ This call computes the MD5, SHAx or CRC checksum of the @@ -5504,7 +5532,7 @@ to find out what it is for."); ("base64_in", (RErr, [FileIn "base64file"; Pathname "filename"], []), 242, [], [InitScratchFS, Always, TestOutput ( - [["base64_in"; "../images/hello.b64"; "/base64_in"]; + [["base64_in"; "../data/hello.b64"; "/base64_in"]; ["cat"; "/base64_in"]], "hello\n")], "upload base64-encoded data to file", "\ @@ -5760,7 +5788,7 @@ C parameter must be the name of the LUKS mapping device (ie. C) and I the name of the underlying block device."); - ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"; DangerWillRobinson], + ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ @@ -5769,7 +5797,7 @@ the device as a LUKS encrypted device. C is the initial key, which is added to key slot C. (LUKS supports 8 key slots, numbered 0-7)."); - ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"; DangerWillRobinson], + ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ @@ -5908,7 +5936,7 @@ See also C."); ("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress], (let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in [InitScratchFS, Always, TestOutput ( - [["upload_offset"; "../COPYING.LIB"; "/upload_offset"; "0"]; + [["upload_offset"; "../../COPYING.LIB"; "/upload_offset"; "0"]; ["checksum"; "md5"; "/upload_offset"]], md5)]), "upload a file from the local machine with offset", "\ @@ -5936,7 +5964,7 @@ See also C, C."); [InitScratchFS, Always, TestOutput ( (* Pick a file from cwd which isn't likely to change. *) [["mkdir"; "/download_offset"]; - ["upload"; "../COPYING.LIB"; "/download_offset/COPYING.LIB"]; + ["upload"; "../../COPYING.LIB"; "/download_offset/COPYING.LIB"]; ["download_offset"; "/download_offset/COPYING.LIB"; "testdownload.tmp"; offset; size]; ["upload_offset"; "testdownload.tmp"; "/download_offset/COPYING.LIB"; offset]; ["checksum"; "md5"; "/download_offset/COPYING.LIB"]], md5)]), @@ -6332,6 +6360,243 @@ is for copying blocks within existing files. See C, C and C for general file copying and moving functions."); + ("tune2fs", (RErr, [Device "device"], [Bool "force"; Int "maxmountcount"; Int "mountcount"; String "errorbehavior"; Int64 "group"; Int "intervalbetweenchecks"; Int "reservedblockspercentage"; String "lastmounteddirectory"; Int64 "reservedblockscount"; Int64 "user"]), 298, [], + [InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs"; "/dev/sdb1"; "false"; "0"; ""; "NOARG"; ""; "0"; ""; "NOARG"; ""; ""]; + ["tune2fs_l"; "/dev/sdb1"]], + ["Check interval", "0 ()"; + "Maximum mount count", "-1"]); + InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs"; "/dev/sdb1"; "false"; "0"; ""; "NOARG"; ""; "86400"; ""; "NOARG"; ""; ""]; + ["tune2fs_l"; "/dev/sdb1"]], + ["Check interval", "86400 (1 day)"; + "Maximum mount count", "-1"]); + InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs"; "/dev/sdb1"; "false"; ""; ""; "NOARG"; "1"; ""; ""; "NOARG"; ""; "1"]; + ["tune2fs_l"; "/dev/sdb1"]], + ["Reserved blocks uid", "1 (user bin)"; + "Reserved blocks gid", "1 (group bin)"]); + InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs"; "/dev/sdb1"; "false"; ""; ""; "NOARG"; "0"; ""; ""; "NOARG"; ""; "0"]; + ["tune2fs_l"; "/dev/sdb1"]], + ["Reserved blocks uid", "0 (user root)"; + "Reserved blocks gid", "0 (group root)"]) + ], + "adjust ext2/ext3/ext4 filesystem parameters", + "\ +This call allows you to adjust various filesystem parameters of +an ext2/ext3/ext4 filesystem called C. + +The optional parameters are: + +=over 4 + +=item C + +Force tune2fs to complete the operation even in the face of errors. +This is the same as the tune2fs C<-f> option. + +=item C + +Set the number of mounts after which the filesystem is checked +by L. If this is C<0> then the number of mounts is +disregarded. This is the same as the tune2fs C<-c> option. + +=item C + +Set the number of times the filesystem has been mounted. +This is the same as the tune2fs C<-C> option. + +=item C + +Change the behavior of the kernel code when errors are detected. +Possible values currently are: C, C, C. +In practice these options don't really make any difference, +particularly for write errors. + +This is the same as the tune2fs C<-e> option. + +=item C + +Set the group which can use reserved filesystem blocks. +This is the same as the tune2fs C<-g> option except that it +can only be specified as a number. + +=item C + +Adjust the maximal time between two filesystem checks +(in seconds). If the option is passed as C<0> then +time-dependent checking is disabled. + +This is the same as the tune2fs C<-i> option. + +=item C + +Set the percentage of the filesystem which may only be allocated +by privileged processes. +This is the same as the tune2fs C<-m> option. + +=item C + +Set the last mounted directory. +This is the same as the tune2fs C<-M> option. + +=item C +Set the number of reserved filesystem blocks. +This is the same as the tune2fs C<-r> option. + +=item C + +Set the user who can use the reserved filesystem blocks. +This is the same as the tune2fs C<-u> option except that it +can only be specified as a number. + +=back + +To get the current values of filesystem parameters, see +C. For precise details of how tune2fs +works, see the L man page."); + + ("md_create", (RErr, [String "name"; DeviceList "devices"], [Int64 "missingbitmap"; Int "nrdevices"; Int "spare"; Int64 "chunk"; String "level"]), 299, [Optional "mdadm"], + [], + "create a Linux md (RAID) device", + "\ +Create a Linux md (RAID) device named C on the devices +in the list C. + +The optional parameters are: + +=over 4 + +=item C + +A bitmap of missing devices. If a bit is set it means that a +missing device is added to the array. The least significant bit +corresponds to the first device in the array. + +As examples: + +If C and C then +the resulting array would be C<[EmissingE, \"/dev/sda\"]>. + +If C and C then +the resulting array would be C<[\"/dev/sda\", EmissingE]>. + +This defaults to C<0> (no missing devices). + +The length of C + the number of bits set in +C must equal C + C. + +=item C + +The number of active RAID devices. + +If not set, this defaults to the length of C plus +the number of bits set in C. + +=item C + +The number of spare devices. + +If not set, this defaults to C<0>. + +=item C + +The chunk size in bytes. + +=item C + +The RAID level, which can be one of: +I, I, I<0>, I, I, I<1>, I, +I, I<4>, I, I<5>, I, I<6>, I, I<10>. +Some of these are synonymous, and more levels may be added in future. + +If not set, this defaults to C. + +=back"); + + ("list_md_devices", (RStringList "devices", [], []), 300, [], + [], + "list Linux md (RAID) devices", + "\ +List all Linux md devices."); + + ("md_detail", (RHashtable "info", [Device "md"], []), 301, [Optional "mdadm"], + [], + "obtain metadata for an MD device", + "\ +This command exposes the output of 'mdadm -DY '. The following fields are +usually present in the returned hash. Other fields may also be present. + +=over + +=item C + +The raid level of the MD device. + +=item C + +The number of underlying devices in the MD device. + +=item C + +The metadata version used. + +=item C + +The UUID of the MD device. + +=item C + +The name of the MD device. + +=back"); + + ("md_stop", (RErr, [Device "md"], []), 302, [Optional "mdadm"], + [], + "stop a Linux md (RAID) device", + "\ +This command deactivates the MD array named C. The +device is stopped, but it is not destroyed or zeroed."); + + ("blkid", (RHashtable "info", [Device "device"], []), 303, [], + [InitScratchFS, Always, TestOutputHashtable ( + [["blkid"; "/dev/sdb1"]], + ["TYPE", "ext2"; + "USAGE", "filesystem"; + "PART_ENTRY_NUMBER", "1"; + "PART_ENTRY_TYPE", "0x83"; + "PART_ENTRY_OFFSET", "128"; + "PART_ENTRY_SIZE", "102145"])], + "print block device attributes", + "\ +This command returns block device attributes for C. The following fields are +usually present in the returned hash. Other fields may also be present. + +=over + +=item C + +The uuid of this device. + +=item C