3 skip_models StreamResponseEpoll
6 t_info
"skipping $T since /dev/fd is required"
10 t_plan
16 "close pipe to_path response for $model"
12 t_begin
"setup and startup" && {
13 rtmpfiles err out http_fifo sub_ok
16 rainbows
-E none
-D close-pipe-to_path-response.ru
-c $unicorn_config
20 t_begin
"read random blob sha1" && {
21 random_blob_sha1
=$
(rsha1
< random_blob
)
24 t_begin
"start FIFO reader" && {
28 t_begin
"single request matches" && {
29 sha1
=$
(curl
-sSfv 2> $err http
://$listen/ | rsha1
)
31 test x
"$sha1" = x
"$random_blob_sha1"
34 t_begin
"body.close called" && {
36 grep CLOSING
$out || die
"body.close not logged"
39 t_begin
"start FIFO reader for abortive HTTP/1.1 request" && {
43 t_begin
"send abortive HTTP/1.1 request" && {
46 printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
47 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
49 ) | socat
- TCP
:$listen > $http_fifo ||
:
50 test xok
= x$
(cat $ok)
53 t_begin
"body.close called for aborted HTTP/1.1 request" && {
55 grep CLOSING
$out || die
"body.close not logged"
58 t_begin
"start FIFO reader for abortive HTTP/1.0 request" && {
62 t_begin
"send abortive HTTP/1.0 request" && {
65 printf 'GET /random_blob HTTP/1.0\r\n\r\n'
66 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
68 ) | socat
- TCP
:$listen > $http_fifo ||
:
69 test xok
= x$
(cat $ok)
72 t_begin
"body.close called for aborted HTTP/1.0 request" && {
74 grep CLOSING
$out || die
"body.close not logged"
77 t_begin
"start FIFO reader for abortive HTTP/0.9 request" && {
81 t_begin
"send abortive HTTP/0.9 request" && {
84 printf 'GET /random_blob\r\n'
85 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
87 ) | socat
- TCP
:$listen > $http_fifo ||
:
88 test xok
= x$
(cat $ok)
91 t_begin
"body.close called for aborted HTTP/0.9 request" && {
93 grep CLOSING
$out || die
"body.close not logged"
96 t_begin
"shutdown server" && {
97 kill -QUIT $rainbows_pid
100 t_begin
"check stderr" && check_stderr