Skip to content

Commit 9529b17

Browse files
authored
Merge pull request #841 from PraveenPenguin/login_issue
Fixed login prompt issue as couple of system has new login prompt
2 parents 0a4cc62 + 2a1f805 commit 9529b17

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

common/OpTestUtil.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1484,9 +1484,9 @@ 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)
1489-
if rc not in [1, 2, 3, 4]:
1489+
if rc not in [1, 2, 3, 4, 5]:
14901490
if term_obj.setup_term_quiet == 0:
14911491
log.warning("OpTestSystem Problem with the login and/or password prompt,"
14921492
" raised Exception ConsoleSettings but continuing")
@@ -1518,9 +1518,9 @@ 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)
1523-
if rc not in [1, 2, 3, 4]:
1523+
if rc not in [1, 2, 3, 4, 5]:
15241524
if term_obj.setup_term_quiet == 0:
15251525
log.warning("OpTestSystem Problem with the login and/or password prompt,"
15261526
" raised Exception ConsoleSettings but continuing")
@@ -1688,14 +1688,14 @@ 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))
16951695
track_obj.PS1_set, track_obj.SUDO_set = self.get_sudo(
16961696
system_obj.cv_HOST, term_obj, pty, self.build_prompt(system_obj.prompt))
16971697
return
1698-
if rc in [1, 2, 3, 4, 5]:
1698+
if rc in [1, 2, 3, 4, 5, 6]:
16991699
track_obj.LOGIN_set = track_obj.PS1_set = self.set_PS1(
17001700
term_obj, pty, self.build_prompt(system_obj.prompt))
17011701
track_obj.PS1_set, track_obj.SUDO_set = self.get_sudo(

0 commit comments

Comments
 (0)