coolio+xepoll_thread*: use shutdown() for keepalive timeout
[rainbows.git] / t / t0018-reload-restore-settings.sh
blob3a9471f03f9c270b6c9cfdfae16cff28859824a9
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 8 "reload restore settings for $model"
5 t_begin "setup and start" && {
6 rtmpfiles orig_config
7 rainbows_setup
8 cat $unicorn_config > $orig_config
9 rainbows -D -c $unicorn_config -l $listen env.ru
10 rainbows_wait_start
13 t_begin "HTTP request confirms we're running the correct model" && {
14 curl -sSfv http://$listen/ | grep "\"rainbows.model\"=>:$model"
17 t_begin "clobber config and reload" && {
18 cat > $unicorn_config <<EOF
19 stderr_path "$r_err"
20 EOF
21 kill -HUP $rainbows_pid
22 wait_for_reload
23 wait_for_reap
26 t_begin "HTTP request confirms we're on the default model" && {
27 curl -sSfv http://$listen/ | \
28 grep "\"rainbows.model\"=>:Base" >/dev/null
31 t_begin "restore config and reload" && {
32 cat $orig_config > $unicorn_config
33 > $r_err
34 kill -HUP $rainbows_pid
35 rainbows_wait_start
36 wait_for_reload
37 wait_for_reap
40 t_begin "HTTP request confirms we're back on the correct model" && {
41 curl -sSfv http://$listen/ | \
42 grep "\"rainbows.model\"=>:$model" >/dev/null
45 t_begin "killing succeeds" && {
46 kill $rainbows_pid
49 t_begin "check stderr" && {
50 check_stderr
53 t_done