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
28 if ! grep 413 $curl_err
30 # send error as documented in curl(1) manpage
31 grep -F '(55)' $curl_err
36 t_begin
"stops a large chunked request" && {
38 dd if=/dev
/zero bs
=10485761 count
=1 | \
39 curl
-vsSf -T- -H Expect
: \
40 http
://$listen/ > $curl_out 2> $curl_err ||
> $ok
43 if ! grep 413 $curl_err
45 # send error as documented in curl(1) manpage
46 grep -F '(55)' $curl_err
51 t_begin
"small size sha1 chunked ok" && {
52 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
54 dd if=/dev
/zero bs
=256 count
=1 | \
55 curl
-vsSf -T- -H Expect
: \
56 http
://$listen/ > $curl_out 2> $curl_err
59 test "$(cat $curl_out)" = $blob_sha1
62 t_begin
"small size sha1 content-length ok" && {
63 blob_sha1
=b376885ac8452b6cbf9ced81b1080bfd570d9b91
65 dd if=/dev
/zero bs
=256 count
=1 of
=$tmp
66 curl
-vsSf -T $tmp -H Expect
: \
67 http
://$listen/ > $curl_out 2> $curl_err
70 test "$(cat $curl_out)" = $blob_sha1
73 t_begin
"right size sha1 chunked ok" && {
74 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
76 dd if=/dev
/zero bs
=10485760 count
=1 | \
77 curl
-vsSf -T- -H Expect
: \
78 http
://$listen/ > $curl_out 2> $curl_err
81 test "$(cat $curl_out)" = $blob_sha1
84 t_begin
"right size sha1 content-length ok" && {
85 blob_sha1
=8c206a1a87599f532ce68675536f0b1546900d7a
87 dd if=/dev
/zero bs
=10485760 count
=1 of
=$tmp
88 curl
-vsSf -T $tmp -H Expect
: \
89 http
://$listen/ > $curl_out 2> $curl_err
93 test "$(cat $curl_out)" = $blob_sha1
96 t_begin
"default size sha1 chunked ok" && {
97 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
99 dd if=/dev
/zero bs
=1048576 count
=1 | \
100 curl
-vsSf -T- -H Expect
: \
101 http
://$listen/ > $curl_out 2> $curl_err
104 test "$(cat $curl_out)" = $blob_sha1
107 t_begin
"default size sha1 content-length ok" && {
108 blob_sha1
=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
110 dd if=/dev
/zero bs
=1048576 count
=1 of
=$tmp
111 curl
-vsSf -T $tmp -H Expect
: \
112 http
://$listen/ > $curl_out 2> $curl_err
116 test "$(cat $curl_out)" = $blob_sha1
119 t_begin
"shutdown" && {