
@@ -164,12 +164,29 @@ else: name = param
+ # We need to copy the xml files to remote machine for + # successful execution of the ssh remote commands like net-createa via virsh, + # otherwise the remote execution of the command fails when the + # file is not locally present on the remote machine. + if vcmd == 'define' or vcmd == 'create' or vcmd == 'net-create' or \ + vcmd == 'pool-create': + s, o = utils.copy_remote(ip, name, remote=name) + if s != 0: + logger.error("Failed to copy the tempxml file to execute '%s'"\ + " cmd on '%s'", vcmd, ip) + return 0 +
You're doing this copy every time run() is called, which isn't necessary for actions that are taking place on the local system. Instead, it would be better to copy the key once. In main.py, if the user specifies --target_url, then call copy_remote(). However, the problem with copy_remote() is that it doesn't do any checking to see if the id_rsa file exists on the remote system. So if a file exists, it is replaced by the testsuite. Also, we don't really need to copy the private key itself, we need to write the public key to the target's authorized_keys file. I think something like setup_ssh_keys() is needed to do a proper key exchange between the source and target systems. Also, there's a long standing bug that needs to be fixed here.. I'll follow up with a patch. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com