3 test -r random_blob || die
"random_blob required, run with 'make $0'"
4 req_curl_chunked_upload_err_check
6 t_plan
10 "rack.input client_max_body_size bigger"
8 t_begin
"setup and startup" && {
9 rtmpfiles curl_out curl_err
11 ed
-s $unicorn_config <<EOF
12 ,s/client_max_body_size.*/client_max_body_size 10485760/
15 rainbows
-D sha1-random-size.ru
-c $unicorn_config
19 t_begin
"stops a regular request" && {
21 dd if=/dev
/zero bs
=10485761 count
=1 of
=$tmp
22 curl
-vsSf -T $tmp -H Expect
: \
23 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
31 t_begin
"stops a large chunked request" && {
33 dd if=/dev
/zero bs
=10485761 count
=1 | \
34 curl
-vsSf -T- -H Expect
: \
35 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
42 t_begin
"small size sha1 chunked ok" && {
43 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
45 dd if=/dev
/zero bs
=256 count
=1 | \
46 curl
-vsSf -T- -H Expect
: \
47 http
://$listen/ > $curl_out 2> $curl_err
50 test "$(cat $curl_out)" = $blob_sha1
53 t_begin
"small size sha1 content-length ok" && {
54 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
56 dd if=/dev
/zero bs
=256 count
=1 of
=$tmp
57 curl
-vsSf -T $tmp -H Expect
: \
58 http
://$listen/ > $curl_out 2> $curl_err
61 test "$(cat $curl_out)" = $blob_sha1
64 t_begin
"right size sha1 chunked ok" && {
65 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
67 dd if=/dev
/zero bs
=10485760 count
=1 | \
68 curl
-vsSf -T- -H Expect
: \
69 http
://$listen/ > $curl_out 2> $curl_err
72 test "$(cat $curl_out)" = $blob_sha1
75 t_begin
"right size sha1 content-length ok" && {
76 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
78 dd if=/dev
/zero bs
=10485760 count
=1 of
=$tmp
79 curl
-vsSf -T $tmp -H Expect
: \
80 http
://$listen/ > $curl_out 2> $curl_err
84 test "$(cat $curl_out)" = $blob_sha1
87 t_begin
"default size sha1 chunked ok" && {
88 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
90 dd if=/dev
/zero bs
=1048576 count
=1 | \
91 curl
-vsSf -T- -H Expect
: \
92 http
://$listen/ > $curl_out 2> $curl_err
95 test "$(cat $curl_out)" = $blob_sha1
98 t_begin
"default size sha1 content-length ok" && {
99 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
101 dd if=/dev
/zero bs
=1048576 count
=1 of
=$tmp
102 curl
-vsSf -T $tmp -H Expect
: \
103 http
://$listen/ > $curl_out 2> $curl_err
107 test "$(cat $curl_out)" = $blob_sha1
110 t_begin
"shutdown" && {