From patchwork Mon Jun 28 00:03:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 108284 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5S03frJ018461 for ; Mon, 28 Jun 2010 00:03:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754436Ab0F1ADj (ORCPT ); Sun, 27 Jun 2010 20:03:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50919 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482Ab0F1ADh (ORCPT ); Sun, 27 Jun 2010 20:03:37 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5S03bxe024124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 27 Jun 2010 20:03:37 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5S03afw000501; Sun, 27 Jun 2010 20:03:36 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5S03X0m013795; Sun, 27 Jun 2010 20:03:35 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH] KVM test: enable file transfers for Windows guests Date: Mon, 28 Jun 2010 03:03:09 +0300 Message-Id: <1277683389-31605-2-git-send-email-mgoldish@redhat.com> In-Reply-To: <1277683389-31605-1-git-send-email-mgoldish@redhat.com> References: <1277683389-31605-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 28 Jun 2010 00:03:41 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 46b0aa3..7cc2ffa 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -6,7 +6,7 @@ Utility classes and functions to handle Virtual Machine creation using qemu. """ import time, socket, os, logging, fcntl, re, commands, glob -import kvm_utils, kvm_subprocess, kvm_monitor +import kvm_utils, kvm_subprocess, kvm_monitor, rss_file_transfer from autotest_lib.client.common_lib import error from autotest_lib.client.bin import utils @@ -954,17 +954,22 @@ class VM: client = self.params.get("file_transfer_client") address = self.get_address(nic_index) port = self.get_port(int(self.params.get("file_transfer_port"))) - log_filename = ("scp-%s-%s.log" % - (self.name, kvm_utils.generate_random_string(4))) if not address or not port: logging.debug("IP address or port unavailable") return None if client == "scp": + log_filename = ("scp-%s-%s.log" % + (self.name, kvm_utils.generate_random_string(4))) return kvm_utils.scp_to_remote(address, port, username, password, local_path, remote_path, log_filename, timeout) + elif client == "rss": + c = rss_file_transfer.FileUploadClient(address, port) + c.upload(local_path, remote_path, timeout) + c.close() + return True def copy_files_from(self, remote_path, local_path, nic_index=0, timeout=600): @@ -982,17 +987,22 @@ class VM: client = self.params.get("file_transfer_client") address = self.get_address(nic_index) port = self.get_port(int(self.params.get("file_transfer_port"))) - log_filename = ("scp-%s-%s.log" % - (self.name, kvm_utils.generate_random_string(4))) if not address or not port: logging.debug("IP address or port unavailable") return None if client == "scp": + log_filename = ("scp-%s-%s.log" % + (self.name, kvm_utils.generate_random_string(4))) return kvm_utils.scp_from_remote(address, port, username, password, remote_path, local_path, log_filename, timeout) + elif client == "rss": + c = rss_file_transfer.FileDownloadClient(address, port) + c.download(remote_path, local_path, timeout) + c.close() + return True def serial_login(self, timeout=10): diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index 2c78cfc..94e2d6f 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -997,9 +997,10 @@ variants: shell_linesep = "\r\n" shell_client = nc shell_port = 22 - # File transfers are currently unsupported - # file_transfer_client = scp - # file_transfer_port = 22 + file_transfer_client = rss + file_transfer_port = 23 + redirs += " file_transfer" + guest_port_file_transfer = 23 # This ISO will be used for all tests except install: cdrom = windows/winutils.iso