Revert "http_server: cap timeout at 32-bit LONG_MAX seconds"
[rainbows.git] / t / t0042-client_header_buffer_size.sh
blob0e1936140125df56939ca9e12e2f0cf1b12dce79
1 #!/bin/sh
2 . ./test-lib.sh
4 t_plan 8 "client_header_buffer_size tests for $model"
6 t_begin "setup and startup" && {
7 rainbows_setup $model
10 t_begin "fails with zero buffer size" && {
11 ed -s $unicorn_config <<EOF
12 ,s/^ client_max_body_size.*/ client_header_buffer_size 0/
14 EOF
15 grep "client_header_buffer_size 0" $unicorn_config
16 rainbows -D client_header_buffer_size.ru -c $unicorn_config || \
17 echo err=$? > $ok
18 test x"$(cat $ok)" = "xerr=1"
21 t_begin "fails with negative value" && {
22 ed -s $unicorn_config <<EOF
23 ,s/^ client_header_buffer_size.*/ client_header_buffer_size -1/
25 EOF
26 grep "client_header_buffer_size -1" $unicorn_config
27 rainbows -D client_header_buffer_size.ru -c $unicorn_config || \
28 echo err=$? > $ok
29 test x"$(cat $ok)" = "xerr=1"
32 t_begin "fails with negative value" && {
33 ed -s $unicorn_config <<EOF
34 ,s/^ client_header_buffer_size.*/ client_header_buffer_size -1/
36 EOF
37 grep "client_header_buffer_size -1" $unicorn_config
38 rainbows -D client_header_buffer_size.ru -c $unicorn_config || \
39 echo err=$? > $ok
40 test x"$(cat $ok)" = "xerr=1"
43 t_begin "starts with correct value" && {
44 ed -s $unicorn_config <<EOF
45 ,s/^ client_header_buffer_size.*/ client_header_buffer_size 16399/
47 EOF
48 grep "client_header_buffer_size 16399" $unicorn_config
49 rainbows -D client_header_buffer_size.ru -c $unicorn_config
50 rainbows_wait_start
53 t_begin "regular TCP request works right" && {
54 test x$(curl -sSfv http://$listen/) = x16399
57 t_begin "no errors in stderr" && {
58 check_stderr
61 t_begin "shutdown" && {
62 kill $rainbows_pid
65 t_done