3 skip_models StreamResponseEpoll
5 t_plan
16 "close pipe response for $model"
7 t_begin
"setup and startup" && {
8 rtmpfiles err out http_fifo sub_ok
11 rainbows
-E none
-D close-pipe-response.ru
-c $unicorn_config
15 t_begin
"read random blob sha1" && {
16 random_blob_sha1
=$
(rsha1
< random_blob
)
19 t_begin
"start FIFO reader" && {
23 t_begin
"single request matches" && {
24 sha1
=$
(curl
-sSfv 2> $err http
://$listen/ | rsha1
)
26 test x
"$sha1" = x
"$random_blob_sha1"
29 t_begin
"body.close called" && {
31 grep CLOSING
$out || die
"body.close not logged"
34 t_begin
"start FIFO reader for abortive HTTP/1.1 request" && {
38 t_begin
"send abortive HTTP/1.1 request" && {
41 printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
42 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
44 ) | socat
- TCP
:$listen > $http_fifo ||
:
45 test xok
= x$
(cat $ok)
48 t_begin
"body.close called for aborted HTTP/1.1 request" && {
50 grep CLOSING
$out || die
"body.close not logged"
53 t_begin
"start FIFO reader for abortive HTTP/1.0 request" && {
57 t_begin
"send abortive HTTP/1.0 request" && {
60 printf 'GET /random_blob HTTP/1.0\r\n\r\n'
61 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
63 ) | socat
- TCP
:$listen > $http_fifo ||
:
64 test xok
= x$
(cat $ok)
67 t_begin
"body.close called for aborted HTTP/1.0 request" && {
69 grep CLOSING
$out || die
"body.close not logged"
72 t_begin
"start FIFO reader for abortive HTTP/0.9 request" && {
76 t_begin
"send abortive HTTP/0.9 request" && {
79 printf 'GET /random_blob\r\n'
80 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
82 ) | socat
- TCP
:$listen > $http_fifo ||
:
83 test xok
= x$
(cat $ok)
86 t_begin
"body.close called for aborted HTTP/0.9 request" && {
88 grep CLOSING
$out || die
"body.close not logged"
91 t_begin
"shutdown server" && {
92 kill -QUIT $rainbows_pid
95 t_begin
"check stderr" && check_stderr