3 skip_models StreamResponseEpoll
4 test -r random_blob || die
"random_blob required, run with 'make $0'"
5 req_curl_chunked_upload_err_check
7 t_plan
10 "rack.input client_max_body_size bigger"
9 t_begin
"setup and startup" && {
10 rtmpfiles curl_out curl_err
12 ed
-s $unicorn_config <<EOF
13 ,s/client_max_body_size.*/client_max_body_size 10485760/
16 rainbows
-D sha1-random-size.ru
-c $unicorn_config
20 t_begin
"stops a regular request" && {
22 dd if=/dev
/zero bs
=10485761 count
=1 of
=$tmp
23 curl
-vsSf -T $tmp -H Expect
: \
24 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
32 t_begin
"stops a large chunked request" && {
34 dd if=/dev
/zero bs
=10485761 count
=1 | \
35 curl
-vsSf -T- -H Expect
: \
36 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
43 t_begin
"small size sha1 chunked ok" && {
44 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
46 dd if=/dev
/zero bs
=256 count
=1 | \
47 curl
-vsSf -T- -H Expect
: \
48 http
://$listen/ > $curl_out 2> $curl_err
51 test "$(cat $curl_out)" = $blob_sha1
54 t_begin
"small size sha1 content-length ok" && {
55 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
57 dd if=/dev
/zero bs
=256 count
=1 of
=$tmp
58 curl
-vsSf -T $tmp -H Expect
: \
59 http
://$listen/ > $curl_out 2> $curl_err
62 test "$(cat $curl_out)" = $blob_sha1
65 t_begin
"right size sha1 chunked ok" && {
66 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
68 dd if=/dev
/zero bs
=10485760 count
=1 | \
69 curl
-vsSf -T- -H Expect
: \
70 http
://$listen/ > $curl_out 2> $curl_err
73 test "$(cat $curl_out)" = $blob_sha1
76 t_begin
"right size sha1 content-length ok" && {
77 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
79 dd if=/dev
/zero bs
=10485760 count
=1 of
=$tmp
80 curl
-vsSf -T $tmp -H Expect
: \
81 http
://$listen/ > $curl_out 2> $curl_err
85 test "$(cat $curl_out)" = $blob_sha1
88 t_begin
"default size sha1 chunked ok" && {
89 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
91 dd if=/dev
/zero bs
=1048576 count
=1 | \
92 curl
-vsSf -T- -H Expect
: \
93 http
://$listen/ > $curl_out 2> $curl_err
96 test "$(cat $curl_out)" = $blob_sha1
99 t_begin
"default size sha1 content-length ok" && {
100 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
102 dd if=/dev
/zero bs
=1048576 count
=1 of
=$tmp
103 curl
-vsSf -T $tmp -H Expect
: \
104 http
://$listen/ > $curl_out 2> $curl_err
108 test "$(cat $curl_out)" = $blob_sha1
111 t_begin
"shutdown" && {