Commit 8bb7e375 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(fix_expect_after): Don't unconditionally add a timeout pattern.

	Contrary to my belief, a timeout pattern seems to refer to a
	specific spawn id.  If we add it here when there are no
	spawned processes, the timeout will refer to stdin, and this
	will cause expect to detect eof on stdin when run from
	Xenofarm.  Instead, everything that spawns a process must add
	timeout patterns to the expect_active variable.
(l2g_start): Add a timeout pattern to expect_active.
(lyskomd_start): Ditto.
(lyskomd_start_fail): Ditto.
(client_start): Ditto.
(client_start_fail): Ditto.
parent b281e8de
......@@ -182,7 +182,7 @@ proc l2g_start {} {
}
set l2g_id $spawn_id
set expect_active($l2g_id) \
" -i $l2g_id eof { fail \"\$test (eof on l2g)\"; wait } -re \"^($deep_any*)$nl\" { fail \"\$test (unexpected line '\$expect_out(1,string)')\" } -re \"($deep_any*)l2g> \" { fail \"\$test (unexpected incomplete line '\$expect_out(1,string)')\" } "
" -i $l2g_id eof { fail \"\$test (eof on l2g)\"; wait } -re \"^($deep_any*)$nl\" { fail \"\$test (unexpected line '\$expect_out(1,string)')\" } -re \"($deep_any*)l2g> \" { fail \"\$test (unexpected incomplete line '\$expect_out(1,string)')\" } timeout { fail \"\$test (timeout on l2g)\" }"
set expect_always($l2g_id) \
" -i $l2g_id full_buffer { fail \"\$test (full_buffer on l2g)\" }"
......@@ -243,7 +243,6 @@ proc fix_expect_after {} {
set stmt "$stmt $expect_active($spawn_id)"
}
set stmt "$stmt timeout { fail \"\$test (timeout)\" }"
verbose "evaluating $stmt" 2
eval $stmt
}
......@@ -510,7 +509,7 @@ proc lyskomd_start {{aux_item_conf_file ""} \
set server_id $spawn_id
set expect_active($server_id) \
" -i $server_id -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line from lyskomd: \$expect_out(1,string))\"; exp_continue } -i $server_id eof { fail \"\$test (eof on lyskomd)\"; wait }"
" -i $server_id -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line from lyskomd: \$expect_out(1,string))\"; exp_continue } -i $server_id eof { fail \"\$test (eof on lyskomd)\"; wait } timeout { fail \"\$test (timeout on lyskomd)\" }"
set expect_always($server_id) \
" -i $server_id full_buffer { fail \"\$test (full_buffer on lyskomd)\" } -i $server_id eof { fail \"\$test (eof on lyskomd)\" }"
......@@ -658,7 +657,7 @@ proc lyskomd_fail_start {log_messages
set server_id $spawn_id
set expect_active($server_id) \
" -i $server_id -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line from lyskomd: \$expect_out(1,string))\"; exp_continue } -i $server_id eof { fail \"\$test (eof on lyskomd)\"; wait }"
" -i $server_id -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line from lyskomd: \$expect_out(1,string))\"; exp_continue } -i $server_id eof { fail \"\$test (eof on lyskomd)\"; wait } timeout { fail \"\$test (timeout on lyskomd)\" }"
set expect_always($server_id) \
" -i $server_id full_buffer { fail \"\$test (full_buffer on lyskomd)\" } -i $server_id eof { fail \"\$test (eof on lyskomd)\" }"
......@@ -986,7 +985,7 @@ proc client_start {nr} {
spawn python $srcdir/tcpconnect.py localhost $clientport MRK:client$nr
set client_id($nr) $spawn_id
set expect_active($client_id($nr)) " -i $client_id($nr) -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line \$expect_out(1,string))\"; exp_continue } "
set expect_active($client_id($nr)) " -i $client_id($nr) -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line \$expect_out(1,string))\"; exp_continue } timeout { fail \"\$test (timeout on client $nr)\" }"
set expect_always($client_id($nr)) \
" -i $client_id($nr) eof { fail \"\$test (eof on client$nr)\"; wait } -i $client_id($nr) full_buffer { fail \"\$test (full_buffer on client$nr)\" } "
......@@ -1012,7 +1011,7 @@ proc client_start_fail {nr {response ""}} {
spawn python $srcdir/tcpconnect.py localhost $clientport MRK:client$nr
set client_id($nr) $spawn_id
set expect_active($client_id($nr)) " -i $client_id($nr) -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line \$expect_out(1,string))\"; exp_continue } "
set expect_active($client_id($nr)) " -i $client_id($nr) -re \"($deep_any*)$nl\" { fail \"\$test (unexpected line \$expect_out(1,string))\"; exp_continue } timeout { fail \"\$test (timeout on client $nr)\" }"
set expect_always($client_id($nr)) \
" -i $client_id($nr) eof { fail \"\$test (eof on client$nr)\"; wait } -i $client_id($nr) full_buffer { fail \"\$test (full_buffer on client$nr)\" } "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment