diff --git a/check_install.py b/check_install.py index 08759db127..6ed5683a2a 100755 --- a/check_install.py +++ b/check_install.py @@ -24,6 +24,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: @@ -43,7 +44,7 @@ def main(): # install sonic image while True: - i = p.expect([login_prompt, passwd_prompt, grub_selection, cmd_prompt]) + i = p.expect([login_prompt, passwd_prompt, firsttime_prompt, grub_selection, cmd_prompt]) if i == 0: # send user name p.sendline(args.u) @@ -51,6 +52,10 @@ def main(): # 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() + elif i == 3: # select onie install p.sendline() else: