Rakefile: explain ourselves when Isolating
[rainbows.git] / t / t9001-sendfile-to-path.sh
blobaa75f22522c85d037fdef68d1efec814e42cff33
1 #!/bin/sh
2 . ./test-lib.sh
4 t_plan 7 "Sendfile middleware test for $model"
6 t_begin "configure and start" && {
7 rtmpfiles curl_out curl_err
8 rainbows_setup
10 # do not allow default middleware to be loaded since it may
11 # kill body#to_path
12 rainbows -E none -D t9001.ru -c $unicorn_config
13 rainbows_wait_start
16 t_begin "hit with curl" && {
17 curl -sSfv http://$listen/ > $curl_out 2> $curl_err
20 t_begin "kill server" && {
21 kill $rainbows_pid
24 t_begin "file matches source" && {
25 cmp $curl_out random_blob
28 t_begin "no errors in Rainbows! stderr" && {
29 check_stderr
32 t_begin "X-Sendfile does not show up in headers" && {
33 dbgcat curl_err
34 if grep -i x-sendfile $curl_err
35 then
36 die "X-Sendfile did show up!"
40 t_begin "Content-Length is set correctly in headers" && {
41 expect=$(wc -c < random_blob)
42 grep "^< Content-Length: $expect" $curl_err
45 t_done