diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-05-05 16:40:42 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-05-05 16:40:42 -0700 |
commit | 733cb68e444a6f324bb1ffda3839da98ef010c74 (patch) | |
tree | fdd36f2ba9fce67324a78865db44dc18eaeb57c7 | |
parent | 39ffd5590e4b5d2114215854deec848f849e9e87 (diff) | |
download | unicorn-733cb68e444a6f324bb1ffda3839da98ef010c74.tar.gz |
"wait" needs to be done in the outside shell because the subshell could still be exiting when we grep.
-rwxr-xr-x | t/t0002-parser-error.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/t/t0002-parser-error.sh b/t/t0002-parser-error.sh index f0df69d..9fa5a31 100755 --- a/t/t0002-parser-error.sh +++ b/t/t0002-parser-error.sh @@ -26,10 +26,10 @@ t_begin "response should be a 400" && { t_begin "send a huge Request URI (REQUEST_PATH > (12 * 1024))" && { rm -f $tmp + cat $fifo > $tmp & ( - cat $fifo > $tmp & set -e - trap 'wait && echo ok > $ok' EXIT + trap 'echo ok > $ok' EXIT printf 'GET /' for i in $(awk </dev/null 'BEGIN{for(i=0;i<1024;i++) print i}') do @@ -38,18 +38,19 @@ t_begin "send a huge Request URI (REQUEST_PATH > (12 * 1024))" && { printf ' HTTP/1.1\r\nHost: example.com\r\n\r\n' ) | socat - TCP:$listen > $fifo || : test xok = x$(cat $ok) + wait } -t_begin "response should be a 414" && { +t_begin "response should be a 414 (REQUEST_PATH)" && { grep -F 'HTTP/1.1 414 Request-URI Too Long' $tmp } t_begin "send a huge Request URI (QUERY_STRING > (10 * 1024))" && { rm -f $tmp + cat $fifo > $tmp & ( - cat $fifo > $tmp & set -e - trap 'wait && echo ok > $ok' EXIT + trap 'echo ok > $ok' EXIT printf 'GET /hello-world?a' for i in $(awk </dev/null 'BEGIN{for(i=0;i<1024;i++) print i}') do @@ -58,18 +59,19 @@ t_begin "send a huge Request URI (QUERY_STRING > (10 * 1024))" && { printf ' HTTP/1.1\r\nHost: example.com\r\n\r\n' ) | socat - TCP:$listen > $fifo || : test xok = x$(cat $ok) + wait } -t_begin "response should be a 414" && { +t_begin "response should be a 414 (QUERY_STRING)" && { grep -F 'HTTP/1.1 414 Request-URI Too Long' $tmp } t_begin "send a huge Request URI (FRAGMENT > 1024)" && { rm -f $tmp + cat $fifo > $tmp & ( - cat $fifo > $tmp & set -e - trap 'wait && echo ok > $ok' EXIT + trap 'echo ok > $ok' EXIT printf 'GET /hello-world#a' for i in $(awk </dev/null 'BEGIN{for(i=0;i<64;i++) print i}') do @@ -78,9 +80,10 @@ t_begin "send a huge Request URI (FRAGMENT > 1024)" && { printf ' HTTP/1.1\r\nHost: example.com\r\n\r\n' ) | socat - TCP:$listen > $fifo || : test xok = x$(cat $ok) + wait } -t_begin "response should be a 414" && { +t_begin "response should be a 414 (FRAGMENT)" && { grep -F 'HTTP/1.1 414 Request-URI Too Long' $tmp } |