Skip to content

Commit

Permalink
Merge pull request #841 from PraveenPenguin/login_issue
Browse files Browse the repository at this point in the history
Fixed login prompt issue as couple of system has new login prompt
  • Loading branch information
abdhaleegit authored May 16, 2024
2 parents 0a4cc62 + 2a1f805 commit 9529b17
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common/OpTestUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,9 +1484,9 @@ def get_login(self, host, term_obj, pty, prompt):
if rc == 0:
pty.sendline(my_pwd)
time.sleep(0.5)
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #",
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #", ":~",
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
if rc not in [1, 2, 3, 4]:
if rc not in [1, 2, 3, 4, 5]:
if term_obj.setup_term_quiet == 0:
log.warning("OpTestSystem Problem with the login and/or password prompt,"
" raised Exception ConsoleSettings but continuing")
Expand Down Expand Up @@ -1518,9 +1518,9 @@ def get_login(self, host, term_obj, pty, prompt):
if rc == 0:
pty.sendline(my_pwd)
time.sleep(0.5)
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #",
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #", ":~",
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
if rc not in [1, 2, 3, 4]:
if rc not in [1, 2, 3, 4, 5]:
if term_obj.setup_term_quiet == 0:
log.warning("OpTestSystem Problem with the login and/or password prompt,"
" raised Exception ConsoleSettings but continuing")
Expand Down Expand Up @@ -1688,14 +1688,14 @@ def setup_term(self, system, pty, ssh_obj=None, block=0):
# Ctrl-L may cause a esc[J (erase) character to appear in the buffer.
# Include this in the patterns that expect $ (end of line)
rc = pty.expect(['login: (\x1b\[J)*$', ".*#(\x1b\[J)*$", ".*# (\x1b\[J)*$", ".*\$(\x1b\[J)*",
"~>(\x1b\[J)", "~ #(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
"~>(\x1b\[J)", "~ #(\x1b\[J)", ":~(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
if rc == 0:
track_obj.PS1_set, track_obj.LOGIN_set = self.get_login(
system_obj.cv_HOST, term_obj, pty, self.build_prompt(system_obj.prompt))
track_obj.PS1_set, track_obj.SUDO_set = self.get_sudo(
system_obj.cv_HOST, term_obj, pty, self.build_prompt(system_obj.prompt))
return
if rc in [1, 2, 3, 4, 5]:
if rc in [1, 2, 3, 4, 5, 6]:
track_obj.LOGIN_set = track_obj.PS1_set = self.set_PS1(
term_obj, pty, self.build_prompt(system_obj.prompt))
track_obj.PS1_set, track_obj.SUDO_set = self.get_sudo(
Expand Down

0 comments on commit 9529b17

Please sign in to comment.