summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-08-23 07:55:19 +0000
committerJan Kneschke <jan@kneschke.de>2005-08-23 07:55:19 +0000
commit3af5f02398a1aa6dfaf5c5db5a8cb42363372564 (patch)
tree53e3c69265daed9e21f6929877a84af30072a9e3
parentfd7466eb7a2ed365da40834dc3a9d820c612814f (diff)
downloadlighttpd-git-3af5f02398a1aa6dfaf5c5db5a8cb42363372564.tar.gz
added a basic test for mod-ssi
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@612 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/docroot/www/Makefile.am2
-rw-r--r--tests/docroot/www/ssi.shtml1
-rw-r--r--tests/lighttpd.conf2
-rwxr-xr-xtests/mod-ssi.t29
-rwxr-xr-xtests/prepare.sh1
6 files changed, 35 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e3f387ac..6cca0ab8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -39,6 +39,7 @@ CONFS=fastcgi-10.conf \
mod-userdir.t \
mod-rewrite.t \
request.t \
+ mod-ssi.t \
LightyTest.pm
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index 5f93f3da..017d3908 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 pathinfo.php \
- nph-status.pl prefix.fcgi get-header.pl
+ nph-status.pl prefix.fcgi get-header.pl ssi.shtml
SUBDIRS=go indexfile expire
diff --git a/tests/docroot/www/ssi.shtml b/tests/docroot/www/ssi.shtml
new file mode 100644
index 00000000..473c5c65
--- /dev/null
+++ b/tests/docroot/www/ssi.shtml
@@ -0,0 +1 @@
+<!--#echo var="SCRIPT_NAME" -->
diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf
index 4e92433c..5a65681a 100644
--- a/tests/lighttpd.conf
+++ b/tests/lighttpd.conf
@@ -32,6 +32,7 @@ server.modules = (
"mod_cgi",
"mod_compress",
"mod_userdir",
+ "mod_ssi",
"mod_accesslog" )
server.indexfiles = ( "index.php", "index.html",
@@ -40,6 +41,7 @@ server.indexfiles = ( "index.php", "index.html",
######################## MODULE CONFIG ############################
+ssi.extension = ( ".shtml" )
accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log"
diff --git a/tests/mod-ssi.t b/tests/mod-ssi.t
new file mode 100755
index 00000000..72b2a096
--- /dev/null
+++ b/tests/mod-ssi.t
@@ -0,0 +1,29 @@
+#! /usr/bin/perl -w
+BEGIN {
+ # add current source dir to the include-path
+ # we need this for make distcheck
+ (my $srcdir = $0) =~ s#/[^/]+$#/#;
+ unshift @INC, $srcdir;
+}
+
+use strict;
+use IO::Socket;
+use Test::More tests => 3;
+use LightyTest;
+
+my $tf = LightyTest->new();
+my $t;
+
+ok($tf->start_proc == 0, "Starting lighttpd") or die();
+
+# mod-cgi
+#
+$t->{REQUEST} = ( <<EOF
+GET /ssi.shtml HTTP/1.0
+EOF
+ );
+$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "/ssi.shtml\n" } );
+ok($tf->handle_http($t) == 0, 'ssi - echo ');
+
+ok($tf->stop_proc == 0, "Stopping lighttpd");
+
diff --git a/tests/prepare.sh b/tests/prepare.sh
index ba86cf69..451151a6 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -23,6 +23,7 @@ cp $srcdir/docroot/www/*.html \
$srcdir/docroot/www/*.php \
$srcdir/docroot/www/*.pl \
$srcdir/docroot/www/*.fcgi \
+ $srcdir/docroot/www/*.shtml \
$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/