From patchwork Tue Jun 29 12:20:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 108586 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 o5TDIm4K012137 for ; Tue, 29 Jun 2010 13:20:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753770Ab0F2MUx (ORCPT ); Tue, 29 Jun 2010 08:20:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805Ab0F2MUw (ORCPT ); Tue, 29 Jun 2010 08:20:52 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5TCKoFx031994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Jun 2010 08:20:50 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5TCKntG022431; Tue, 29 Jun 2010 08:20:50 -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 o5TCKmE8005211; Tue, 29 Jun 2010 08:20:48 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH v2] KVM test: enable file transfers for Windows guests Date: Tue, 29 Jun 2010 15:20:27 +0300 Message-Id: <1277814027-13573-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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]); Tue, 29 Jun 2010 13:21:05 +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..c90415a 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -996,10 +996,12 @@ variants: password = 123456 shell_linesep = "\r\n" shell_client = nc - shell_port = 22 - # File transfers are currently unsupported - # file_transfer_client = scp - # file_transfer_port = 22 + shell_port = 10022 + file_transfer_client = rss + file_transfer_port = 10023 + redirs += " file_transfer" + guest_port_remote_shell = 10022 + guest_port_file_transfer = 10023 # This ISO will be used for all tests except install: cdrom = windows/winutils.iso