diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-07 12:11:51 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-08 13:32:44 -0800 |
commit | 1562a19a021a72a78ba495328d2d37ba0dc83b8c (patch) | |
tree | e86a23ed6484678936d57c1794980609069eafd0 /t/t0106-rack-input-keepalive.sh | |
parent | b4835c6d542c6369f2523ab68fc41b0202d7c6dc (diff) | |
download | rainbows-1562a19a021a72a78ba495328d2d37ba0dc83b8c.tar.gz |
Large uploads behave differently with regard to buffering, and there were bugs in the way the Rev and Revactor backends handled uploads.
Diffstat (limited to 't/t0106-rack-input-keepalive.sh')
-rwxr-xr-x | t/t0106-rack-input-keepalive.sh | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/t/t0106-rack-input-keepalive.sh b/t/t0106-rack-input-keepalive.sh index c4a531d..ce6d092 100755 --- a/t/t0106-rack-input-keepalive.sh +++ b/t/t0106-rack-input-keepalive.sh @@ -1,6 +1,6 @@ #!/bin/sh . ./test-lib.sh -t_plan 7 "rack.input pipelining test" +t_plan 11 "rack.input pipelining test" t_begin "setup and startup" && { rainbows_setup $model @@ -9,9 +9,55 @@ t_begin "setup and startup" && { body=hello body_size=$(printf $body | wc -c) body_sha1=$(printf $body | rsha1) + random_blob_size=$(wc -c < random_blob) + random_blob_sha1=$(rsha1 < random_blob) rainbows_wait_start } +t_begin "send big pipelined chunked requests" && { + ( + cat $fifo > $tmp & + content-md5-put < random_blob + content-md5-put < random_blob + content-md5-put < random_blob + printf 'PUT / HTTP/1.0\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + wait + echo ok > $ok + ) | socat - TCP4:$listen > $fifo + test x"$(cat $ok)" = xok +} + +t_begin "check responses" && { + dbgcat tmp + test 4 -eq $(grep $random_blob_sha1 $tmp | wc -l) +} + +t_begin "send big pipelined identity requests" && { + ( + cat $fifo > $tmp & + printf 'PUT / HTTP/1.0\r\n' + printf 'Connection: keep-alive\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + printf 'PUT / HTTP/1.1\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + printf 'PUT / HTTP/1.0\r\n' + printf 'Content-Length: %d\r\n\r\n' $random_blob_size + cat random_blob + wait + echo ok > $ok + ) | socat - TCP4:$listen > $fifo + test x"$(cat $ok)" = xok +} + +t_begin "check responses" && { + dbgcat tmp + test 3 -eq $(grep $random_blob_sha1 $tmp | wc -l) +} + t_begin "send pipelined identity requests" && { { |