search for: parse_resize

Displaying 20 results from an estimated 30 matches for "parse_resize".

2015 Jan 22
3
[PATCH 1/2] configure: look for the oUnit OCaml module
It will be used for the OCaml unit tests. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index e0fb481..e360bbb 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,6 +1120,7 @@ AS_IF([test "x$OCAMLC" != "xno"],[ ]) OCAML_PKG_gettext=no +OCAML_PKG_oUnit=no AS_IF([test "x$OCAMLC" != "xno"],[ #
2015 Jan 22
0
[PATCH 2/2] mllib: convert common_utils_tests to oUnit
...assert (le32_of_int 0x20406080L = "\x80\x60\x40\x20") +let test_le32 () = + assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20"); + assert_equal_string "\x80\x60\x40\x20" (le32_of_int 0x20406080L) (* Test Common_utils.parse_size. *) -let () = +let test_parse_resize () = (* For absolute sizes, oldsize is ignored. *) - assert (parse_resize ~prog 100_L "100b" = 100_L); - assert (parse_resize ~prog 1000_L "100b" = 100_L); - assert (parse_resize ~prog 10000_L "100b" = 100_L); - assert (parse_resize ~prog 100_L "100K"...
2015 May 15
5
[PATCH 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
.. and a lot of refactoring. https://bugzilla.redhat.com/show_bug.cgi?id=1167623 Rich.
2015 May 15
6
[PATCH v2 0/4] Only tell people to use -v -x when reporting bugs if they're not using those flags.
https://bugzilla.redhat.com/show_bug.cgi?id=1167623
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
...on_utils.int_of_le32 and Common_utils.le32_of_int. *) -let test_le32 () = +let test_le32 ctx = assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20"); assert_equal_string "\x80\x60\x40\x20" (le32_of_int 0x20406080L) (* Test Common_utils.parse_size. *) -let test_parse_resize () = +let test_parse_resize ctx = (* For absolute sizes, oldsize is ignored. *) assert_equal_int64 100_L (parse_resize ~prog 100_L "100b"); assert_equal_int64 100_L (parse_resize ~prog 1000_L "100b"); @@ -74,7 +74,7 @@ let test_parse_resize () = assert_equal_int64 10...
2019 Jan 16
1
Re: [PATCH 3/5] mltools: add simple tests for external_command
...ot;(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")") > +let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")") > > (* Test Tools_utils.parse_size and Tools_utils.parse_resize. *) > let test_parse_resize ctx = > @@ -156,6 +157,26 @@ let test_run_commands ctx = > end; > () > > +let test_external_command ctx = > + assert_equal_stringlist [] (external_command "true"); > + assert_equal_stringlist ["out"] (external_comman...
2019 Jan 16
0
[PATCH 3/5] mltools: add simple tests for external_command
...fun x -> "(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")") +let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")") (* Test Tools_utils.parse_size and Tools_utils.parse_resize. *) let test_parse_resize ctx = @@ -156,6 +157,26 @@ let test_run_commands ctx = end; () +let test_external_command ctx = + assert_equal_stringlist [] (external_command "true"); + assert_equal_stringlist ["out"] (external_command "echo out"); + begin + l...
2017 Sep 21
18
[PATCH v2 00/18] Replace many more uses of the Str module with PCRE.
v1 was here: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html This is a more complete evolution of the earlier patch. It replaces most important uses of Str with PCRE throughout the code. It also extends the bindings with some useful features like case-insensitive regexps. The main places I *didn't* touch are the generator (GObject uses Str extensively); and
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...hile we are in the c_edit_file + * function. + *) + c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index de95f9d..68c0d54 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -260,10 +260,13 @@ val parse_resize : int64 -> string -> int64 val human_size : int64 -> string (** Converts a size in bytes to a human-readable string. *) -val create_standard_options : Getopt.speclist -> ?anon_fun:Getopt.anon_fun -> Getopt.usage_msg -> Getopt.t +val create_standard_options : Getopt.speclist -&...
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1: https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html v2: https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html v3 is almost identical to v2, but I have added 4 extra commits to almost finish the job of replacing Str everywhere possible (note it's not possible to replace Str in common/mlstdutils or the generator because those are pure OCaml). As
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index) that cannot be downloaded (network issues, 404, etc) then virt-builder errors out on this situation. This is not a nice situation, from an user POV. This series does some refactoring to allow to better handle downloading failures, and handle the failures gracefully in virt-builder. RFC because I'm not yet too convinced
2018 Aug 21
0
[PATCH 2/2] OCaml tools: add output selection for --machine-readable
...ne readable"; ] else []) in Getopt.create argspec ?anon_fun usage_msg diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli index c56f7b660..871911c6e 100644 --- a/common/mltools/tools_utils.mli +++ b/common/mltools/tools_utils.mli @@ -64,6 +64,12 @@ val parse_resize : int64 -> string -> int64 val human_size : int64 -> string (** Converts a size in bytes to a human-readable string. *) +val machine_readable_printf : ('a, out_channel, unit) format -> 'a +(** Function to output something to the separate machine-readable + stream. + +...
2017 Sep 26
5
[PATCH 0/5] Miscellaneous refactoring of common/utils, create common/mltools
Miscellaneous refactoring, but the main one is to rename mllib/ as common/mltools/ Rich.
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
...readable"; + ] else []) in Getopt.create argspec ?anon_fun usage_msg diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli index dac6b4120..44fd20be3 100644 --- a/common/mltools/tools_utils.mli +++ b/common/mltools/tools_utils.mli @@ -64,13 +64,16 @@ val parse_resize : int64 -> string -> int64 val human_size : int64 -> string (** Converts a size in bytes to a human-readable string. *) -val create_standard_options : Getopt.speclist -> ?anon_fun:Getopt.anon_fun -> ?key_opts:bool -> Getopt.usage_msg -> Getopt.t +val create_standard_options...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
Hi, this is a first approach (hence RFC, since it misses tests & documentation) in selecting the output for --machine-readable. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it
2017 Feb 03
3
[PATCH v7 0/1] Import directly from OVA tar archive if possible
v7: - rebased because patch 1/3 has been pushed - changes to nsplit have been dropped (2/3) - addressed Richard's comments, notably the subfolder function was moved to mllib and renamed to subdirectory v6: - just rebase v5: - rebase, patches 1,3,5 were merged - 1/3: we still need to discuss whether to detect compressed discs - 2/3: - renamed argument noempty to keep_empty - tests were
2018 Aug 23
0
[PATCH v2 2/2] OCaml tools: add output selection for --machine-readable
...ne readable"; ] else []) in Getopt.create argspec ?anon_fun usage_msg diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli index c56f7b660..a3b841dc6 100644 --- a/common/mltools/tools_utils.mli +++ b/common/mltools/tools_utils.mli @@ -64,6 +64,16 @@ val parse_resize : int64 -> string -> int64 val human_size : int64 -> string (** Converts a size in bytes to a human-readable string. *) +type machine_readable_fn = { + pr : 'a. ('a, unit, string, unit) format4 -> 'a; +} (* [@@unboxed] *) +(** Helper type for {!machine_readable}, used t...
2017 Feb 03
0
[PATCH v7 1/1] v2v: ova: don't extract files from OVA if it's not needed
...0x20406080L (int_of_le32 "\x80\x60\x40\x20"); @@ -129,6 +135,7 @@ let test_string_lines_split ctx = let suite = "mllib Common_utils" >::: [ + "subdirectory" >:: test_subdirectory; "numeric.le32" >:: test_le32; "sizes.parse_resize" >:: test_parse_resize; "sizes.human_size" >:: test_human_size; diff --git a/test-data/test-utils.sh b/test-data/test-utils.sh index 86a5aaf12..1c4abe392 100755 --- a/test-data/test-utils.sh +++ b/test-data/test-utils.sh @@ -54,3 +54,22 @@ do_sha256 () ;; esac...
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
Hi, this adds the possibility to select the output for --machine-readable in OCaml tools. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it possible to add additional output for
2016 Sep 19
6
[PATCH 0/3] add crypto/LUKS support in some OCaml-based tools
Hi, this series refactors some guestfish code (not much), and exposes it via Common_utils, so it is possible to decrypt LUKS partitions when using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep. This brings them closer in features with C tools. Most probably a couple more of other OCaml-based tools (virt-v2v to convert encrypted guests, and virt-builder to use encrypted