t/GNUmakefile: cleanup test dependencies
[rainbows.git] / t / t0002-parser-error.sh
blobc4e5ab7605ff6c37a0402aa33adac4cdded106c3
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 5 "parser error test for $model"
5 t_begin "setup and startup" && {
6 rainbows_setup $model
7 rainbows -D env.ru -c $unicorn_config
8 rainbows_wait_start
11 t_begin "send 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 $rainbows_pid
31 t_done