about summary refs log tree commit homepage
path: root/t/t0040-keepalive_requests-setting.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-04 12:39:09 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-04 13:38:13 +0000
commite6faf9e26bcb172026a4984ecadbaa8b6789bcb7 (patch)
tree37d8b44818b1f62b7c285124073c85fa50e202e5 /t/t0040-keepalive_requests-setting.sh
parentf4e3bac180ff01256832f98655636f79b52f9d5b (diff)
downloadrainbows-e6faf9e26bcb172026a4984ecadbaa8b6789bcb7.tar.gz
On FreeBSD 9.0, "wc -l" emits leading whitespace, so
filter it through tr -d '[:space:]' to eliminate it.
Diffstat (limited to 't/t0040-keepalive_requests-setting.sh')
-rwxr-xr-xt/t0040-keepalive_requests-setting.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t0040-keepalive_requests-setting.sh b/t/t0040-keepalive_requests-setting.sh
index 103b217..0a3570e 100755
--- a/t/t0040-keepalive_requests-setting.sh
+++ b/t/t0040-keepalive_requests-setting.sh
@@ -13,8 +13,8 @@ t_begin "setup and start" && {
 
 t_begin "curl requests hit default keepalive_requests limit" && {
         curl -sSfv http://$listen/[0-101] > $curl_out 2> $curl_err
-        test 1 -eq $(grep 'Connection: close' $curl_err |wc -l)
-        test 101 -eq $(grep 'Connection: keep-alive' $curl_err |wc -l)
+        test 1 -eq $(grep 'Connection: close' $curl_err |count_lines)
+        test 101 -eq $(grep 'Connection: keep-alive' $curl_err |count_lines)
 }
 
 t_begin "reload with smaller keepalive_requests limit" && {
@@ -32,8 +32,8 @@ EOF
 t_begin "curl requests hit smaller keepalive_requests limit" && {
         rm -f $curl_out $curl_err
         curl -sSfv http://$listen/[1-13] > $curl_out 2> $curl_err
-        test 2 -eq $(grep 'Connection: close' $curl_err |wc -l)
-        test 11 -eq $(grep 'Connection: keep-alive' $curl_err |wc -l)
+        test 2 -eq $(grep 'Connection: close' $curl_err |count_lines)
+        test 11 -eq $(grep 'Connection: keep-alive' $curl_err |count_lines)
 }
 
 t_begin "killing succeeds" && {