Browse Source

added tests for /prefix + PATH_INFO on check-local = disable

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@479 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/heads/lighttpd-1.3.x
Jan Kneschke 17 years ago
parent
commit
eaa13584b5
  1. 2
      tests/docroot/www/Makefile.am
  2. 10
      tests/lighttpd.conf
  3. 25
      tests/mod-fastcgi.t
  4. 1
      tests/prepare.sh

2
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

10
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" ) )
)

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

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

Loading…
Cancel
Save