stream_response_epoll: our most "special" concurrency option yet
[rainbows.git] / t / t9001-sendfile-to-path.sh
blob5a9fdcd17fa826387a308348c34168e37cea6d2d
1 #!/bin/sh
2 . ./test-lib.sh
3 skip_models StreamResponseEpoll
5 t_plan 7 "Sendfile middleware test for $model"
7 t_begin "configure and start" && {
8 rtmpfiles curl_err
9 rainbows_setup
11 # do not allow default middleware to be loaded since it may
12 # kill body#to_path
13 rainbows -E none -D t9001.ru -c $unicorn_config
14 rainbows_wait_start
15 random_blob_sha1=$(rsha1 < random_blob)
18 t_begin "hit with curl" && {
19 sha1=$(curl -sSfv http://$listen/ 2> $curl_err | rsha1)
22 t_begin "kill server" && {
23 kill $rainbows_pid
26 t_begin "SHA1 matches source" && {
27 test x$random_blob_sha1 = x$sha1
30 t_begin "no errors in Rainbows! stderr" && {
31 check_stderr
34 t_begin "X-Sendfile does not show up in headers" && {
35 dbgcat curl_err
36 if grep -i x-sendfile $curl_err
37 then
38 die "X-Sendfile did show up!"
42 t_begin "Content-Length is set correctly in headers" && {
43 expect=$(wc -c < random_blob)
44 grep "^< Content-Length: $expect" $curl_err
47 t_done