about summary refs log tree commit homepage
path: root/t/t0501-cramp-rainsocket.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0501-cramp-rainsocket.sh')
-rwxr-xr-xt/t0501-cramp-rainsocket.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t0501-cramp-rainsocket.sh b/t/t0501-cramp-rainsocket.sh
new file mode 100755
index 0000000..6e3aea4
--- /dev/null
+++ b/t/t0501-cramp-rainsocket.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+. ./test-lib.sh
+case $model in
+EventMachine) ;;
+*)
+        t_info "skipping $T since it's not compatible with $model"
+        exit 0
+        ;;
+esac
+require_check cramp Cramp::VERSION
+
+t_plan 4 "WebSocket monkey patch validity test for Cramp"
+
+CONFIG_RU=cramp/rainsocket.ru
+
+t_begin "setup and start" && {
+        rainbows_setup
+        rtmpfiles curl_err
+
+        # Like the rest of the EM/async stuff, it's not Rack::Lint compatible
+        rainbows -E deployment -D $CONFIG_RU -c $unicorn_config
+        rainbows_wait_start
+}
+
+t_begin "wait for server to say hello to us" && {
+        ok=$((curl --no-buffer -sS http://$listen/ || :) | \
+             awk '/Hello from the Server/ { print "ok"; exit 0 }')
+
+        test x"$ok" = xok
+}
+
+t_begin "termination signal sent" && {
+        kill $rainbows_pid
+}
+
+t_begin "no errors in stderr" && check_stderr
+
+t_done