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 cmbs_config
11 sed -e 's/client_max_body_size.*/client_max_body_size 10485760/' \
12 < $unicorn_config > $cmbs_config
13 rainbows
-D sha1-random-size.ru
-c $cmbs_config
17 t_begin
"stops a regular request" && {
19 dd if=/dev
/zero bs
=102485761 count
=1 of
=$tmp
20 curl
-vsSf -T $tmp -H Expect
: \
21 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
27 t_begin
"stops a large chunked request" && {
29 dd if=/dev
/zero bs
=102485761 count
=1 | \
30 curl
-vsSf -T- -H Expect
: \
31 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
37 t_begin
"small size sha1 chunked ok" && {
38 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
40 dd if=/dev
/zero bs
=256 count
=1 | \
41 curl
-vsSf -T- -H Expect
: \
42 http
://$listen/ > $curl_out 2> $curl_err
45 test "$(cat $curl_out)" = $blob_sha1
48 t_begin
"small size sha1 content-length ok" && {
49 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
51 dd if=/dev
/zero bs
=256 count
=1 of
=$tmp
52 curl
-vsSf -T $tmp -H Expect
: \
53 http
://$listen/ > $curl_out 2> $curl_err
56 test "$(cat $curl_out)" = $blob_sha1
59 t_begin
"right size sha1 chunked ok" && {
60 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
62 dd if=/dev
/zero bs
=10485760 count
=1 | \
63 curl
-vsSf -T- -H Expect
: \
64 http
://$listen/ > $curl_out 2> $curl_err
67 test "$(cat $curl_out)" = $blob_sha1
70 t_begin
"right size sha1 content-length ok" && {
71 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
73 dd if=/dev
/zero bs
=10485760 count
=1 of
=$tmp
74 curl
-vsSf -T $tmp -H Expect
: \
75 http
://$listen/ > $curl_out 2> $curl_err
78 test "$(cat $curl_out)" = $blob_sha1
81 t_begin
"default size sha1 chunked ok" && {
82 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
84 dd if=/dev
/zero bs
=1048576 count
=1 | \
85 curl
-vsSf -T- -H Expect
: \
86 http
://$listen/ > $curl_out 2> $curl_err
89 test "$(cat $curl_out)" = $blob_sha1
92 t_begin
"default size sha1 content-length ok" && {
93 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
95 dd if=/dev
/zero bs
=1048576 count
=1 of
=$tmp
96 curl
-vsSf -T $tmp -H Expect
: \
97 http
://$listen/ > $curl_out 2> $curl_err
100 test "$(cat $curl_out)" = $blob_sha1
103 t_begin
"shutdown" && {