[PATCH 2/4] KVM test: boot_savevm: Add more debug and kernel panic detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Print total time elapsed and number of save/load
VM cycles performed during the test. Also, verify whether
a kernel panic happened during the test execution.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tests/kvm/tests/boot_savevm.py |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/client/tests/kvm/tests/boot_savevm.py b/client/tests/kvm/tests/boot_savevm.py
index d02463d..d4899de 100644
--- a/client/tests/kvm/tests/boot_savevm.py
+++ b/client/tests/kvm/tests/boot_savevm.py
@@ -19,10 +19,14 @@ def run_boot_savevm(test, params, env):
     vm.verify_alive()
     savevm_delay = float(params.get("savevm_delay"))
     savevm_login_delay = float(params.get("savevm_login_delay"))
-    end_time = time.time() + float(params.get("savevm_timeout"))
+    savevm_login_timeout = float(params.get("savevm_timeout"))
+    start_time = time.time()
+
+    cycles = 0
 
     successful_login = False
-    while time.time() < end_time:
+    while (time.time() - start_time) < savevm_login_timeout:
+        logging.info("Save/load cycle %d", cycles + 1)
         time.sleep(savevm_delay)
         try:
             vm.monitor.cmd("stop")
@@ -45,13 +49,20 @@ def run_boot_savevm(test, params, env):
         except kvm_monitor.MonitorError, e:
             logging.error(e)
 
+        vm.verify_kernel_crash()
+
         try:
             vm.wait_for_login(timeout=savevm_login_delay)
             successful_login = True
             break
-        except Exception, detail:
-            logging.debug(detail)
+        except:
+            pass
+
+        cycles += 1
 
+    time_elapsed = int(time.time() - start_time)
+    info = "after %s s, %d load/save cycles" % (time_elapsed, cycles + 1)
     if not successful_login:
-        raise error.TestFail("Not possible to log onto the vm after %s s" %
-                             params.get("savevm_timeout"))
+        raise error.TestFail("Can't log on '%s' %s" % (vm.name, info))
+    else:
+        logging.info("Test ended %s", info)
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux