Skip to content

Commit

Permalink
Fix vs check install login timeout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xumia committed Aug 13, 2022
1 parent 743625c commit c1fb1ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion check_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def main():
passwd_prompt = 'Password:'
cmd_prompt = "{}@sonic:~\$ $".format(args.u)
grub_selection = "The highlighted entry will be executed"
firsttime_prompt = '+ firsttime_exit'

i = 0
while True:
Expand All @@ -38,13 +39,17 @@ def main():

# bootup sonic image
while True:
i = p.expect([login_prompt, passwd_prompt, cmd_prompt])
i = p.expect([login_prompt, passwd_prompt, firsttime_prompt, cmd_prompt])
if i == 0:
# send user name
p.sendline(args.u)
elif i == 1:
# send password
p.sendline(args.P)
elif i == 2:
# fix a login timeout issue, caused by the login_prompt message mixed with the output message of the rc.local
time.sleep(1)
p.sendline()
else:
break

Expand Down

0 comments on commit c1fb1ef

Please sign in to comment.