diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-05 01:39:16 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-05 01:39:16 -0800 |
commit | b5c1db0c2cd95bcfba1e67fa8a0a058f80025528 (patch) | |
tree | 00a847aed3c0f4e2340a3d3876cb32eccdbd9332 /t/t0101-rack-input-trailer.sh | |
parent | 46e3efc723de7e83bd8c153662bdd0c56fb18c97 (diff) | |
download | rainbows-b5c1db0c2cd95bcfba1e67fa8a0a058f80025528.tar.gz |
This test lead to two separate bugfixes in Unicorn, one in the HttpParser and the other in TeeInput. Ironically, this test was spawned from what I initially thought was a bug in the EvCore module used by Rev and EventMachine, but there was no bug in EvCore...
Diffstat (limited to 't/t0101-rack-input-trailer.sh')
-rwxr-xr-x | t/t0101-rack-input-trailer.sh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/t/t0101-rack-input-trailer.sh b/t/t0101-rack-input-trailer.sh index 75528d6..bf3eb1d 100755 --- a/t/t0101-rack-input-trailer.sh +++ b/t/t0101-rack-input-trailer.sh @@ -2,7 +2,7 @@ . ./test-lib.sh test -r random_blob || die "random_blob required, run with 'make $0'" -t_plan 11 "input trailer test $model" +t_plan 13 "input trailer test $model" t_begin "setup and startup" && { rtmpfiles curl_out @@ -11,6 +11,27 @@ t_begin "setup and startup" && { rainbows_wait_start } +t_begin "staggered trailer upload" && { + zero_md5="1B2M2Y8AsgTpgAmY7PhCfg==" + ( + cat $fifo > $tmp & + printf 'PUT /s HTTP/1.1\r\n' + printf 'Host: example.com\r\n' + printf 'Transfer-Encoding: chunked\r\n' + printf 'Trailer: Content-MD5\r\n\r\n' + printf '0\r\nContent-MD5: ' + sleep 5 + printf '%s\r\n\r\n' $zero_md5 + wait + echo ok > $ok + ) | socat - TCP:$listen > $fifo + test xok = x"$(cat $ok)" +} + +t_begin "HTTP response is OK" && { + fgrep 'HTTP/1.1 200 OK' $tmp +} + t_begin "upload small blob" && { ( cat $fifo > $tmp & |