On 12/02/2011 05:10 PM, Chris Evich wrote:

Ok, now with proper review.

> Signed-off-by: Chris Evich<[email protected]>
> ---
>   client/tests/libvirt/tests/boot_savevm.py |   37 
> +++++++++++++++--------------
>   1 files changed, 19 insertions(+), 18 deletions(-)
>
> 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()

^ The method save_to_file has an empty implementation (pass) on 
libvirt_vm, so not suitable yet.

> +        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()

^ libvirtd_restart restarts the libvirt daemon, hence unsuitable for use 
on this implementation. I also failed to find an analogous function for 
libvirt.

> +            pass
> +        except Exception, e:
>               logging.error(e)
>           try:
> -            vm.monitor.cmd("loadvm 1")
> -        except kvm_monitor.MonitorError, e:
> +            vm.restore_from_file()

^ This method also has an empty implementation (pass) on libvirt_vm.

> +        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()

Therefore, we still need to find suitable implementations for savevm, 
systemreset and loadvm. So need to do some more work to see if this is 
feasible at all.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to