test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1]framework/ssh_pexpect: add ssh login support for freebsd os
@ 2020-07-02  3:15 Xiao Qimai
  2020-07-02  3:26 ` Xiao, QimaiX
  2020-07-02  7:19 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: Xiao Qimai @ 2020-07-02  3:15 UTC (permalink / raw)
  To: dts; +Cc: Xiao Qimai

*. add freebsd password prompt

Signed-off-by: Xiao Qimai <qimaix.xiao@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 1f839d4..fbc7dd4 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -44,7 +44,7 @@ class SSHPexpect:
                     try:
                         self.session.login(self.ip, self.username,
                                            self.password, original_prompt='[$#>]',
-                                           port=self.port, login_timeout=20)
+                                           port=self.port, login_timeout=20, password_regex=r'(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)')
                     except Exception as e:
                         print(e)
                         time.sleep(2)
@@ -57,7 +57,7 @@ class SSHPexpect:
             else:
                 self.session = pxssh.pxssh(encoding='utf-8')
                 self.session.login(self.host, self.username,
-                                   self.password, original_prompt='[$#>]')
+                                   self.password, original_prompt='[$#>]', password_regex=r'(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)')
             self.send_expect('stty -echo', '#')
             self.send_expect('stty columns 1000', "#")
         except Exception as e:
-- 
1.8.3.1


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

end of thread, other threads:[~2020-07-02  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02  3:15 [dts] [PATCH V1]framework/ssh_pexpect: add ssh login support for freebsd os Xiao Qimai
2020-07-02  3:26 ` Xiao, QimaiX
2020-07-02  7:19 ` Tu, Lijuan

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