4 t_plan
10 "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 request" && {
37 t_begin
"send abortive request" && {
39 printf 'GET /random_blob\r\n'
40 dd bs
=4096 count
=1 < $http_fifo >/dev
/null
42 ) | socat
- TCP
:$listen > $http_fifo ||
:
43 test xok
= x$
(cat $ok)
46 t_begin
"body.close called for aborted request" && {
48 grep CLOSING
$out || die
"body.close not logged"
51 t_begin
"shutdown server" && {
52 kill -QUIT $rainbows_pid
55 t_begin
"check stderr" && check_stderr