test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] fix scp error on FreeBSD
@ 2016-10-25  6:22 xu,gang
  2016-10-25  6:36 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: xu,gang @ 2016-10-25  6:22 UTC (permalink / raw)
  To: dts; +Cc: xu,gang

when scp something to FreeBSD the prompt is different with other
ex:FreeBSD is "Password for root@freeBSD:"
Fedora is "root@xx.xxx.xxx.xxx's password:"

Signed-off-by: xu,gang <gangx.xu@intel.com>
---
 framework/ssh_pexpect.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index 1abf8a1..7bad5f5 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -176,11 +176,11 @@ class SSHPexpect(object):
         p = pexpect.spawn(scp_cmd)
         time.sleep(0.5)
         ssh_newkey = 'Are you sure you want to continue connecting'
-        i = p.expect([ssh_newkey, 'password: ', "# ", pexpect.EOF,
+        i = p.expect([ssh_newkey, '.*ssword', "# ", pexpect.EOF,
                       pexpect.TIMEOUT], 120)
         if i == 0:  # add once in trust list
             p.sendline('yes')
-            i = p.expect([ssh_newkey, '[pP]assword: ', pexpect.EOF], 2)
+            i = p.expect([ssh_newkey, '.*ssword', pexpect.EOF], 2)
 
         if i == 1:
             time.sleep(0.5)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V1] fix scp error on FreeBSD
  2016-10-25  6:22 [dts] [PATCH V1] fix scp error on FreeBSD xu,gang
@ 2016-10-25  6:36 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2016-10-25  6:36 UTC (permalink / raw)
  To: Xu, GangX, dts; +Cc: Xu, GangX

Hi Gang,
I think code [pP] can just fix this issue.  All you need is that change the first line as second line.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang
> Sent: Tuesday, October 25, 2016 2:22 PM
> To: dts@dpdk.org
> Cc: Xu, GangX
> Subject: [dts] [PATCH V1] fix scp error on FreeBSD
> 
> when scp something to FreeBSD the prompt is different with other
> ex:FreeBSD is "Password for root@freeBSD:"
> Fedora is "root@xx.xxx.xxx.xxx's password:"
> 
> Signed-off-by: xu,gang <gangx.xu@intel.com>
> ---
>  framework/ssh_pexpect.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
> index 1abf8a1..7bad5f5 100644
> --- a/framework/ssh_pexpect.py
> +++ b/framework/ssh_pexpect.py
> @@ -176,11 +176,11 @@ class SSHPexpect(object):
>          p = pexpect.spawn(scp_cmd)
>          time.sleep(0.5)
>          ssh_newkey = 'Are you sure you want to continue connecting'
> -        i = p.expect([ssh_newkey, 'password: ', "# ", pexpect.EOF,
> +        i = p.expect([ssh_newkey, '.*ssword', "# ", pexpect.EOF,
>                        pexpect.TIMEOUT], 120)
>          if i == 0:  # add once in trust list
>              p.sendline('yes')
> -            i = p.expect([ssh_newkey, '[pP]assword: ', pexpect.EOF], 2)
> +            i = p.expect([ssh_newkey, '.*ssword', pexpect.EOF], 2)
> 
>          if i == 1:
>              time.sleep(0.5)
> --
> 1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-25  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25  6:22 [dts] [PATCH V1] fix scp error on FreeBSD xu,gang
2016-10-25  6:36 ` Liu, Yong

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).