about summary refs log tree commit homepage
path: root/t/t0000-http-basic.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-17 18:53:52 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-17 18:53:52 -0800
commit5cef71dc6c640db414c41f59a5016fd3f5326bf9 (patch)
tree500cd48b0d92ba8b847ce6839d6889d5304fa11b /t/t0000-http-basic.sh
parent13598f977ec3b707bd1a8f2abb99825cb8f85b58 (diff)
downloadunicorn-5cef71dc6c640db414c41f59a5016fd3f5326bf9.tar.gz
Diffstat (limited to 't/t0000-http-basic.sh')
-rwxr-xr-xt/t0000-http-basic.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/t/t0000-http-basic.sh b/t/t0000-http-basic.sh
new file mode 100755
index 0000000..01ead95
--- /dev/null
+++ b/t/t0000-http-basic.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+. ./test-lib.sh
+t_plan 8 "simple HTTP connection tests"
+
+t_begin "setup and start" && {
+        unicorn_setup
+        unicorn -D -c $unicorn_config env.ru
+        unicorn_wait_start
+}
+
+t_begin "single request" && {
+        curl -sSfv http://$listen/
+}
+
+t_begin "check stderr has no errors" && {
+        check_stderr
+}
+
+t_begin "HTTP/0.9 request should not return headers" && {
+        (
+                printf 'GET /\r\n'
+                cat $fifo > $tmp &
+                wait
+                echo ok > $ok
+        ) | socat - TCP:$listen > $fifo
+}
+
+t_begin "env.inspect should've put everything on one line" && {
+        test 1 -eq $(wc -l < $tmp)
+}
+
+t_begin "no headers in output" && {
+        if grep ^Connection: $tmp
+        then
+                die "Connection header found in $tmp"
+        elif grep ^HTTP/ $tmp
+        then
+                die "HTTP/ found in $tmp"
+        fi
+}
+
+t_begin "killing succeeds" && {
+        kill $unicorn_pid
+}
+
+t_begin "check stderr has no errors" && {
+        check_stderr
+}
+
+t_done