Displaying 8 results from an estimated 8 matches for "test_run_commands".
2019 Jan 16
1
Re: [PATCH 3/5] mltools: add simple tests for external_command
...uot;)
> +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
> + let lines, code = external_command_co...
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...;
+ begin
+ let tmpfile, chan = bracket_tmpfile ctx in
+ let res = run_command ["ls"; "/this-directory-is-unlikely-to-exist"] ~stderr_chan:(Unix.descr_of_out_channel chan) in
+ assert_equal_int 2 res;
+ let content = read_whole_file tmpfile in
+ assert_bool "test_run_commands/not-existing/content" (String.length content > 0)
+ end;
+ ()
+
+(* Test Common_utils.run_commands. *)
+let test_run_commands ctx =
+ begin
+ let res = run_commands [] in
+ assert_equal_intlist [] res
+ end;
+ begin
+ let res = run_commands [(["true"], None, None)] i...
2019 Jan 16
0
[PATCH 3/5] mltools: add simple tests for external_command
...ng_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
+ let lines, code = external_command_code "true" in
+ assert_equal...
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
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
...;);
@@ -131,6 +132,54 @@ let test_string_lines_split ctx =
assert_equal_stringlist ["A\nB"; ""] (String.lines_split "A\\\nB\n");
assert_equal_stringlist ["A\nB\n"] (String.lines_split "A\\\nB\\\n")
+(* Test Common_utils.run_commands. *)
+let test_run_commands ctx =
+ begin
+ let res = run_commands [] in
+ assert_equal_intlist [] res
+ end;
+ begin
+ let res = run_commands [(["true"], None, None)] in
+ assert_equal_intlist [0] res
+ end;
+ begin
+ let res = run_commands [(["true"], None, None); (["false"]...
2018 Aug 17
8
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size
I rethought this again, as I think that it's a dangerous assumption to
bake qemu-img measure output into our API.
This patch series runs qemu-img measure behind the scenes, but then
parses the output and sums it to a single number which we print.
Doing that required a bit of reworking, moving the Jansson [JSON
parser] bindings from virt-builder into the common directory and
a couple of other
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.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html
I believe this addresses all comments received so far.
Also it now passes a test where I compared about 100 disk images
processed with old and new virt-inspector binaries. The output is
identical in all cases except one which is caused by a bug in blkid