* On 2011-12-02 14:10:14 -0500, Chris Evich ([email protected]) wrote:
> Signed-off-by: Chris Evich <[email protected]>
> ---
> client/tests/libvirt/tests/boot_savevm.py | 37
> +++++++++++++++--------------
> 1 files changed, 19 insertions(+), 18 deletions(-)
Hi Chris,
Glad to see more and more libvirt tests in autotest, but is it a good
idea to copy every case to libvirt tests directory? It may make many
duplicated code and hard to maintain these tests.
For this test, We can put it in virt/tests directory, and add the
missing method (savevm/loadvm pause/resume) in both kvm_vm/libvirt_vm.
What's your idea, Chris.
If you agree, I'd like to add the missing interfaces in kvm part.
>
> diff --git a/client/tests/libvirt/tests/boot_savevm.py
> b/client/tests/libvirt/tests/boot_savevm.py
> index d4899de..f46b0e9 100644
> --- a/client/tests/libvirt/tests/boot_savevm.py
> +++ b/client/tests/libvirt/tests/boot_savevm.py
> @@ -1,17 +1,17 @@
> import logging, time
> from autotest_lib.client.common_lib import error
> -from autotest_lib.client.virt import kvm_monitor
> -
> +# canabalize virsh_* for now, until libvirt_monitor is ready
> +from autotest_lib.client.virt import libvirt_vm
>
> 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 +21,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 +28,26 @@ 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:
> + libvirt_vm.virsh_suspend(vm.name)
> + 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:
> + # is this analogous to vm.monitor.cmd("system_reset") ??
> + # libvirt_vm.libvirtd_restart()
> + pass
> + except Exception, e:
> logging.error(e)
> try:
> - vm.monitor.cmd("loadvm 1")
> - except kvm_monitor.MonitorError, e:
> + vm.restore_from_file()
> + except Exception, e:
> logging.error(e)
> try:
> - vm.monitor.cmd("cont")
> - except kvm_monitor.MonitorError, e:
> + libvirt_vm.virsh_resume(vm.name)
> + 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
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest