tests: port all existing tests to TAP library
[rainbows.git] / t / lib-graceful.sh
blob45008a52285a749f57ba9c2ce13fb76bb3a5e374
1 . ./test-lib.sh
3 t_plan 4 "graceful exit test for $model"
5 t_begin "setup and startup" && {
6 rtmpfiles curl_out
7 rainbows_setup $model
8 rainbows -D sleep.ru -c $unicorn_config
9 rainbows_wait_start
12 t_begin "send a request and SIGQUIT while request is processing" && {
13 curl -sSfv -T- </dev/null http://$listen/5 > $curl_out 2> $fifo &
14 awk -v rainbows_pid=$rainbows_pid '
15 { print $0 }
16 /100 Continue/ {
17 print "awk: sending SIGQUIT to", rainbows_pid
18 system("kill -QUIT "rainbows_pid)
19 }' $fifo
20 wait
23 dbgcat r_err
25 t_begin 'response returned "Hello"' && {
26 test x$(cat $curl_out) = xHello
29 t_begin 'stderr has no errors' && check_stderr
31 t_done