Skip to content

Commit

Permalink
Fixed login prompt issue as couple of system has new login prompt
Browse files Browse the repository at this point in the history
added wildcard as :~ as , in couple of system op-test error out as not get exact wild card

Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
  • Loading branch information
PraveenPenguin committed May 14, 2024
1 parent 417e57e commit dc0101b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/OpTestUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ 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 term_obj.setup_term_quiet == 0:
Expand Down Expand Up @@ -1518,7 +1518,7 @@ 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 term_obj.setup_term_quiet == 0:
Expand Down Expand Up @@ -1688,7 +1688,7 @@ 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))
Expand Down

0 comments on commit dc0101b

Please sign in to comment.