unicorn 4.6.2 - HTTP parser fix for Rainbows!
[unicorn.git] / t / t0000-http-basic.sh
blob8ab58ac687d28a095ba831588bc9c1905485a59c
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 8 "simple HTTP connection tests"
5 t_begin "setup and start" && {
6 unicorn_setup
7 unicorn -D -c $unicorn_config env.ru
8 unicorn_wait_start
11 t_begin "single request" && {
12 curl -sSfv http://$listen/
15 t_begin "check stderr has no errors" && {
16 check_stderr
19 t_begin "HTTP/0.9 request should not return headers" && {
21 printf 'GET /\r\n'
22 cat $fifo > $tmp &
23 wait
24 echo ok > $ok
25 ) | socat - TCP:$listen > $fifo
28 t_begin "env.inspect should've put everything on one line" && {
29 test 1 -eq $(count_lines < $tmp)
32 t_begin "no headers in output" && {
33 if grep ^Connection: $tmp
34 then
35 die "Connection header found in $tmp"
36 elif grep ^HTTP/ $tmp
37 then
38 die "HTTP/ found in $tmp"
42 t_begin "killing succeeds" && {
43 kill $unicorn_pid
46 t_begin "check stderr has no errors" && {
47 check_stderr
50 t_done