t/GNUmakefile: cleanup test dependencies
[rainbows.git] / t / t0041-optional-pool-size.sh
blobf5f640078358b803b545b373a6a28318595bb878
1 #!/bin/sh
2 . ./test-lib.sh
4 case $model in
5 NeverBlock|CoolioThreadPool|XEpollThreadPool) ;;
6 *)
7 t_info "skipping $model.$T since it doesn't support :pool_size"
8 exit
9 ;;
10 esac
12 t_plan 6 "optional :pool_size argument for $model"
14 t_begin "setup and startup" && {
15 rtmpfiles curl_out curl_err
16 rainbows_setup $model
19 t_begin "fails with bad :pool_size" && {
20 ed -s $unicorn_config <<EOF
21 ,s/use :$model/use :$model, :pool_size => -666/
23 EOF
24 grep "pool_size" $unicorn_config
25 rainbows -D env.ru -c $unicorn_config || echo err=$? > $ok
26 test x"$(cat $ok)" = "xerr=1"
29 t_begin "starts with correct :pool_size" && {
30 ed -s $unicorn_config <<EOF
31 ,s/use :$model.*/use :$model, :pool_size => 6/
33 EOF
34 grep "pool_size" $unicorn_config
35 rainbows -D env.ru -c $unicorn_config
36 rainbows_wait_start
39 t_begin "regular TCP request works right" && {
40 curl -sSfv http://$listen/
43 t_begin "no errors in stderr" && {
44 check_stderr
47 t_begin "shutdown" && {
48 kill $rainbows_pid
51 t_done