add "copy_stream" config directive
[rainbows.git] / t / t0026-splice-copy_stream-byte-range.sh
blob70546b65f7e9a2e94351a92e3a57901490341c6d
1 #!/bin/sh
2 . ./test-lib.sh
3 test -r random_blob || die "random_blob required, run with 'make $0'"
4 case $RUBY_VERSION in
5 1.9.*) ;;
6 *)
7 t_info "skipping $T since it can't IO::Splice.copy_stream"
8 exit 0
9 ;;
10 esac
11 check_splice
13 case $model in
14 ThreadSpawn|WriterThreadSpawn|ThreadPool|WriterThreadPool|Base) ;;
15 XEpollThreadSpawn) ;;
17 t_info "skipping $T since it doesn't use copy_stream"
18 exit 0
20 esac
22 t_plan 13 "IO::Splice.copy_stream byte range response for $model"
24 t_begin "setup and startup" && {
25 rtmpfiles out err
26 rainbows_setup $model
27 cat >> $unicorn_config <<EOF
28 require "io/splice"
29 Rainbows! do
30 copy_stream IO::Splice
31 end
32 def (::IO).copy_stream(*x); abort "NO"; end
33 EOF
35 # can't load Rack::Lint here since it clobbers body#to_path
36 rainbows -E none -D large-file-response.ru -c $unicorn_config
37 rainbows_wait_start
40 . ./byte-range-common.sh