tests: port all existing tests to TAP library
[rainbows.git] / t / lib-parser-error.sh
blob2b35b175e497d2fb6d91830ffe7f40d2882c5840
1 . ./test-lib.sh
2 t_plan 5 "parser error test for $model"
4 t_begin "setup and startup" && {
5 rainbows_setup $model
6 rainbows -D env.ru -c $unicorn_config
7 rainbows_wait_start
10 t_begin "send request" && {
12 printf 'GET / HTTP/1/1\r\nHost: example.com\r\n\r\n'
13 cat $fifo > $tmp &
14 wait
15 echo ok > $ok
16 ) | socat - TCP:$listen > $fifo
17 test xok = x$(cat $ok)
20 dbgcat tmp
22 t_begin "response should be a 400" && {
23 grep -F 'HTTP/1.1 400 Bad Request' $tmp
26 t_begin "server stderr should be clean" && check_stderr
28 t_begin "term signal sent" && kill $rainbows_pid
30 t_done