Skip to content

Commit

Permalink
IO LPAR specific timeouts
Browse files Browse the repository at this point in the history
When LPAR is loaded with devices and adpater and network
load is high, the console, boot and prompt response is slow
so increase wait time to handle these

Signed-off-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
  • Loading branch information
abdhaleegit committed Dec 4, 2023
1 parent 2cc7254 commit da9d12c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion common/OpTestHMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

log = OpTestLogger.optest_logger_glob.get_logger(__name__)

WAITTIME = 15
WAITTIME = 25
SYS_WAITTIME = 200
BOOTTIME = 500
STALLTIME = 5
Expand Down
14 changes: 7 additions & 7 deletions common/OpTestUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1475,12 +1475,12 @@ def get_login(self, host, term_obj, pty, prompt):
my_user = host.username()
my_pwd = host.password()
pty.sendline()
rc = pty.expect(['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
rc = pty.expect(['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
if rc == 0:
pty.sendline(my_user)
time.sleep(0.1)
rc = pty.expect(
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=10)
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=60)
if rc == 0:
pty.sendline(my_pwd)
time.sleep(0.5)
Expand Down Expand Up @@ -1509,17 +1509,17 @@ def get_login(self, host, term_obj, pty, prompt):
else: # timeout eof
pty.sendline()
rc = pty.expect(
['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
if rc == 0:
pty.sendline(my_user)
time.sleep(0.1)
rc = pty.expect(
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=10)
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=60)
if rc == 0:
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]:
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)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
"~>(\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
8 changes: 6 additions & 2 deletions testcases/InstallUpstreamKernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ def is_url(path):
self.config_path, sourcedir="", dstdir=os.path.join(linux_path, ".config"))
con.run_command("make %s" % self.config)
# Capture kernel version & release
res = con.run_command("make kernelrelease")
ker_ver = con.run_command("make kernelrelease")
sha = con.run_command("git rev-parse HEAD")
tcommit = con.run_command("export 'TERM=xterm-256color';git show -s --format=%ci")
tcommit = re.sub(r"\x1b\[[0-9;]*[mGKHF]", "", tcommit[1])
log.info("Upstream kernel version: %s", res[-1])
log.info("Upstream kernel version: %s", ker_ver[-1])
log.info("Upstream kernel commit-id: %s", sha[-1])
log.info("Upstream kernel commit-time: %s", tcommit)
log.debug("Compile and install linux kernel")
Expand All @@ -130,6 +130,8 @@ def is_url(path):
con.run_command("grubby --set-default /boot/vmlinuz-%s" % res[-1])
log.debug("Rebooting after kernel install...")
self.console_thread.console_terminate()
self.prompt = self.cv_SYSTEM.util.build_prompt()
self.console_thread.console_terminate()
con.close()
time.sleep(10)
raw_pty = self.cv_SYSTEM.console.get_console()
Expand Down Expand Up @@ -175,6 +177,8 @@ def is_url(path):
con = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
res = con.run_command("uname -r")
log.info("Installed upstream kernel version: %s", res[-1])
if ker_ver[-1] != res[-1]:
self.fail("Upstream kernel did not boot")
if self.conf.args.host_cmd:
con.run_command(self.conf.args.host_cmd,
timeout=self.host_cmd_timeout)
Expand Down

0 comments on commit da9d12c

Please sign in to comment.