6 t_info
"skipping $T since it's not compatible with $model"
10 require_check cramp Cramp
::VERSION
12 t_plan
7 "streaming test for Cramp"
14 CONFIG_RU
=cramp
/streaming.ru
16 t_begin
"setup and start" && {
18 rtmpfiles a b c curl_err expect
20 # requiring Rubygems for this test only since Cramp depends on
21 # pre versions of several gems
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
27 # this will spew any unexpected input to stdout and be silent on success
31 while read hello world
35 t_info
"i=$i diff=$diff hello=$hello world=$world"
36 test $diff -ge 1 ||
echo "$i: diff: $diff < 1 second"
38 test xHello
= x
"$hello" ||
echo "$i: Hello != $hello"
39 test xWorld
= x
"$world" ||
echo "$i: World != $world"
41 test $i -le 3 ||
echo "$i: $i > 3"
46 t_begin
"send async requests off in parallel" && {
48 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$a 2>&1 &
49 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$b 2>&1 &
50 curl
--no-buffer -sSf http
://$listen/ 2>> $curl_err | check
>$c 2>&1 &
53 t_begin
"wait for curl terminations" && {
56 elapsed
=$
(( $t1 - $t0 ))
57 t_info
"elapsed=$elapsed (should be 4-5s)"
60 t_begin
"termination signal sent" && {
64 t_begin
"no errors from curl" && {
68 t_begin
"no errors in stderr" && check_stderr
70 t_begin
"silence is golden" && {