47 lines
880 B
Plaintext
47 lines
880 B
Plaintext
##
|
|
# Get the output of the target machine via serial connection
|
|
#
|
|
# \param --log-serial-cmd Cmd that is executed to capture the output
|
|
#
|
|
|
|
source [genode_dir]/tool/run/log.inc
|
|
|
|
|
|
set default_serial_cmd "picocom -b 115200 /dev/ttyUSB0"
|
|
|
|
|
|
proc log_serial_cmd { } {
|
|
global default_serial_cmd
|
|
return [get_cmd_arg --log-serial-cmd $default_serial_cmd]
|
|
}
|
|
|
|
|
|
##
|
|
# Log output of the test machine via serial device
|
|
#
|
|
proc run_log { wait_for_re timeout_value } {
|
|
global output_spawn_id
|
|
|
|
set kernel_msg [run_boot_string]
|
|
|
|
eval spawn [log_serial_cmd]
|
|
set output_spawn_id $spawn_id
|
|
|
|
set timeout 210
|
|
expect {
|
|
$kernel_msg { }
|
|
eof {
|
|
puts stderr "Serial command process died unexpectedly"
|
|
return false
|
|
}
|
|
timeout {
|
|
puts stderr "Boot process timed out"
|
|
close
|
|
return false
|
|
}
|
|
}
|
|
|
|
wait_for_output $wait_for_re $timeout_value $output_spawn_id
|
|
return true
|
|
}
|