about summary refs log tree commit homepage
path: root/t/t0000-basic.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-17 22:42:56 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-17 22:42:56 -0700
commit61a50566ea0799a9b19c3dcfdf9b1ae5ea083dd2 (patch)
treef28eeeb655e378fc187e28199af62d37aa1c98c2 /t/t0000-basic.sh
parent0719c5a7ac09078c810507244a86ba44623757c4 (diff)
downloadrainbows-61a50566ea0799a9b19c3dcfdf9b1ae5ea083dd2.tar.gz
We support pipelining, keepalive, and even HTTP/0.9!
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-xt/t0000-basic.sh37
1 files changed, 1 insertions, 36 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 1ba3f43..7942942 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -1,37 +1,2 @@
 #!/bin/sh
-. ./test-lib.sh
-
-eval $(unused_listen)
-rtmpfiles pid tmp ok fifo
-
-rm -f $fifo
-mkfifo $fifo
-
-rainbows -D t0000.ru -l $listen --pid $pid &
-wait_for_pid $pid
-
-echo "single request"
-curl -sSfv http://$listen/
-
-echo "two requests with keepalive"
-curl -sSfv http://$listen/a http://$listen/b > $tmp 2>&1
-grep 'Re-using existing connection' < $tmp
-
-echo "pipelining partial requests"
-req='GET / HTTP/1.1\r\nHost: foo\r\n'
-(
-        printf "$req"'\r\n'"$req"
-        cat $fifo > $tmp &
-        sleep 1
-        printf 'Connection: close\r\n\r\n'
-        echo ok > $ok
-) | socat - TCP:$listen > $fifo
-
-kill $(cat $pid)
-
-# sed -ne 's/^/------/p' < $tmp
-test 2 -eq $(grep '^HTTP/1.1' $tmp | wc -l)
-test 2 -eq $(grep '^HTTP/1.1 200 OK' $tmp | wc -l)
-test 1 -eq $(grep '^Connection: keep-alive' $tmp | wc -l)
-test 1 -eq $(grep '^Connection: close' $tmp | wc -l)
-test x"$(cat $ok)" = xok
+. ./lib-simple-http.sh