tee_input: fix accounting error on corked requests
[unicorn.git] / t / t0002-parser-error.sh
blob9a3e7cfd58761b80424a9c05473b3483f6076c88
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 5 "parser error test"
5 t_begin "setup and startup" && {
6 unicorn_setup
7 unicorn -D env.ru -c $unicorn_config
8 unicorn_wait_start
11 t_begin "send a bad request" && {
13 printf 'GET / HTTP/1/1\r\nHost: example.com\r\n\r\n'
14 cat $fifo > $tmp &
15 wait
16 echo ok > $ok
17 ) | socat - TCP:$listen > $fifo
18 test xok = x$(cat $ok)
21 dbgcat tmp
23 t_begin "response should be a 400" && {
24 grep -F 'HTTP/1.1 400 Bad Request' $tmp
27 t_begin "server stderr should be clean" && check_stderr
29 t_begin "term signal sent" && kill $unicorn_pid
31 t_done