5 t_info
"skipping $T since /dev/fd is required"
9 t_plan
16 "close pipe to_path response for $model"
11 t_begin
"setup and startup" && {
12 rtmpfiles err out http_fifo sub_ok
15 rainbows
-E none
-D close-pipe-to_path-response.ru
-c $unicorn_config
19 t_begin
"read random blob sha1" && {
20 random_blob_sha1
=$
(rsha1
< random_blob
)
23 t_begin
"start FIFO reader" && {
27 t_begin
"single request matches" && {
28 sha1
=$
(curl
-sSfv 2> $err http
://$listen/ | rsha1
)
30 test x
"$sha1" = x
"$random_blob_sha1"
33 t_begin
"body.close called" && {
35 grep CLOSING
$out || die
"body.close not logged"
38 t_begin
"start FIFO reader for abortive HTTP/1.1 request" && {
42 t_begin
"send abortive HTTP/1.1 request" && {
45 printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
46 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
48 ) | socat
- TCP
:$listen > $http_fifo ||
:
49 test xok
= x$
(cat $ok)
52 t_begin
"body.close called for aborted HTTP/1.1 request" && {
54 grep CLOSING
$out || die
"body.close not logged"
57 t_begin
"start FIFO reader for abortive HTTP/1.0 request" && {
61 t_begin
"send abortive HTTP/1.0 request" && {
64 printf 'GET /random_blob HTTP/1.0\r\n\r\n'
65 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
67 ) | socat
- TCP
:$listen > $http_fifo ||
:
68 test xok
= x$
(cat $ok)
71 t_begin
"body.close called for aborted HTTP/1.0 request" && {
73 grep CLOSING
$out || die
"body.close not logged"
76 t_begin
"start FIFO reader for abortive HTTP/0.9 request" && {
80 t_begin
"send abortive HTTP/0.9 request" && {
83 printf 'GET /random_blob\r\n'
84 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
86 ) | socat
- TCP
:$listen > $http_fifo ||
:
87 test xok
= x$
(cat $ok)
90 t_begin
"body.close called for aborted HTTP/0.9 request" && {
92 grep CLOSING
$out || die
"body.close not logged"
95 t_begin
"shutdown server" && {
96 kill -QUIT $rainbows_pid
99 t_begin
"check stderr" && check_stderr