Skip to content

Commit da9d12c

Browse files
committed
IO LPAR specific timeouts
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 <[email protected]>
1 parent 2cc7254 commit da9d12c

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

common/OpTestHMC.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
log = OpTestLogger.optest_logger_glob.get_logger(__name__)
5555

56-
WAITTIME = 15
56+
WAITTIME = 25
5757
SYS_WAITTIME = 200
5858
BOOTTIME = 500
5959
STALLTIME = 5

common/OpTestUtil.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1475,12 +1475,12 @@ def get_login(self, host, term_obj, pty, prompt):
14751475
my_user = host.username()
14761476
my_pwd = host.password()
14771477
pty.sendline()
1478-
rc = pty.expect(['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1478+
rc = pty.expect(['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
14791479
if rc == 0:
14801480
pty.sendline(my_user)
14811481
time.sleep(0.1)
14821482
rc = pty.expect(
1483-
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1483+
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=60)
14841484
if rc == 0:
14851485
pty.sendline(my_pwd)
14861486
time.sleep(0.5)
@@ -1509,17 +1509,17 @@ def get_login(self, host, term_obj, pty, prompt):
15091509
else: # timeout eof
15101510
pty.sendline()
15111511
rc = pty.expect(
1512-
['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1512+
['login: ', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
15131513
if rc == 0:
15141514
pty.sendline(my_user)
15151515
time.sleep(0.1)
15161516
rc = pty.expect(
1517-
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1517+
[r"[Pp]assword:", pexpect.TIMEOUT, pexpect.EOF], timeout=60)
15181518
if rc == 0:
15191519
pty.sendline(my_pwd)
15201520
time.sleep(0.5)
15211521
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #",
1522-
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1522+
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
15231523
if rc not in [1, 2, 3, 4]:
15241524
if term_obj.setup_term_quiet == 0:
15251525
log.warning("OpTestSystem Problem with the login and/or password prompt,"
@@ -1658,7 +1658,7 @@ def setup_term(self, system, pty, ssh_obj=None, block=0):
16581658
return
16591659

16601660
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~>", "~ #",
1661-
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1661+
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=30)
16621662
if rc == 0:
16631663
track_obj.PS1_set, track_obj.LOGIN_set = self.get_login(
16641664
system_obj.cv_HOST, term_obj, pty, self.build_prompt(system_obj.prompt))
@@ -1688,7 +1688,7 @@ def setup_term(self, system, pty, ssh_obj=None, block=0):
16881688
# Ctrl-L may cause a esc[J (erase) character to appear in the buffer.
16891689
# Include this in the patterns that expect $ (end of line)
16901690
rc = pty.expect(['login: (\x1b\[J)*$', ".*#(\x1b\[J)*$", ".*# (\x1b\[J)*$", ".*\$(\x1b\[J)*",
1691-
"~>(\x1b\[J)", "~ #(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
1691+
"~>(\x1b\[J)", "~ #(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=30)
16921692
if rc == 0:
16931693
track_obj.PS1_set, track_obj.LOGIN_set = self.get_login(
16941694
system_obj.cv_HOST, term_obj, pty, self.build_prompt(system_obj.prompt))

testcases/InstallUpstreamKernel.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def is_url(path):
115115
self.config_path, sourcedir="", dstdir=os.path.join(linux_path, ".config"))
116116
con.run_command("make %s" % self.config)
117117
# Capture kernel version & release
118-
res = con.run_command("make kernelrelease")
118+
ker_ver = con.run_command("make kernelrelease")
119119
sha = con.run_command("git rev-parse HEAD")
120120
tcommit = con.run_command("export 'TERM=xterm-256color';git show -s --format=%ci")
121121
tcommit = re.sub(r"\x1b\[[0-9;]*[mGKHF]", "", tcommit[1])
122-
log.info("Upstream kernel version: %s", res[-1])
122+
log.info("Upstream kernel version: %s", ker_ver[-1])
123123
log.info("Upstream kernel commit-id: %s", sha[-1])
124124
log.info("Upstream kernel commit-time: %s", tcommit)
125125
log.debug("Compile and install linux kernel")
@@ -130,6 +130,8 @@ def is_url(path):
130130
con.run_command("grubby --set-default /boot/vmlinuz-%s" % res[-1])
131131
log.debug("Rebooting after kernel install...")
132132
self.console_thread.console_terminate()
133+
self.prompt = self.cv_SYSTEM.util.build_prompt()
134+
self.console_thread.console_terminate()
133135
con.close()
134136
time.sleep(10)
135137
raw_pty = self.cv_SYSTEM.console.get_console()
@@ -175,6 +177,8 @@ def is_url(path):
175177
con = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
176178
res = con.run_command("uname -r")
177179
log.info("Installed upstream kernel version: %s", res[-1])
180+
if ker_ver[-1] != res[-1]:
181+
self.fail("Upstream kernel did not boot")
178182
if self.conf.args.host_cmd:
179183
con.run_command(self.conf.args.host_cmd,
180184
timeout=self.host_cmd_timeout)

0 commit comments

Comments
 (0)