local.mk.sample: add a hint for TMPDIR
[rainbows.git] / t / t0105-rack-input-limit-bigger.sh
blob95cadca6cd2de0cf09d65248117fe328cfce4119
1 #!/bin/sh
2 . ./test-lib.sh
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
10 rainbows_setup $model
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
14 rainbows_wait_start
17 t_begin "stops a regular request" && {
18 rm -f $ok
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
22 dbgcat curl_err
23 dbgcat curl_out
24 test -e $ok
27 t_begin "stops a large chunked request" && {
28 rm -f $ok
29 dd if=/dev/zero bs=102485761 count=1 | \
30 curl -vsSf -T- -H Expect: \
31 http://$listen/ > $curl_out 2> $curl_err || > $ok
32 dbgcat curl_err
33 dbgcat curl_out
34 test -e $ok
37 t_begin "small size sha1 chunked ok" && {
38 blob_sha1=b376885ac8452b6cbf9ced81b1080bfd570d9b91
39 rm -f $ok
40 dd if=/dev/zero bs=256 count=1 | \
41 curl -vsSf -T- -H Expect: \
42 http://$listen/ > $curl_out 2> $curl_err
43 dbgcat curl_err
44 dbgcat curl_out
45 test "$(cat $curl_out)" = $blob_sha1
48 t_begin "small size sha1 content-length ok" && {
49 blob_sha1=b376885ac8452b6cbf9ced81b1080bfd570d9b91
50 rm -f $ok
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
54 dbgcat curl_err
55 dbgcat curl_out
56 test "$(cat $curl_out)" = $blob_sha1
59 t_begin "right size sha1 chunked ok" && {
60 blob_sha1=8c206a1a87599f532ce68675536f0b1546900d7a
61 rm -f $ok
62 dd if=/dev/zero bs=10485760 count=1 | \
63 curl -vsSf -T- -H Expect: \
64 http://$listen/ > $curl_out 2> $curl_err
65 dbgcat curl_err
66 dbgcat curl_out
67 test "$(cat $curl_out)" = $blob_sha1
70 t_begin "right size sha1 content-length ok" && {
71 blob_sha1=8c206a1a87599f532ce68675536f0b1546900d7a
72 rm -f $ok
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
76 dbgcat curl_err
77 dbgcat curl_out
78 test "$(cat $curl_out)" = $blob_sha1
81 t_begin "default size sha1 chunked ok" && {
82 blob_sha1=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
83 rm -f $ok
84 dd if=/dev/zero bs=1048576 count=1 | \
85 curl -vsSf -T- -H Expect: \
86 http://$listen/ > $curl_out 2> $curl_err
87 dbgcat curl_err
88 dbgcat curl_out
89 test "$(cat $curl_out)" = $blob_sha1
92 t_begin "default size sha1 content-length ok" && {
93 blob_sha1=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
94 rm -f $ok
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
98 dbgcat curl_err
99 dbgcat curl_out
100 test "$(cat $curl_out)" = $blob_sha1
103 t_begin "shutdown" && {
104 kill $rainbows_pid
107 t_done