Rainbows! 0.96.0 - range support
[rainbows.git] / t / t0501-cramp-rainsocket.sh
bloba64145a57a4b553fddac9fc5c4c8f1874a324295
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 (tr -d '\0\0377' || :) | \
28 awk '/Hello from the Server/ { print "ok"; exit 0 }')
30 test x"$ok" = xok
33 t_begin "termination signal sent" && {
34 kill $rainbows_pid
37 t_begin "no errors in stderr" && check_stderr
39 t_done