coolio+xepoll_thread*: use shutdown() for keepalive timeout
[rainbows.git] / t / t0002-graceful.sh
blobc3ff27e3dadc1d1501f16d6073fe442207ba26c3
1 #!/bin/sh
2 . ./test-lib.sh
4 t_plan 4 "graceful exit test for $model"
6 t_begin "setup and startup" && {
7 rtmpfiles curl_out
8 rainbows_setup $model
9 rainbows -D sleep.ru -c $unicorn_config
10 rainbows_wait_start
13 t_begin "send a request and SIGQUIT while request is processing" && {
14 curl -sSfv -T- </dev/null http://$listen/5 > $curl_out 2> $fifo &
15 awk -v rainbows_pid=$rainbows_pid '
16 { print $0 }
17 /100 Continue/ {
18 print "awk: sending SIGQUIT to", rainbows_pid
19 system("kill -QUIT "rainbows_pid)
20 }' $fifo
21 wait
24 dbgcat r_err
26 t_begin 'response returned "Hello"' && {
27 test x$(cat $curl_out) = xHello
30 t_begin 'stderr has no errors' && check_stderr
32 t_done