test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Yong Liu <yong.liu@intel.com>
Subject: [dts] [PATCH] framework ssh_pexpect: fix scp file truncated issue
Date: Mon, 23 Jan 2017 09:36:44 +0800	[thread overview]
Message-ID: <1485135404-3955-1-git-send-email-yong.liu@intel.com> (raw)

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 <yong.liu@intel.com>

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

                 reply	other threads:[~2017-01-23  1:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485135404-3955-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).