[Pkg-libvirt-commits] [libguestfs] 346/384: v2v: test-harness: Fix boot loop so it detects disk inactivity properly.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 16:59:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 0827b006e4943a670dbe193dd8b522d7cc3b4bf5
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Mar 11 15:05:13 2015 +0000

    v2v: test-harness: Fix boot loop so it detects disk inactivity properly.
---
 v2v/test-harness/v2v_test_harness.ml | 50 +++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/v2v/test-harness/v2v_test_harness.ml b/v2v/test-harness/v2v_test_harness.ml
index 998903a..fe09d6f 100644
--- a/v2v/test-harness/v2v_test_harness.ml
+++ b/v2v/test-harness/v2v_test_harness.ml
@@ -280,30 +280,34 @@ let run ~test ?input_disk ?input_xml ?(test_plan = default_plan) () =
       if active then (
         printf "%s: disk activity detected\n" (timestamp t);
         loop start t stats
-      ) else if t -. last_activity <= float test_plan.boot_idle_time then (
-        let screenshot = take_screenshot t in
-        (* Reached the final screenshot? *)
-        let done_ =
-          match test_plan.boot_plan with
-          | Boot_to_screenshot final_screenshot ->
-            if display_matches_screenshot screenshot final_screenshot then (
-              printf "%s: guest reached final screenshot\n" (timestamp t);
-              true
-            ) else false
-          | _ -> false in
-        if not done_ then (
-          (* A screenshot matching one of the screenshots in the set
-           * resets the timeout.
-           *)
-          let waiting_in_known_good_state =
-            List.exists (display_matches_screenshot screenshot)
-              test_plan.boot_known_good_screenshots in
-          if waiting_in_known_good_state then (
-            printf "%s: guest at known-good screenshot\n" (timestamp t);
-            loop t last_activity stats
-          ) else
-            loop start last_activity stats
+      ) else (
+        if t -. last_activity <= float test_plan.boot_idle_time then (
+          let screenshot = take_screenshot t in
+          (* Reached the final screenshot? *)
+          let done_ =
+            match test_plan.boot_plan with
+            | Boot_to_screenshot final_screenshot ->
+              if display_matches_screenshot screenshot final_screenshot then (
+                printf "%s: guest reached final screenshot\n" (timestamp t);
+                true
+              ) else false
+            | _ -> false in
+          if not done_ then (
+            (* A screenshot matching one of the screenshots in the set
+             * resets the timeouts.
+             *)
+            let waiting_in_known_good_state =
+              List.exists (display_matches_screenshot screenshot)
+                test_plan.boot_known_good_screenshots in
+            if waiting_in_known_good_state then (
+              printf "%s: guest at known-good screenshot\n" (timestamp t);
+              loop t t stats
+            ) else
+              loop start last_activity stats
+          )
         )
+        else
+          bootfail t "guest timed out with no disk activity before reaching final state"
       )
     in
     loop start last_activity stats;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list