test for client_max_body_size being zero
[rainbows.git] / t / t0107-rack-input-limit-zero.sh
blobeb947baff3cc7e897a9b914f9b1939dbf29b59c9
1 #!/bin/sh
2 . ./test-lib.sh
3 req_curl_chunked_upload_err_check
5 t_plan 6 "rack.input client_max_body_size zero"
7 t_begin "setup and startup" && {
8 rtmpfiles curl_out curl_err cmbs_config
9 rainbows_setup $model
10 sed -e 's/client_max_body_size.*/client_max_body_size 0/' \
11 < $unicorn_config > $cmbs_config
12 rainbows -D sha1-random-size.ru -c $cmbs_config
13 rainbows_wait_start
14 empty_sha1=da39a3ee5e6b4b0d3255bfef95601890afd80709
17 t_begin "regular request" && {
18 curl -vsSf -H Expect: http://$listen/ > $curl_out 2> $curl_err
19 dbgcat curl_err
20 dbgcat curl_out
21 test x"$(cat $curl_out)" = x$empty_sha1
24 t_begin "chunked request" && {
25 curl -vsSf -T- < /dev/null -H Expect: \
26 http://$listen/ > $curl_out 2> $curl_err
27 dbgcat curl_err
28 dbgcat curl_out
29 test x"$(cat $curl_out)" = x$empty_sha1
32 t_begin "small input chunked" && {
33 rm -f $ok
34 echo | \
35 curl -vsSf -T- -H Expect: \
36 http://$listen/ > $curl_out 2> $curl_err || > $ok
37 dbgcat curl_err
38 dbgcat curl_out
39 fgrep 413 $curl_err
40 test -e $ok
43 t_begin "small input content-length" && {
44 rm -f $ok
45 echo > $tmp
46 curl -vsSf -T $tmp -H Expect: \
47 http://$listen/ > $curl_out 2> $curl_err || > $ok
48 fgrep 413 $curl_err
49 dbgcat curl_err
50 dbgcat curl_out
51 test -e $ok
54 t_begin "shutdown" && {
55 kill $rainbows_pid
58 t_done