summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/docroot/www/Makefile.am2
-rw-r--r--tests/lighttpd.conf10
-rwxr-xr-xtests/mod-fastcgi.t25
-rwxr-xr-xtests/prepare.sh1
4 files changed, 27 insertions, 11 deletions
diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am
index 06f6ce82..3ac0106e 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
+ nph-status.pl prefix.fcgi
SUBDIRS=go indexfile expire
diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf
index a5dcb3f2..7863f543 100644
--- a/tests/lighttpd.conf
+++ b/tests/lighttpd.conf
@@ -67,14 +67,8 @@ setenv.add-request-header = ( "FOO" => "foo")
setenv.add-response-header = ( "BAR" => "foo")
fastcgi.debug = 0
-fastcgi.server = ( ".php" => (
- "grisu" => (
- "host" => "127.0.0.1",
- "port" => 1026,
-# "mode" => "authorizer",
-# "docroot" => "/tmp/lighttpd/servers/www.example.org/pages/",
- )
- )
+fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026 ) ),
+ "/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )
)
diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t
index c578dc53..8ead034d 100755
--- a/tests/mod-fastcgi.t
+++ b/tests/mod-fastcgi.t
@@ -7,7 +7,7 @@ BEGIN {
}
use strict;
-use Test::More tests => 40;
+use Test::More tests => 43;
use LightyTest;
my $tf = LightyTest->new();
@@ -15,7 +15,7 @@ my $tf = LightyTest->new();
my $t;
SKIP: {
- skip "no PHP running on port 1026", 24 if $tf->pidof("php") == -1;
+ skip "no PHP running on port 1026", 27 if $tf->pidof("php") == -1;
ok($tf->start_proc == 0, "Starting lighttpd") or die();
@@ -120,6 +120,27 @@ EOF
$t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } );
ok($tf->handle_http($t) == 0, 'PHP_SELF + Indexfile, Bug #3');
+ $t->{REQUEST} = ( <<EOF
+GET /prefix.fcgi?var=SCRIPT_NAME HTTP/1.0
+EOF
+ );
+ $t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/prefix.fcgi' } );
+ ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
+
+ $t->{REQUEST} = ( <<EOF
+GET /prefix.fcgi/foo/bar?var=SCRIPT_NAME HTTP/1.0
+EOF
+ );
+ $t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/prefix.fcgi' } );
+ ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
+
+ $t->{REQUEST} = ( <<EOF
+GET /prefix.fcgi/foo/bar?var=PATH_INFO HTTP/1.0
+EOF
+ );
+ $t->{RESPONSE} = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } );
+ ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off');
+
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/prepare.sh b/tests/prepare.sh
index 9c30686f..a12bddf7 100755
--- a/tests/prepare.sh
+++ b/tests/prepare.sh
@@ -22,6 +22,7 @@ mkdir -p $tmpdir/cache/compress/
cp $srcdir/docroot/www/*.html \
$srcdir/docroot/www/*.php \
$srcdir/docroot/www/*.pl \
+ $srcdir/docroot/www/*.fcgi \
$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/