event_machine: protect IO#close from EBADF
[rainbows.git] / t / t0103-rack-input-limit.sh
blob64d6dacd4f4fabb5540ea32c79b0dc171f7741c9
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 6 "rack.input client_max_body_size default"
8 t_begin "setup and startup" && {
9 rtmpfiles curl_out curl_err cmbs_config
10 rainbows_setup $model
11 grep -v client_max_body_size < $unicorn_config > $cmbs_config
12 rainbows -D sha1-random-size.ru -c $cmbs_config
13 rainbows_wait_start
16 t_begin "regular request" && {
17 rm -f $ok
18 curl -vsSf -T random_blob -H Expect: \
19 http://$listen/ > $curl_out 2> $curl_err || > $ok
20 dbgcat curl_err
21 dbgcat curl_out
22 test -e $ok
25 t_begin "chunked request" && {
26 rm -f $ok
27 curl -vsSf -T- < random_blob -H Expect: \
28 http://$listen/ > $curl_out 2> $curl_err || > $ok
29 dbgcat curl_err
30 dbgcat curl_out
31 test -e $ok
34 t_begin "default size sha1 chunked" && {
35 blob_sha1=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
36 rm -f $ok
37 > $r_err
38 dd if=/dev/zero bs=1048576 count=1 | \
39 curl -vsSf -T- -H Expect: \
40 http://$listen/ > $curl_out 2> $curl_err
41 test "$(cat $curl_out)" = $blob_sha1
42 dbgcat curl_err
43 dbgcat curl_out
46 t_begin "default size sha1 content-length" && {
47 blob_sha1=3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
48 rm -f $ok
49 dd if=/dev/zero bs=1048576 count=1 of=$tmp
50 curl -vsSf -T $tmp -H Expect: \
51 http://$listen/ > $curl_out 2> $curl_err
52 test "$(cat $curl_out)" = $blob_sha1
53 dbgcat curl_err
54 dbgcat curl_out
57 t_begin "shutdown" && {
58 kill $rainbows_pid
61 t_done