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
svn/tags/lighttpd-1.4.2
Jan Kneschke 18 years ago
parent fd7466eb7a
commit 3af5f02398

@ -39,6 +39,7 @@ CONFS=fastcgi-10.conf \
mod-userdir.t \
mod-rewrite.t \
request.t \
mod-ssi.t \
LightyTest.pm

@ -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

@ -0,0 +1 @@
<!--#echo var="SCRIPT_NAME" -->

@ -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"

@ -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");

@ -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/

Loading…
Cancel
Save