3 test -r random_blob || die
"random_blob required, run with 'make $0'"
6 ThreadSpawn|WriterThreadSpawn|ThreadPool|WriterThreadPool|Base
) ;;
9 t_info
"skipping $T since it doesn't use copy_stream"
14 t_plan
7 "large file 'copy_stream nil' test for $model"
16 t_begin
"setup and startup" && {
19 cat >> $unicorn_config <<EOF
24 rainbows
-E none
-D large-file-response.ru
-c $unicorn_config
28 t_begin
"read random blob sha1 and size" && {
29 random_blob_sha1
=$
(rsha1
< random_blob
)
30 random_blob_size
=$
(wc -c < random_blob
)
33 t_begin
"send a series HTTP/1.1 requests sequentially" && {
36 sha1
=$
( (curl
-sSfv http
://$listen/random_blob
&&
37 echo ok
>$ok) | rsha1
)
38 test $sha1 = $random_blob_sha1
39 test xok
= x$
(cat $ok)
43 # this was a problem during development
44 t_begin
"HTTP/1.0 test" && {
45 sha1
=$
( (curl
-0 -sSfv http
://$listen/random_blob
&&
46 echo ok
>$ok) | rsha1
)
47 test $sha1 = $random_blob_sha1
48 test xok
= x$
(cat $ok)
51 t_begin
"HTTP/0.9 test" && {
53 printf 'GET /random_blob\r\n'
54 rsha1
< $fifo > $tmp &
57 ) | socat
- TCP
:$listen > $fifo
58 test $
(cat $tmp) = $random_blob_sha1
59 test xok
= x$
(cat $ok)
62 t_begin
"shutdown server" && {
63 kill -QUIT $rainbows_pid
66 t_begin
"check stderr" && check_stderr