blob: f4c3d38ffcbb25fd483948c429706940ac76e36f [file] [log] [blame]
#!/usr/bin/expect
#
# Launch QEMU and verify we can login then sleep for defined amount of time
# before exiting
#
# Requires following env variables be set:
# QEMU_RUN_TIMER Amount of time to run the QEMU instance
# HOME Location of scripts
set timeout "$env(QEMU_RUN_TIMER)*2"
set command "$env(HOME)/boot-qemu.sh"
spawn $command
expect {
timeout { send_user "\nFailed to boot\n"; exit 1 }
eof { send_user "\nFailure, got EOF"; exit 1 }
"qemuarm login:"
}
send "root\r"
expect {
timeout { send_user "\nFailed, no login prompt\n"; exit 1 }
eof { send_user "\nFailure, got EOF"; exit 1 }
"Password:"
}
send "0penBmc\r"
expect {
timeout { send_user "\nFailed, could not login\n"; exit 1 }
eof { send_user "\nFailure, got EOF"; exit 1 }
"root@qemuarm:~#"
}
send_user "OPENBMC-READY\n"
sleep "$env(QEMU_RUN_TIMER)"
send_user "OPENBMC-EXITING\n"