rev: AsyncResponse => DeferredResponse API cleanup
[rainbows.git] / t / lib-parser-error.sh
blobd8805e3e8e602ef5a7c00a763a46efc2f5e28d43
1 . ./test-lib.sh
2 echo "parser error test for model=$model"
4 eval $(unused_listen)
5 rtmpfiles unicorn_config pid r_err r_out tmp fifo ok
7 cat > $unicorn_config <<EOF
8 listen "$listen"
9 pid "$pid"
10 stderr_path "$r_err"
11 stdout_path "$r_out"
12 Rainbows! { use :$model }
13 EOF
15 rainbows -D env.ru -c $unicorn_config
16 wait_for_pid $pid
19 printf 'GET / HTTP/1/1\r\nHost: example.com\r\n\r\n'
20 cat $fifo > $tmp &
21 wait
22 echo ok > $ok
23 ) | socat - TCP:$listen > $fifo
25 kill $(cat $pid)
27 dbgcat tmp
28 grep -F 'HTTP/1.1 400 Bad Request' $tmp
29 check_stderr