about summary refs log tree commit homepage
path: root/t/t0002-parser-error.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-24 20:41:15 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-24 20:42:57 -0700
commit15fe80b3bff7b0d249ee32bcbbe1dfa116d3c629 (patch)
tree8edf5313e3ef41395b406706dd807b97e6321eb9 /t/t0002-parser-error.sh
parente77369a6bde35a4e8925d450aac85f328f87d208 (diff)
downloadrainbows-15fe80b3bff7b0d249ee32bcbbe1dfa116d3c629.tar.gz
This will make it easier to enable and manage tests for new
concurrency models.
Diffstat (limited to 't/t0002-parser-error.sh')
-rwxr-xr-xt/t0002-parser-error.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t0002-parser-error.sh b/t/t0002-parser-error.sh
new file mode 100755
index 0000000..c4e5ab7
--- /dev/null
+++ b/t/t0002-parser-error.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+. ./test-lib.sh
+t_plan 5 "parser error test for $model"
+
+t_begin "setup and startup" && {
+        rainbows_setup $model
+        rainbows -D env.ru -c $unicorn_config
+        rainbows_wait_start
+}
+
+t_begin "send request" && {
+        (
+                printf 'GET / HTTP/1/1\r\nHost: example.com\r\n\r\n'
+                cat $fifo > $tmp &
+                wait
+                echo ok > $ok
+        ) | socat - TCP:$listen > $fifo
+        test xok = x$(cat $ok)
+}
+
+dbgcat tmp
+
+t_begin "response should be a 400" && {
+        grep -F 'HTTP/1.1 400 Bad Request' $tmp
+}
+
+t_begin "server stderr should be clean" && check_stderr
+
+t_begin "term signal sent" && kill $rainbows_pid
+
+t_done