summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-02-28 17:08:05 +0000
committerJan Kneschke <jan@kneschke.de>2005-02-28 17:08:05 +0000
commit6bf51546c79d36b101dc5f433122e9ec43c2b57f (patch)
tree427152644cd469a8bf0d9d0cff17d8ec64b0df66
parent26b184ba6ffb694e8540005fd58c4c56866bd3e0 (diff)
downloadlighttpd-git-6bf51546c79d36b101dc5f433122e9ec43c2b57f.tar.gz
converted all tests to run-tests.pl
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@56 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--tests/Makefile.am12
-rwxr-xr-xtests/accessdeny-01.sh16
-rwxr-xr-xtests/bug-03.sh26
-rwxr-xr-xtests/bug-06.sh26
-rwxr-xr-xtests/bug-12.sh27
-rwxr-xr-xtests/bug-14.sh18
-rwxr-xr-xtests/bug-15-2.sh27
-rwxr-xr-xtests/bug-15-3.sh26
-rwxr-xr-xtests/bug-15.sh27
-rwxr-xr-xtests/bug-urldecode-00.sh18
-rwxr-xr-xtests/compress-01.sh18
-rwxr-xr-xtests/compress-02.sh19
-rwxr-xr-xtests/compress-03.sh18
-rwxr-xr-xtests/compress-04.sh19
-rw-r--r--tests/docroot/www/Makefile.am2
-rw-r--r--tests/docroot/www/expire/Makefile.am1
-rw-r--r--tests/docroot/www/expire/access.txt0
-rw-r--r--tests/docroot/www/expire/modification.txt0
-rwxr-xr-xtests/fastcgi-01.sh25
-rwxr-xr-xtests/fastcgi-02.sh24
-rwxr-xr-xtests/fastcgi-03.sh25
-rwxr-xr-xtests/fastcgi-04.sh27
-rwxr-xr-xtests/fastcgi-05.sh27
-rwxr-xr-xtests/fastcgi-06.sh27
-rwxr-xr-xtests/fastcgi-07.sh27
-rwxr-xr-xtests/fastcgi-08.sh27
-rwxr-xr-xtests/fastcgi-09.sh27
-rwxr-xr-xtests/fastcgi-10.sh27
-rwxr-xr-xtests/fastcgi-11.sh19
-rwxr-xr-xtests/fastcgi-12.sh19
-rwxr-xr-xtests/fastcgi-13.sh26
-rwxr-xr-xtests/head-01.sh26
-rwxr-xr-xtests/large-header-01.sh25
-rw-r--r--tests/lighttpd.conf23
-rwxr-xr-xtests/pathinfo-01.sh24
-rwxr-xr-xtests/pathinfo-02.sh24
-rwxr-xr-xtests/prepare.sh2
-rwxr-xr-xtests/run-tests.pl148
38 files changed, 152 insertions, 747 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5f709198..e9a37771 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -11,18 +11,6 @@ endif
TESTS=\
prepare.sh \
run-tests.pl \
-bug-03.sh \
-bug-06.sh \
-bug-12.sh \
-large-header-01.sh \
-compress-01.sh \
-compress-02.sh \
-compress-03.sh \
-compress-04.sh \
-fastcgi-10.sh \
-fastcgi-11.sh \
-fastcgi-12.sh \
-fastcgi-13.sh \
cleanup.sh
CONFS=fastcgi-10.conf \
diff --git a/tests/accessdeny-01.sh b/tests/accessdeny-01.sh
deleted file mode 100755
index e9a80bc9..00000000
--- a/tests/accessdeny-01.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-deny request for index.html~
-GET /index.html~ HTTP/1.0
-
-Status: 403
-EOF
-
-run_test
diff --git a/tests/bug-03.sh b/tests/bug-03.sh
deleted file mode 100755
index c46e6735..00000000
--- a/tests/bug-03.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI PHPinfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-PHP_SELF + indexfile
-GET /indexfile/ HTTP/1.0
-Host: www.example.org
-
-Status: 200
-Content: /indexfile/index.php
-EOF
-
-run_test
-
diff --git a/tests/bug-06.sh b/tests/bug-06.sh
deleted file mode 100755
index 336c8919..00000000
--- a/tests/bug-06.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI PHPinfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-PHP_SELF + last indexfile
-GET /indexfile/ HTTP/1.0
-Host: www.example.org
-
-Status: 200
-Content: /indexfile/index.php
-EOF
-
-run_test
-
diff --git a/tests/bug-12.sh b/tests/bug-12.sh
deleted file mode 100755
index 7bdb0690..00000000
--- a/tests/bug-12.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI PHPinfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-FastCGI + errorhandler
-POST /indexfile/abc HTTP/1.0
-Host: www.example.org
-Content-Length: 0
-
-Status: 404
-Content: /indexfile/return-404.php
-EOF
-
-run_test
-
diff --git a/tests/bug-14.sh b/tests/bug-14.sh
deleted file mode 100755
index 505f15ec..00000000
--- a/tests/bug-14.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-CGI + NPH
-GET /nph-status.pl HTTP/1.0
-Host: www.example.org
-
-Status: 200
-EOF
-
-run_test
-
diff --git a/tests/bug-15-2.sh b/tests/bug-15-2.sh
deleted file mode 100755
index 371dbc80..00000000
--- a/tests/bug-15-2.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if id weigon > /dev/null; then
- echo -n
-else
- printf "%-40s" "userdir"
- exit 77
-fi
-
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-userdir for ~weigon + redirect
-GET /~weigon HTTP/1.0
-Host: www.example.org
-
-Status: 301
-Location: http://www.example.org/~weigon/
-EOF
-
-run_test
-
diff --git a/tests/bug-15-3.sh b/tests/bug-15-3.sh
deleted file mode 100755
index b51810f7..00000000
--- a/tests/bug-15-3.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if id weigon > /dev/null; then
- echo -n
-else
- printf "%-40s" "userdir"
- exit 77
-fi
-
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-userdir for ~weigon + redirect
-GET /~weigon HTTP/1.0
-
-Status: 301
-Location: http://localhost:2048/~weigon/
-EOF
-
-run_test
-
diff --git a/tests/bug-15.sh b/tests/bug-15.sh
deleted file mode 100755
index eb33eb35..00000000
--- a/tests/bug-15.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-
-if id weigon > /dev/null; then
- echo -n
-else
- printf "%-40s" "userdir"
- exit 77
-fi
-
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-userdir for ~weigon
-GET /~weigon/ HTTP/1.0
-Host: www.example.org
-
-Status: 200
-EOF
-
-run_test
-
diff --git a/tests/bug-urldecode-00.sh b/tests/bug-urldecode-00.sh
deleted file mode 100755
index 4f34e841..00000000
--- a/tests/bug-urldecode-00.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-Check that %00 is decoded correctly
-GET /%00 HTTP/1.0
-Foo: foo
-Foo: foo
-
-Status: 404
-EOF
-
-run_test
diff --git a/tests/compress-01.sh b/tests/compress-01.sh
deleted file mode 100755
index 4fcfc77c..00000000
--- a/tests/compress-01.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-Compression - deflate
-GET /index.html HTTP/1.0
-Accept-Encoding: deflate
-
-Status: 200
-MUST: Vary
-EOF
-
-run_test
diff --git a/tests/compress-02.sh b/tests/compress-02.sh
deleted file mode 100755
index ae91a9bc..00000000
--- a/tests/compress-02.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-Compression - deflate
-GET /index.html HTTP/1.0
-Accept-Encoding: deflate
-
-Status: 200
-Content-Length: 1288
-MUST: Vary Content-Encoding
-EOF
-
-run_test
diff --git a/tests/compress-03.sh b/tests/compress-03.sh
deleted file mode 100755
index 830e02f9..00000000
--- a/tests/compress-03.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-Compression - gzip
-GET /index.html HTTP/1.0
-Accept-Encoding: gzip
-
-Status: 200
-MUST: Vary Content-Encoding
-EOF
-
-run_test
diff --git a/tests/compress-04.sh b/tests/compress-04.sh
deleted file mode 100755
index c08f3975..00000000
--- a/tests/compress-04.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-Compression - gzip
-GET /index.txt HTTP/1.0
-Accept-Encoding: gzip, deflate
-Host: www.example.org
-
-Status: 200
-MIGHT: Content-Encoding Vary
-EOF
-
-run_test
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index 1ea8c469..06f6ce82 100644
--- a/tests/docroot/www/Makefile.am
+++ b/tests/docroot/www/Makefile.am
@@ -1,4 +1,4 @@
EXTRA_DIST=cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \
phpself.php redirect.php cgi-pathinfo.pl phphost.php \
nph-status.pl
-SUBDIRS=go indexfile
+SUBDIRS=go indexfile expire
diff --git a/tests/docroot/www/expire/Makefile.am b/tests/docroot/www/expire/Makefile.am
new file mode 100644
index 00000000..7812b143
--- /dev/null
+++ b/tests/docroot/www/expire/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST=access.txt modification.txt
diff --git a/tests/docroot/www/expire/access.txt b/tests/docroot/www/expire/access.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/docroot/www/expire/access.txt
diff --git a/tests/docroot/www/expire/modification.txt b/tests/docroot/www/expire/modification.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/docroot/www/expire/modification.txt
diff --git a/tests/fastcgi-01.sh b/tests/fastcgi-01.sh
deleted file mode 100755
index d134a160..00000000
--- a/tests/fastcgi-01.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI PHPinfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-FastCGI PHPinfo
-GET /phpinfo.php HTTP/1.0
-Host: www.example.org
-
-Status: 200
-EOF
-
-run_test
-
diff --git a/tests/fastcgi-02.sh b/tests/fastcgi-02.sh
deleted file mode 100755
index 79a0aacb..00000000
--- a/tests/fastcgi-02.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI - missing File"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-FastCGI - missing File
-GET /phpinfajdhdo.php HTTP/1.1
-Host: www.example.org
-
-Status: 404
-EOF
-
-run_test
diff --git a/tests/fastcgi-03.sh b/tests/fastcgi-03.sh
deleted file mode 100755
index f18c2f87..00000000
--- a/tests/fastcgi-03.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "index-file -> FastCGI"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-index-file -> FastCGI
-GET /go/ HTTP/1.0
-Host: www.example.org
-
-Status: 200
-EOF
-
-run_test
diff --git a/tests/fastcgi-04.sh b/tests/fastcgi-04.sh
deleted file mode 100755
index 4b5eb738..00000000
--- a/tests/fastcgi-04.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-Redirect in PHP
-GET /redirect.php HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 302
-Location: http://www.example.org:2048/
-EOF
-
-run_test
diff --git a/tests/fastcgi-05.sh b/tests/fastcgi-05.sh
deleted file mode 100755
index e0aecc7e..00000000
--- a/tests/fastcgi-05.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-PHP_SELF
-GET /phpself.php HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 200
-Content: /phpself.php
-EOF
-
-run_test
diff --git a/tests/fastcgi-06.sh b/tests/fastcgi-06.sh
deleted file mode 100755
index bc54d924..00000000
--- a/tests/fastcgi-06.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-PHP_SELF + PATH_INFO
-GET /phpself.php/foo HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 200
-Content: /phpself.php
-EOF
-
-run_test
diff --git a/tests/fastcgi-07.sh b/tests/fastcgi-07.sh
deleted file mode 100755
index ef148d24..00000000
--- a/tests/fastcgi-07.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-SERVER_NAME + known host, simplevhost
-GET /phphost.php HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 200
-Content: www.example.org
-EOF
-
-run_test
diff --git a/tests/fastcgi-08.sh b/tests/fastcgi-08.sh
deleted file mode 100755
index b96b1120..00000000
--- a/tests/fastcgi-08.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-SERVER_NAME + unknown host, default
-GET /phphost.php HTTP/1.0
-Host: xxx.example.org
-Conntection: close
-
-Status: 200
-Content: www.example.org
-EOF
-
-run_test
diff --git a/tests/fastcgi-09.sh b/tests/fastcgi-09.sh
deleted file mode 100755
index 401e2c07..00000000
--- a/tests/fastcgi-09.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-SERVER_NAME + \$HTTP["Host"], default
-GET /phphost.php HTTP/1.0
-Host: vvv.example.org
-Conntection: close
-
-Status: 200
-Content: www.example.org
-EOF
-
-run_test
diff --git a/tests/fastcgi-10.sh b/tests/fastcgi-10.sh
deleted file mode 100755
index bd0e8dd0..00000000
--- a/tests/fastcgi-10.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "Redirect in PHP"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-SERVER_NAME + \$HTTP, servername
-GET /phphost.php HTTP/1.0
-Host: zzz.example.org
-Conntection: close
-
-Status: 200
-Content: zzz.example.org
-EOF
-
-run_test
diff --git a/tests/fastcgi-11.sh b/tests/fastcgi-11.sh
deleted file mode 100755
index 2042c1d3..00000000
--- a/tests/fastcgi-11.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-FastCGI-Auth - ok
-GET /index.html?ok HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 200
-EOF
-
-run_test
diff --git a/tests/fastcgi-12.sh b/tests/fastcgi-12.sh
deleted file mode 100755
index 0eed8cd3..00000000
--- a/tests/fastcgi-12.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-FastCGI-Authorizer - 403
-GET /index.html?fail HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 403
-EOF
-
-run_test
diff --git a/tests/fastcgi-13.sh b/tests/fastcgi-13.sh
deleted file mode 100755
index 75cbac92..00000000
--- a/tests/fastcgi-13.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if test -e /home/weigon/Documents/php-4.3.10/sapi/cgi/php > /dev/null; then
- echo -n
-else
- printf "%-40s" "FastCGI PHPinfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-
-cat > $TMPFILE <<EOF
-FastCGI + local-spawning
-GET /indexfile/index.php HTTP/1.0
-Host: www.example.org
-Conntection: close
-
-Status: 200
-EOF
-
-run_test
diff --git a/tests/head-01.sh b/tests/head-01.sh
deleted file mode 100755
index 510fb350..00000000
--- a/tests/head-01.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-HEAD request should have no content
-HEAD /index.html HTTP/1.0
-
-Status: 200
-EOF
-
-run_test_script
-
-if test x$exitcode = x0; then
- if test `cat $NAME.out | sed '1,/^.$/d' | wc -l` = 0; then
- a=a
- else
- exitcode=-1
- fi
-fi
-
-run_test_exit
diff --git a/tests/large-header-01.sh b/tests/large-header-01.sh
deleted file mode 100755
index bd7744b5..00000000
--- a/tests/large-header-01.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-large request header
-GET / HTTP/1.0
-Hsgfsdjf: asdfhdf
-hdhd: shdfhfdasd
-hfhr: jfghsdfg
-jfuuehdmn: sfdgjfdg
-jvcbzufdg: sgfdfg
-hrnvcnd: jfjdfg
-jfusfdngmd: gfjgfdusdfg
-nfj: jgfdjdfg
-jfue: jfdfdg
-
-Status: 200
-EOF
-
-run_test
diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf
index 4a91e72e..9adc7bc6 100644
--- a/tests/lighttpd.conf
+++ b/tests/lighttpd.conf
@@ -4,8 +4,6 @@ server.pid-file = "/tmp/lighttpd/lighttpd.pid"
## bind to port (default: 80)
server.port = 2048
-# server.license = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c"
-
## bind to localhost (default: all interfaces)
server.bind = "localhost"
server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log"
@@ -14,11 +12,6 @@ server.tag = "Apache 1.3.29"
fastcgi.debug = 1
-##
-## Format: <errorfile-prefix><status>.html
-## -> ..../status-404.html for 'File not found'
-#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
-
server.dir-listing = "enable"
#server.event-handler = "linux-sysepoll"
@@ -46,17 +39,6 @@ server.modules = (
server.indexfiles = ( "index.php", "index.html",
"index.htm", "default.htm" )
-#,-- only root can use these options
-#|
-#|# chroot() to directory (default: no chroot() )
-#| server.chroot /
-#|# change uid to <uid> (default: don't care)
-#| server.userid wwwrun
-#|# change uid to <uid> (default: don't care)
-#| server.groupid wwwrun
-#|
-#`--
-
######################## MODULE CONFIG ############################
@@ -102,7 +84,7 @@ cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".py" => "/usr/bin/python" )
-userdir.include-user = ( "weigon" )
+userdir.include-user = ( "jan" )
userdir.path = "/"
ssl.engine = "disable"
@@ -143,7 +125,8 @@ url.access-deny = ( "~", ".inc")
url.redirect = ( "^/redirect/$" => "http://localhost:2048/" )
-expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+expire.url = ( "/expire/access" => "access 2 hours",
+ "/expire/modification" => "access plus 1 seconds 2 minutes")
#cache.cache-dir = "/home/weigon/wwwroot/cache/"
diff --git a/tests/pathinfo-01.sh b/tests/pathinfo-01.sh
deleted file mode 100755
index 17b7a50a..00000000
--- a/tests/pathinfo-01.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "PathInfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-PathInfo
-GET /cgi.php/abc HTTP/1.0
-
-Status: 200
-EOF
-
-run_test
-
diff --git a/tests/pathinfo-02.sh b/tests/pathinfo-02.sh
deleted file mode 100755
index 08d7dde6..00000000
--- a/tests/pathinfo-02.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if pidof php > /dev/null; then
- echo -n
-else
- printf "%-40s" "PathInfo"
- exit 77
-fi
-
-test x$srcdir = x && srcdir=.
-
-. $srcdir/testbase.sh
-
-prepare_test
-
-cat > $TMPFILE <<EOF
-PathInfo on a directory
-GET /www/abc/def HTTP/1.0
-
-Status: 404
-EOF
-
-run_test
-
diff --git a/tests/prepare.sh b/tests/prepare.sh
index faa7e220..9c30686f 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -11,6 +11,7 @@ rm -rf $tmpdir
mkdir -p $tmpdir/servers/www.example.org/pages/
mkdir -p $tmpdir/servers/www.example.org/pages/dummydir/
mkdir -p $tmpdir/servers/www.example.org/pages/go/
+mkdir -p $tmpdir/servers/www.example.org/pages/expire/
mkdir -p $tmpdir/servers/www.example.org/pages/indexfile/
mkdir -p $tmpdir/servers/123.example.org/pages/
mkdir -p $tmpdir/logs/
@@ -23,6 +24,7 @@ cp $srcdir/docroot/www/*.html \
$srcdir/docroot/www/*.pl \
$srcdir/docroot/www/*.txt $tmpdir/servers/www.example.org/pages/
cp $srcdir/docroot/www/go/*.php $tmpdir/servers/www.example.org/pages/go/
+cp $srcdir/docroot/www/expire/*.txt $tmpdir/servers/www.example.org/pages/expire/
cp $srcdir/docroot/www/indexfile/*.php $tmpdir/servers/www.example.org/pages/indexfile/
cp $srcdir/docroot/123/*.txt \
$srcdir/docroot/123/*.html \
diff --git a/tests/run-tests.pl b/tests/run-tests.pl
index 742edb42..ea427d4d 100755
--- a/tests/run-tests.pl
+++ b/tests/run-tests.pl
@@ -2,7 +2,7 @@
use strict;
use IO::Socket;
-use Test::More tests => 89;
+use Test::More tests => 114;
my $testname;
@@ -32,6 +32,7 @@ sub stop_proc {
close F;
kill('TERM',$pid) or return -1;
+ select(undef, undef, undef, 0.25);
return 0;
}
@@ -165,7 +166,7 @@ sub handle_http {
}
if (!defined $resp_hdr{$k}) {
- diag(sprintf("required header '%s' is missing\n", $_));
+ diag(sprintf("required header '%s' is missing\n", $k));
return -1;
}
@@ -746,6 +747,22 @@ EOF
ok(handle_http == 0, 'GET, Range start out of range');
+@request = ( <<EOF
+GET / HTTP/1.0
+Hsgfsdjf: asdfhdf
+hdhd: shdfhfdasd
+hfhr: jfghsdfg
+jfuuehdmn: sfdgjfdg
+jvcbzufdg: sgfdfg
+hrnvcnd: jfjdfg
+jfusfdngmd: gfjgfdusdfg
+nfj: jgfdjdfg
+jfue: jfdfdg
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );
+ok(handle_http == 0, 'larger headers');
+
@@ -941,6 +958,61 @@ EOF
ok(handle_http == 0, 'external redirect');
+
+print "\nmodules - mod_compress\n";
+@request = ( <<EOF
+GET /index.html HTTP/1.0
+Accept-Encoding: deflate
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '' } );
+ok(handle_http == 0, 'Vary is set');
+
+@request = ( <<EOF
+GET /index.html HTTP/1.0
+Accept-Encoding: deflate
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } );
+ok(handle_http == 0, 'deflate - Content-Length and Content-Encoding is set');
+
+@request = ( <<EOF
+GET /index.html HTTP/1.0
+Accept-Encoding: gzip
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } );
+ok(handle_http == 0, 'gzip - Content-Length and Content-Encoding is set');
+
+@request = ( <<EOF
+GET /index.txt HTTP/1.0
+Accept-Encoding: gzip, deflate
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } );
+ok(handle_http == 0, 'gzip, deflate - Content-Length and Content-Encoding is set');
+
+
+print "\nmodules - mod_expire\n";
+@request = ( <<EOF
+GET /expire/access.txt HTTP/1.0
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Expires' => '' } );
+ok(handle_http == 0, 'access');
+
+@request = ( <<EOF
+GET /expire/modification.txt HTTP/1.0
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Expires' => '' } );
+ok(handle_http == 0, 'modification');
+
+
+
+
+
+
print "\nmodules - mod_userdir\n";
# get current user
@@ -967,12 +1039,82 @@ EOF
@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://www.example.org/~jan/' } );
ok(handle_http == 0, 'valid user + redirect');
+print "\nclean up\n";
+ok(stop_proc == 0, "Stopping lighttpd");
+print "\nspecial config\n";
+$configfile = 'fastcgi-10.conf';
+ok(start_proc == 0, "Starting lighttpd with fastcgi-10.conf") or die();
+@request = ( <<EOF
+GET /phphost.php HTTP/1.0
+Host: zzz.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } );
+ok(handle_http == 0, 'FastCGI + Host');
+ok(stop_proc == 0, "Stopping lighttpd");
-print "\nclean up\n";
+$configfile = 'fastcgi-11.conf';
+ok(start_proc == 0, "Starting lighttpd with fastcgi-11.conf") or die();
+@request = ( <<EOF
+GET /index.html?ok HTTP/1.0
+Host: www.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );
+ok(handle_http == 0, 'FastCGI - Auth');
+
+ok(stop_proc == 0, "Stopping lighttpd");
+
+$configfile = 'fastcgi-12.conf';
+ok(start_proc == 0, "Starting lighttpd with fastcgi-12.conf") or die();
+@request = ( <<EOF
+GET /index.html?fail HTTP/1.0
+Host: www.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } );
+ok(handle_http == 0, 'FastCGI - Auth');
+
+ok(stop_proc == 0, "Stopping lighttpd");
+
+$configfile = 'fastcgi-13.conf';
+ok(start_proc == 0, "Starting lighttpd with fastcgi-13.conf") or die();
+@request = ( <<EOF
+GET /indexfile/index.php HTTP/1.0
+Host: www.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } );
+ok(handle_http == 0, 'FastCGI + local spawning');
+
+ok(stop_proc == 0, "Stopping lighttpd");
+
+$configfile = 'bug-06.conf';
+ok(start_proc == 0, "Starting lighttpd with bug-06.conf") or die();
+@request = ( <<EOF
+GET /indexfile/ HTTP/1.0
+Host: www.example.org
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } );
+ok(handle_http == 0, 'Bug #6');
+
+ok(stop_proc == 0, "Stopping lighttpd");
+
+$configfile = 'bug-12.conf';
+ok(start_proc == 0, "Starting lighttpd with bug-12.conf") or die();
+@request = ( <<EOF
+POST /indexfile/abc HTTP/1.0
+Host: www.example.org
+Content-Length: 0
+EOF
+ );
+@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } );
+ok(handle_http == 0, 'Bug #12');
ok(stop_proc == 0, "Stopping lighttpd");