3 test -r random_blob || die
"random_blob required, run with 'make $0'"
6 t_plan
7 "large file 'copy_stream nil' test for $model"
8 t_begin
"setup and startup" && {
11 cat >> $unicorn_config <<EOF
16 rainbows
-E none
-D large-file-response.ru
-c $unicorn_config
20 t_begin
"read random blob sha1 and size" && {
21 random_blob_sha1
=$
(rsha1
< random_blob
)
22 random_blob_size
=$
(count_bytes
< random_blob
)
25 t_begin
"send a series HTTP/1.1 requests sequentially" && {
28 sha1
=$
( (curl
-sSfv http
://$listen/random_blob
&&
29 echo ok
>$ok) | rsha1
)
30 test $sha1 = $random_blob_sha1
31 test xok
= x$
(cat $ok)
35 # this was a problem during development
36 t_begin
"HTTP/1.0 test" && {
37 sha1
=$
( (curl
-0 -sSfv http
://$listen/random_blob
&&
38 echo ok
>$ok) | rsha1
)
39 test $sha1 = $random_blob_sha1
40 test xok
= x$
(cat $ok)
43 t_begin
"HTTP/0.9 test" && {
45 printf 'GET /random_blob\r\n'
46 rsha1
< $fifo > $tmp &
49 ) | socat
- TCP
:$listen > $fifo
50 test $
(cat $tmp) = $random_blob_sha1
51 test xok
= x$
(cat $ok)
54 t_begin
"shutdown server" && {
55 kill -QUIT $rainbows_pid
58 t_begin
"check stderr" && check_stderr