Signed-off-by: Chris Evich <[email protected]>
---
 client/tests/kvm/subtests.cfg.sample  |    8 +++++---
 client/tests/kvm/tests/boot_savevm.py |   12 ++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/client/tests/kvm/subtests.cfg.sample 
b/client/tests/kvm/subtests.cfg.sample
index 95147ff..a8291ec 100644
--- a/client/tests/kvm/subtests.cfg.sample
+++ b/client/tests/kvm/subtests.cfg.sample
@@ -290,11 +290,13 @@ variants:
         # Time limit in seconds to login after vm restored
         savevm_login_timeout = 120
         # Total number of stop/save/reset/load/cont cycles to perform.
+        # Minimum is 2
         savevm_cycles = 10
-        # Maximum percentage time variance allowed after first cycle.
-        # e.g. if threshold is 10%, first cycle + savevm_delay takes 55s, 
+        # Maximum percentage time variance allowed after second cycle.
+        # Range: 0.5 - 100.0 percent
+        # e.g. if threshold is 10%, second cycle + savevm_delay takes 55s, 
         # no subsequent cycle permitted to take more than (about) 1 minute.
-        cycle_duration_threshold = 10
+        cycle_duration_threshold = 25.0
         kill_vm_on_error = yes
         kill_vm_gracefully = yes
         kill_vm = yes
diff --git a/client/tests/kvm/tests/boot_savevm.py 
b/client/tests/kvm/tests/boot_savevm.py
index 950b6f8..66dfe04 100644
--- a/client/tests/kvm/tests/boot_savevm.py
+++ b/client/tests/kvm/tests/boot_savevm.py
@@ -8,7 +8,7 @@ def run_boot_savevm(test, params, env):
     KVM boot savevm test:
 
     1) Start guest.
-    2) Periodically savevm/loadvm.
+    2) Periodically savevm/loadvm, compare duration to second attempt
     4) Log into the guest to verify it's up, fail after timeout seconds.
 
     @param test: kvm test object
@@ -54,7 +54,7 @@ def run_boot_savevm(test, params, env):
             vm.wait_for_login(timeout=savevm_login_timeout)
         except Exception, detail:
             logging.debug(detail)
-
+        logging.debug("Ending cycle %d" % cycle_number)
 
     for cycle_number in xrange(0,savevm_cycles):
         start_time = time.time()
@@ -63,12 +63,16 @@ def run_boot_savevm(test, params, env):
         duration = end_time - start_time
         assert duration > min_duration # sanity check
         if cycle_number == 0: # simplify outer for loop
+            logging.debug("Warmup cycle lasted %0.4f seconds" % duration)
+            continue # Throw away, assume cache is warming up.
+        if cycle_number == 1:
             max_duration = duration * (1.0 + (cycle_duration_threshold/100.0))
-            logging.debug("First cycle lasted %0.4f seconds" % duration)
+            logging.debug("Second cycle lasted %0.4f seconds, "
+                          "setting max threshold to %0.4f seconds" % 
(duration, max_duration))
         else:
             logging.debug("Cycle %d lasted %0.4f seconds, threshold is %0.4f" %
                 (cycle_number, duration, max_duration))
             if duration > max_duration:
-                overrun = max_duration - duration;
+                overrun = duration - max_duration;
                 raise error.TestFail("savevm cycle %d took %0.4f seconds 
longer than %0.4f." %
                     (cycle_number, overrun, max_duration))
-- 
1.7.1

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to