From e7f3e99aab005696358e3e93e5ae9182a28919b3 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 10 Mar 2014 10:34:45 +0100 Subject: [PATCH] tool: test result output of amtterm reset "amtterm reset" returns 0 as exitcode even if the reset command failed. So check explicitly the output of the command to detect the error case. --- tool/run | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tool/run b/tool/run index ba0bf66e24..1fca39c5cc 100755 --- a/tool/run +++ b/tool/run @@ -595,6 +595,7 @@ proc spawn_amt { wait_for_re timeout_value } { set exit_result 1 while { $exit_result != 0 } { + set try_again 0 set time_start [ clock seconds ] spawn amttool $::env(AMT_TEST_MACHINE_IP) reset expect { @@ -602,6 +603,11 @@ proc spawn_amt { wait_for_re timeout_value } { eof { puts "Error: amttool died unexpectedly"; exit -4 } timeout { puts "Error: amttool timed out"; exit -5 } } + expect { + "result: pt_status: success" { break } + eof { set try_again 1 } + timeout { puts "Error: amttool timed out"; exit -6 } + } catch wait result set time_end [ clock seconds ] if {[expr $time_end - $time_start] <= 1} { @@ -612,6 +618,10 @@ proc spawn_amt { wait_for_re timeout_value } { if {$timeout < 0} { set timeout 0 } + if {$try_again != 0 } { + continue + } + set exit_result [lindex $result 3] } sleep 5