mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-26 08:51:08 +00:00
a08846edf0
The new parameter specifies the additional timeout duration in seconds which is incurred by AMT log processing, e.g. time spent waiting for the system to boot.
96 lines
2.4 KiB
Plaintext
96 lines
2.4 KiB
Plaintext
##
|
|
# Get output of the target machine via Intel AMT's SoL feature
|
|
#
|
|
# \param --amt-host network address of target machine
|
|
# \param --amt-password AMT password for target machine
|
|
# \param --amt-filter Sanitize output by piping it through a filter
|
|
#
|
|
|
|
source [genode_dir]/tool/run/log.inc
|
|
source [genode_dir]/tool/run/amt.inc
|
|
|
|
|
|
proc log_amt_host { } {
|
|
return [get_cmd_arg_first --log-amt-host ""]
|
|
}
|
|
|
|
|
|
proc log_amt_password { } {
|
|
return [get_cmd_arg_first --log-amt-password ""]
|
|
}
|
|
|
|
proc log_amt_filter { } {
|
|
return [get_cmd_arg_first --log-amt-filter ""]
|
|
}
|
|
|
|
proc log_amt_timeout { } {
|
|
return [get_cmd_arg_first --log-amt-timeout "30"]
|
|
}
|
|
|
|
##
|
|
# Log output of the test machine using Intel's AMT
|
|
#
|
|
proc run_log { wait_for_re timeout_value } {
|
|
global output_spawn_id
|
|
|
|
if {![is_amt_available [log_amt_host] [log_amt_password]]} {
|
|
set exit_result 1
|
|
return false
|
|
}
|
|
|
|
# Check that SOL is correctly configured if wsman is available
|
|
if {[have_installed wsman]} {
|
|
set redir_state [exec wsman get http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService -h [power_on_amt_host] -P 16992 -u admin -p [power_on_amt_password]]
|
|
set redir_state [regexp -inline {ListenerEnabled.*ListenerEnabled} $redir_state]
|
|
|
|
if {![regexp {ListenerEnabled>true} $redir_state]} {
|
|
puts " Warning: AMT_RedirectionService listener is disabled - serial output will not be available"
|
|
puts " Use wsman to enable the listener service, e.g.:"
|
|
puts " wsman put http://intel.com/wbem/wscim/1/amt-schema/1/AMT_RedirectionService -h [power_on_amt_host] -P 16992 -u admin -p <your-intel-me-amt-password> -k ListenerEnabled=true"
|
|
puts ""
|
|
}
|
|
|
|
}
|
|
|
|
#
|
|
# password via environment variable for amtterm will not show up in logs
|
|
#
|
|
set ::env(AMT_PASSWORD) [log_amt_password]
|
|
|
|
#
|
|
# grab output
|
|
#
|
|
set amt_cmd "amtterm -u admin -v [log_amt_host]"
|
|
if {[get_cmd_switch --log-amt-filter]} {
|
|
set amt_cmd "$amt_cmd | [log_amt_filter]"
|
|
}
|
|
|
|
if {$wait_for_re == "forever"} {
|
|
set timeout -1
|
|
} else {
|
|
set timeout [expr $timeout_value + [log_amt_timeout]]
|
|
}
|
|
set exit_result 1
|
|
|
|
spawn /bin/sh -c "$amt_cmd"
|
|
set output_spawn_id $spawn_id
|
|
|
|
set kernel_msg [run_boot_string]
|
|
|
|
expect {
|
|
-i $output_spawn_id $kernel_msg { }
|
|
eof {
|
|
puts stderr "Aborting, received EOF"
|
|
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
|
|
}
|