Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 41 lines (37 sloc) 1.23 KB
#!/usr/bin/expect
set timeout 2
spawn /home/pi/code/netv2-tests/bin/flterm/flterm --port /dev/ttyAMA0 --speed 115200
set try 0
expect {
"TESTER_NX8D" {
set tpid [exp_pid -i $spawn_id]
exec kill -9 $tpid
exit 0
}
"BIOS>" {
puts " "
puts " "
# output a dummy line to clear line corruption from bad/problematic firmware
puts "{\"model\":\"NeTV2MVP\", \"rev\":\"PVT1C\", \"tester_rev\":\"1\", \"dna\":\"-1\", \"time\":-1, \"subtest\":\"RAM\", \"msg\": \[\{\"Failed to load firmware, check DDR path!\":1\}\] }"
puts "{\"model\":\"NeTV2MVP\", \"rev\":\"PVT1C\", \"tester_rev\":\"1\", \"dna\":\"-1\", \"time\":-1, \"subtest\":\"RAM\", \"msg\": \[\{\"errcnt\":1\}\] }"
puts "{\"model\":\"NeTV2MVP\", \"rev\":\"PVT1C\", \"tester_rev\":\"1\", \"dna\":\"-1\", \"end_time\":0, \"test_errcount\":1 }"
puts "Failure: Firmware did not load, check for RAM errors"
set tpid [exp_pid -i $spawn_id]
exec kill -9 $tpid
exit 1
}
timeout {
if {$try < 30} {
send "\n\r"
incr try
exp_continue
}
set tpid [exp_pid -i $spawn_id]
exec kill -9 $tpid
puts "Failure: Tester REPL prompt"
exit 1
}
}
# kill the flterm so it doesn't hang around and muck with the next process
set tpid [exp_pid -i $spawn_id]
exec kill -9 $tpid