3 skip_models StreamResponseEpoll
4 t_plan
11 "rack.input pipelining test"
6 t_begin
"setup and startup" && {
9 rainbows
-D sha1.ru
-c $unicorn_config
11 body_size
=$
(printf $body | count_bytes
)
12 body_sha1
=$
(printf $body | rsha1
)
13 random_blob_size
=$
(count_bytes
< random_blob
)
14 random_blob_sha1
=$
(rsha1
< random_blob
)
18 t_begin
"send big pipelined chunked requests" && {
23 content-md5-put
< random_blob
24 content-md5-put
< random_blob
25 content-md5-put
< random_blob
26 printf 'PUT / HTTP/1.0\r\n'
27 printf 'Content-Length: %d\r\n\r\n' $random_blob_size
31 ) | socat
- TCP4
:$listen > $fifo
32 test x
"$(cat $ok)" = xok
35 t_begin
"check responses" && {
37 test 4 -eq $
(grep $random_blob_sha1 $tmp | count_lines
)
40 t_begin
"send big pipelined identity requests" && {
43 printf 'PUT / HTTP/1.0\r\n'
44 printf 'Connection: keep-alive\r\n'
45 printf 'Content-Length: %d\r\n\r\n' $random_blob_size
47 printf 'PUT / HTTP/1.1\r\n'
48 printf 'Content-Length: %d\r\n\r\n' $random_blob_size
50 printf 'PUT / HTTP/1.0\r\n'
51 printf 'Content-Length: %d\r\n\r\n' $random_blob_size
55 ) | socat
- TCP4
:$listen > $fifo
56 test x
"$(cat $ok)" = xok
59 t_begin
"check responses" && {
61 test 3 -eq $
(grep $random_blob_sha1 $tmp | count_lines
)
64 t_begin
"send pipelined identity requests" && {
67 printf 'PUT / HTTP/1.0\r\n'
68 printf 'Connection: keep-alive\r\n'
69 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
70 printf 'PUT / HTTP/1.1\r\nHost: example.com\r\n'
71 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
72 printf 'PUT / HTTP/1.0\r\n'
73 printf 'Content-Length: %d\r\n\r\n%s' $body_size $body
80 ) | socat
- TCP4
:$listen > $fifo
81 test x
"$(cat $ok)" = xok
84 t_begin
"check responses" && {
86 test 3 -eq $
(grep $body_sha1 $tmp | count_lines
)
89 t_begin
"send pipelined chunked requests" && {
92 printf 'PUT / HTTP/1.0\r\n'
93 printf 'Connection: keep-alive\r\n'
94 printf 'Transfer-Encoding: chunked\r\n\r\n'
95 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
96 printf 'PUT / HTTP/1.1\r\nHost: example.com\r\n'
97 printf 'Transfer-Encoding: chunked\r\n\r\n'
98 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
99 printf 'PUT / HTTP/1.0\r\n'
100 printf 'Transfer-Encoding: chunked\r\n\r\n'
101 printf '%x\r\n%s\r\n0\r\n\r\n' $body_size $body
108 ) | socat
- TCP4
:$listen > $fifo
109 test x
"$(cat $ok)" = xok
112 t_begin
"check responses" && {
114 test 3 -eq $
(grep $body_sha1 $tmp | count_lines
)
117 t_begin
"kill server" && kill $rainbows_pid
119 t_begin
"no errors in stderr log" && check_stderr