rev*: avoid hung connections when proxying HTTP/0.9
[rainbows.git] / t / t0501-cramp-rainsocket.sh
blob6e3aea4bae46623d60abc8ce6ca931d60b014c12
1 #!/bin/sh
2 . ./test-lib.sh
3 case $model in
4 EventMachine) ;;
5 *)
6 t_info "skipping $T since it's not compatible with $model"
7 exit 0
8 ;;
9 esac
10 require_check cramp Cramp::VERSION
12 t_plan 4 "WebSocket monkey patch validity test for Cramp"
14 CONFIG_RU=cramp/rainsocket.ru
16 t_begin "setup and start" && {
17 rainbows_setup
18 rtmpfiles curl_err
20 # Like the rest of the EM/async stuff, it's not Rack::Lint compatible
21 rainbows -E deployment -D $CONFIG_RU -c $unicorn_config
22 rainbows_wait_start
25 t_begin "wait for server to say hello to us" && {
26 ok=$((curl --no-buffer -sS http://$listen/ || :) | \
27 awk '/Hello from the Server/ { print "ok"; exit 0 }')
29 test x"$ok" = xok
32 t_begin "termination signal sent" && {
33 kill $rainbows_pid
36 t_begin "no errors in stderr" && check_stderr
38 t_done