run: relax IP power plug recognition + serial EOF

* To communicate with IP power plug devices from Koukaam, to remote
  control power supply of test boards, don't parse minor versions, but
  support different IP power plugs
* TCL's expect may report an EOF when reading from the spawned serial
  terminal, especially when using 'socat' to stream serial over TCP/IP,
  although the spawned child is still running and delivering content.
  This problem is clearly not dependent on the characters send, but
  possibly due to strange pipe signals. When piping the serial output
  through 'tr' the problem vanishs.
This commit is contained in:
Stefan Kalkowski 2014-12-03 10:53:07 +01:00 committed by Christian Helmuth
parent 6d391aae10
commit 726c32e5f6
1 changed files with 4 additions and 2 deletions

View File

@ -791,7 +791,7 @@ proc power_plug_connect {} {
spawn telnet $server_ip 1234
set connection_id $spawn_id
expect -i $connection_id "KSHELL V1.3"
expect -i $connection_id "KSHELL V1.*"
send -i $connection_id "login $user_name $password\n"
expect -i $connection_id "250 OK"
@ -887,7 +887,9 @@ proc spawn_serial { wait_for_re timeout_value kernel_msg } {
eval spawn $serial_cmd
# pipe the serial output through 'tr', sometimes expect steps out due to
# unexpected pipe behaviour and reports EOF although the pipe is still active
eval spawn sh -c \"$serial_cmd | tr a a\"
set serial_spawn_id $spawn_id
set timeout 210