3 test -r random_blob || die
"random_blob required, run with 'make $0'"
7 t_info
"skipping $T since it's not compatible with $model"
12 t_plan
10 "fast Kgio pipe response for $model"
14 t_begin
"setup and startup" && {
17 rainbows
-E none
-D kgio-pipe-response.ru
-c $unicorn_config
21 t_begin
"read random blob sha1" && {
22 random_blob_sha1
=$
(rsha1
< random_blob
)
23 three_sha1
=$
(cat random_blob random_blob random_blob | rsha1
)
26 t_begin
"single request matches" && {
27 sha1
=$
(curl
-sSfv 2> $err http
://$listen/ | rsha1
)
29 test x
"$sha1" = x
"$random_blob_sha1"
32 t_begin
"Content-Length header preserved in response" && {
33 grep "^< Content-Length:" $err
36 t_begin
"send three keep-alive requests" && {
37 sha1
=$
(curl
-vsSf 2> $err \
38 http
://$listen/ http
://$listen/ http
://$listen/ | rsha1
)
40 test x
"$sha1" = x
"$three_sha1"
43 t_begin
"ensure responses were all keep-alive" && {
44 test 3 -eq $
(grep '< Connection: keep-alive' < $err |
wc -l)
47 t_begin
"HTTP/1.0 test" && {
48 sha1
=$
(curl
-0 -v 2> $err -sSf http
://$listen/ | rsha1
)
49 test $sha1 = $random_blob_sha1
50 grep '< Connection: close' < $err
53 t_begin
"HTTP/0.9 test" && {
56 rsha1
< $fifo > $tmp &
59 ) | socat
- TCP
:$listen > $fifo
60 test $
(cat $tmp) = $random_blob_sha1
61 test xok
= x$
(cat $ok)
64 t_begin
"shutdown server" && {
65 kill -QUIT $rainbows_pid
68 t_begin
"check stderr" && check_stderr