http_server: kill a warning
[rainbows.git] / t / t0501-cramp-rainsocket.sh
blob762d5ac1e1d7f974ec4efdaba693f6d921fa4270
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 RUBYLIB=$($RUBY test_isolate_cramp.rb):$RUBYLIB
11 export RUBYLIB
12 require_check cramp Cramp::VERSION
14 t_plan 4 "WebSocket monkey patch validity test for Cramp"
16 CONFIG_RU=cramp/rainsocket.ru
18 t_begin "setup and start" && {
19 rainbows_setup
20 rtmpfiles curl_err
22 # Like the rest of the EM/async stuff, it's not Rack::Lint compatible
23 rainbows -E deployment -D $CONFIG_RU -c $unicorn_config
24 rainbows_wait_start
27 t_begin "wait for server to say hello to us" && {
28 ok=$((curl --no-buffer -sS http://$listen/ || :) | \
29 (tr -d '\0\0377' || :) | \
30 awk '/Hello from the Server/ { print "ok"; exit 0 }')
32 test x"$ok" = xok
35 t_begin "termination signal sent" && {
36 kill $rainbows_pid
39 t_begin "no errors in stderr" && check_stderr
41 t_done