Skip to content

Commit dc0101b

Browse files
Fixed login prompt issue as couple of system has new login prompt
added wildcard as :~ as , in couple of system op-test error out as not get exact wild card Signed-off-by: Praveen K Pandey <[email protected]>
1 parent 417e57e commit dc0101b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/OpTestUtil.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ def get_login(self, host, term_obj, pty, prompt):
14841484
if rc == 0:
14851485
pty.sendline(my_pwd)
14861486
time.sleep(0.5)
1487-
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #",
1487+
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #", ":~",
14881488
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=60)
14891489
if rc not in [1, 2, 3, 4]:
14901490
if term_obj.setup_term_quiet == 0:
@@ -1518,7 +1518,7 @@ def get_login(self, host, term_obj, pty, prompt):
15181518
if rc == 0:
15191519
pty.sendline(my_pwd)
15201520
time.sleep(0.5)
1521-
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #",
1521+
rc = pty.expect(['login: $', ".*#$", ".*# $", ".*\$", "~ #", ":~",
15221522
'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
15231523
if rc not in [1, 2, 3, 4]:
15241524
if term_obj.setup_term_quiet == 0:
@@ -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)", ":~(\x1b\[J)", 'Petitboot', pexpect.TIMEOUT, pexpect.EOF], timeout=10)
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))

0 commit comments

Comments
 (0)