Skip to content

Commit

Permalink
fix timing issue when setting prompt
Browse files Browse the repository at this point in the history
In some cases where LPAR is loaded with IO devices
it takes bit extra time to reach login prompt and
set the common prompt so need to increase wait time
and time to expect prompt

Signed-off-by: Abdul Haleem <[email protected]>
  • Loading branch information
abdhaleegit committed Jun 6, 2024
1 parent 4f53f47 commit 575b12e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/OpTestHMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

log = OpTestLogger.optest_logger_glob.get_logger(__name__)

WAITTIME = 15
WAITTIME = 25
SYS_WAITTIME = 200
BOOTTIME = 500
STALLTIME = 5
Expand Down
6 changes: 3 additions & 3 deletions common/OpTestUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ def get_login(self, host, term_obj, pty, prompt):
pty.sendline(my_pwd)
time.sleep(0.5)
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #", ":~",
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
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,"
Expand Down Expand Up @@ -1658,7 +1658,7 @@ def setup_term(self, system, pty, ssh_obj=None, block=0):
return

rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~>", "~ #",
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=30)
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 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)", ":~(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
"~>(\x1b\[J)", "~ #(\x1b\[J)", ":~(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=30)
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 575b12e

Please sign in to comment.