* [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年7月2日 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, 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).