Signed-off-by: Chris Evich <[email protected]>
---
client/tests/libvirt/tests/boot_savevm.py | 33 +++++++++++-----------------
1 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/client/tests/libvirt/tests/boot_savevm.py
b/client/tests/libvirt/tests/boot_savevm.py
index d4899de..f87c985 100644
--- a/client/tests/libvirt/tests/boot_savevm.py
+++ b/client/tests/libvirt/tests/boot_savevm.py
@@ -1,17 +1,15 @@
import logging, time
from autotest_lib.client.common_lib import error
-from autotest_lib.client.virt import kvm_monitor
-
def run_boot_savevm(test, params, env):
"""
- KVM boot savevm test:
+ libvirt boot savevm test:
- 1) Start guest.
- 2) Periodically savevm/loadvm.
- 4) Log into the guest to verify it's up, fail after timeout seconds.
+ 1) Start guest booting
+ 2) Periodically savevm/loadvm while guest booting
+ 4) Stop test when able to login, or fail after timeout seconds.
- @param test: kvm test object
+ @param test: libvirt test object
@param params: Dictionary with the test parameters
@param env: Dictionary with test environment.
"""
@@ -21,7 +19,6 @@ def run_boot_savevm(test, params, env):
savevm_login_delay = float(params.get("savevm_login_delay"))
savevm_login_timeout = float(params.get("savevm_timeout"))
start_time = time.time()
-
cycles = 0
successful_login = False
@@ -29,24 +26,20 @@ def run_boot_savevm(test, params, env):
logging.info("Save/load cycle %d", cycles + 1)
time.sleep(savevm_delay)
try:
- vm.monitor.cmd("stop")
- except kvm_monitor.MonitorError, e:
+ vm.pause()
+ except Exception, e: # until libvirt_monitor ready w/ own exceptions
logging.error(e)
try:
- vm.monitor.cmd("savevm 1")
- except kvm_monitor.MonitorError, e:
+ vm.save_to_file()
+ except Exception, e:
logging.error(e)
try:
- vm.monitor.cmd("system_reset")
- except kvm_monitor.MonitorError, e:
+ vm.restore_from_file()
+ except Exception, e:
logging.error(e)
try:
- vm.monitor.cmd("loadvm 1")
- except kvm_monitor.MonitorError, e:
- logging.error(e)
- try:
- vm.monitor.cmd("cont")
- except kvm_monitor.MonitorError, e:
+ vm.resume()
+ except Exception, e:
logging.error(e)
vm.verify_kernel_crash()
--
1.7.1
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest