3 t_plan
7 "rack.input pipelining test"
5 t_begin
"setup and startup" && {
8 rainbows
-D sha1.ru
-c $unicorn_config
10 body_size
=$
(printf $body |
wc -c)
11 body_sha1
=$
(printf $body | rsha1
)
15 t_begin
"send pipelined identity requests" && {
18 printf 'PUT / HTTP/1.0\r\n'
19 printf 'Connection: keep-alive\r\n'
20 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
21 printf 'PUT / HTTP/1.1\r\nHost: example.com\r\n'
22 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
23 printf 'PUT / HTTP/1.0\r\n'
24 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
31 ) | socat
- TCP4
:$listen > $fifo
32 test x
"$(cat $ok)" = xok
35 t_begin
"check responses" && {
37 test 3 -eq $
(grep $body_sha1 $tmp |
wc -l)
40 t_begin
"send pipelined chunked requests" && {
43 printf 'PUT / HTTP/1.0\r\n'
44 printf 'Connection: keep-alive\r\n'
45 printf 'Transfer-Encoding: chunked\r\n\r\n'
46 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
47 printf 'PUT / HTTP/1.1\r\nHost: example.com\r\n'
48 printf 'Transfer-Encoding: chunked\r\n\r\n'
49 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
50 printf 'PUT / HTTP/1.0\r\n'
51 printf 'Transfer-Encoding: chunked\r\n\r\n'
52 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
59 ) | socat
- TCP4
:$listen > $fifo
60 test x
"$(cat $ok)" = xok
63 t_begin
"check responses" && {
65 test 3 -eq $
(grep $body_sha1 $tmp |
wc -l)
68 t_begin
"kill server" && kill $rainbows_pid
70 t_begin
"no errors in stderr log" && check_stderr