/
check-repl.expect
executable file
·40 lines (37 loc) · 1.23 KB
/
check-repl.expect
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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