test suite reviews and discussions
 help / color / 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

* Re: [dts] [PATCH V1]framework/ssh_pexpect: add ssh login support for freebsd os
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Xiao, QimaiX @ 2020-07-02  3:26 UTC (permalink / raw)
  To: dts

Tested-by: Xiao, QimaiX <qimaix.xiao@intel.com>

Regards,
Xiao Qimai

> -----Original Message-----
> From: Xiao, QimaiX <qimaix.xiao@intel.com>
> Sent: Thursday, July 2, 2020 11:16 AM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts][PATCH V1]framework/ssh_pexpect: add ssh login support for
> freebsd os
> 
> *. 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

* Re: [dts] [PATCH V1]framework/ssh_pexpect: add ssh login support for freebsd os
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-07-02  7:19 UTC (permalink / raw)
  To: Xiao, QimaiX, dts; +Cc: Xiao, QimaiX

Applied, thanks

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Xiao Qimai
> Sent: 2020^[$BG/^[(B7^[$B7n^[(B2^[$BF|^[(B 11:16
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts] [PATCH V1]framework/ssh_pexpect: add ssh login support for
> freebsd os
> 
> *. 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, back to index

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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox