From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9AE231023 for ; Mon, 23 Jan 2017 02:35:42 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 22 Jan 2017 17:35:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,272,1477983600"; d="scan'208";a="1086062591" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 22 Jan 2017 17:35:40 -0800 From: Yong Liu To: dts@dpdk.org Cc: Yong Liu Date: Mon, 23 Jan 2017 09:36:44 +0800 Message-Id: <1485135404-3955-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH] framework ssh_pexpect: fix scp file truncated issue X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 01:35:43 -0000 Some times even scp command status show 100%, file still not scp to destination integrated. Enable verbose option and wait for scp process really exited. Signed-off-by: Yong Liu diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py index d5b6616..8d6c3dd 100644 --- a/framework/ssh_pexpect.py +++ b/framework/ssh_pexpect.py @@ -143,9 +143,9 @@ class SSHPexpect(object): """ Copies a file from a remote place into local. """ - command = 'scp {0}@{1}:{2} {3}'.format(self.username, self.host, src, dst) + command = 'scp -v {0}@{1}:{2} {3}'.format(self.username, self.host, src, dst) if ':' in self.host: - command = 'scp -P {0} -o NoHostAuthenticationForLocalhost=yes {1}@{2}:{3} {4}'.format( + command = 'scp -v -P {0} -o NoHostAuthenticationForLocalhost=yes {1}@{2}:{3} {4}'.format( str(self.port), self.username, self.ip, src, dst) if password == '': self._spawn_scp(command, self.password) @@ -158,10 +158,10 @@ class SSHPexpect(object): """ command = 'scp {0} {1}@{2}:{3}'.format(src, self.username, self.host, dst) if ':' in self.host: - command = 'scp -P {0} -o NoHostAuthenticationForLocalhost=yes {1} {2}@{3}:{4}'.format( + command = 'scp -v -P {0} -o NoHostAuthenticationForLocalhost=yes {1} {2}@{3}:{4}'.format( str(self.port), src, self.username, self.ip, dst) else: - command = 'scp {0} {1}@{2}:{3}'.format( + command = 'scp -v {0} {1}@{2}:{3}'.format( src, self.username, self.host, dst) if password == '': self._spawn_scp(command, self.password) @@ -185,7 +185,7 @@ class SSHPexpect(object): if i == 1: time.sleep(0.5) p.sendline(password) - p.expect("100%", 60) + p.expect("Exit status 0", 60) if i == 4: self.logger.error("SCP TIMEOUT error %d" % i) -- 1.9.3