3 test -r random_blob || die
"random_blob required, run with 'make $0'"
7 t_info
"skipping $T since it can't load the sendfile gem, yet"
12 t_plan
7 "large sendfile response for $model"
14 t_begin
"setup and startup" && {
15 rtmpfiles curl_out a b c
16 rainbows_setup
$model 2
18 # FIXME: allow "require 'sendfile'" to work in $unicorn_config
22 # can't load Rack::Lint here since it clobbers body#to_path
23 rainbows
-E none
-D large-file-response.ru
-c $unicorn_config
27 t_begin
"read random blob sha1" && {
28 random_blob_sha1
=$
(rsha1
< random_blob
)
31 t_begin
"send a series of HTTP/1.1 requests in parallel" && {
35 curl
-sSf http
://$listen/random_blob | rsha1
> $i
41 test x$
(cat $i) = x
$random_blob_sha1
45 # this was a problem during development
46 t_begin
"HTTP/1.0 test" && {
47 sha1
=$
( (curl
-0 -sSfv http
://$listen/random_blob
&&
48 echo ok
>$ok) | rsha1
)
49 test $sha1 = $random_blob_sha1
50 test xok
= x$
(cat $ok)
53 t_begin
"HTTP/0.9 test" && {
55 printf 'GET /random_blob\r\n'
56 rsha1
< $fifo > $tmp &
59 ) | socat
- TCP
:$listen > $fifo
60 test $
(cat $tmp) = $random_blob_sha1
61 test xok
= x$
(cat $ok)
64 t_begin
"shutdown server" && {
65 kill -QUIT $rainbows_pid
70 t_begin
"check stderr" && check_stderr