4 t_plan
16 "close pipe response for $model"
6 t_begin
"setup and startup" && {
7 rtmpfiles err out http_fifo sub_ok
10 rainbows
-E none
-D close-pipe-response.ru
-c $unicorn_config
14 t_begin
"read random blob sha1" && {
15 random_blob_sha1
=$
(rsha1
< random_blob
)
18 t_begin
"start FIFO reader" && {
22 t_begin
"single request matches" && {
23 sha1
=$
(curl
-sSfv 2> $err http
://$listen/ | rsha1
)
25 test x
"$sha1" = x
"$random_blob_sha1"
28 t_begin
"body.close called" && {
30 grep CLOSING
$out || die
"body.close not logged"
33 t_begin
"start FIFO reader for abortive HTTP/1.1 request" && {
37 t_begin
"send abortive HTTP/1.1 request" && {
40 printf 'GET /random_blob HTTP/1.1\r\nHost: example.com\r\n\r\n'
41 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
43 ) | socat
- TCP
:$listen > $http_fifo ||
:
44 test xok
= x$
(cat $ok)
47 t_begin
"body.close called for aborted HTTP/1.1 request" && {
49 grep CLOSING
$out || die
"body.close not logged"
52 t_begin
"start FIFO reader for abortive HTTP/1.0 request" && {
56 t_begin
"send abortive HTTP/1.0 request" && {
59 printf 'GET /random_blob HTTP/1.0\r\n\r\n'
60 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
62 ) | socat
- TCP
:$listen > $http_fifo ||
:
63 test xok
= x$
(cat $ok)
66 t_begin
"body.close called for aborted HTTP/1.0 request" && {
68 grep CLOSING
$out || die
"body.close not logged"
71 t_begin
"start FIFO reader for abortive HTTP/0.9 request" && {
75 t_begin
"send abortive HTTP/0.9 request" && {
78 printf 'GET /random_blob\r\n'
79 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
81 ) | socat
- TCP
:$listen > $http_fifo ||
:
82 test xok
= x$
(cat $ok)
85 t_begin
"body.close called for aborted HTTP/0.9 request" && {
87 grep CLOSING
$out || die
"body.close not logged"
90 t_begin
"shutdown server" && {
91 kill -QUIT $rainbows_pid
94 t_begin
"check stderr" && check_stderr