On 02/07/2012 05:47 AM, tangchen wrote:
> Hi~
>
> On 02/07/2012 01:52 AM, Chris Evich wrote:
>> Rather than lock the code into the implementation details of particular
>> virsh options, just code for the minimum necessary. However, expose
>> a set of free-form variables tests can use to exercize more specific
>> options.
>>
> OK, that will solve the compatibility problems.
>
>> + # Rely on test-code to verify guest state on receiving-end
>> + # Assume success unless proven otherwise
> But here, migrate command needs users to input a password when connecting to
> destination host, such as a ssh password.
> Do we need to implement it as an auto-login function ?
I'd just document somewhere that an ssh key setup needs to exist between
the machine running the test and the destination machine.
>
>> + migrate_cmd = "migrate " + migrate_cmd
>> + logging.debug("Mirating VM with command: virsh %s" % migrate_cmd)
>> try:
>> - cmd = "virsh %s %s" % (uri_arg, migrate_cmd)
>> - session = aexpect.ShellSession(cmd, linesep="\n")
>> - virt_utils._remote_login(session, destuser, destpwd, "", timeout=60)
>> - return True
>> - # If migration succeeds, migrate command will terminate the session
>> - # automically. So we have to catch the LoginProcessTerminatedError.
>> - except virt_utils.LoginProcessTerminatedError, e:
>> - logging.info("%s", e)
>> - session.close()
>> - if str(e).find("status: 0")>= 0:
>> - return True
>> - else:
>> - return False
>> - except error.CmdError:
>> - logging.error("Migrating VM %s failed", name)
>> + virsh_cmd(migrate_cmd, uri)
>> + except error.CmdError, defail:
>> + logging.warning("Migration error: %s" % (detail))
>> return False
>> + return True
>
>
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest