Browse Source

removed duplicate test-scripts, added a test for bin-copy-env and cleaned up configfiles

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@661 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.3
Jan Kneschke 17 years ago
parent
commit
4fc9ee0f86
  1. 3
      tests/docroot/www/get-env.php
  2. 3
      tests/docroot/www/get-server-env.php
  3. 3
      tests/docroot/www/pathinfo.php
  4. 3
      tests/docroot/www/phphost.php
  5. 3
      tests/docroot/www/phpself.php
  6. 18
      tests/fastcgi-10.conf
  7. 1
      tests/fastcgi-13.conf
  8. 32
      tests/mod-fastcgi.t

3
tests/docroot/www/get-env.php

@ -0,0 +1,3 @@
<?php
print $_ENV[$_GET["env"]];
?>

3
tests/docroot/www/get-server-env.php

@ -0,0 +1,3 @@
<?php
print $_SERVER[$_GET["env"]];
?>

3
tests/docroot/www/pathinfo.php

@ -1,3 +0,0 @@
<?php
print $_SERVER["PATH_INFO"];
?>

3
tests/docroot/www/phphost.php

@ -1,3 +0,0 @@
<?php
print $_SERVER["SERVER_NAME"];
?>

3
tests/docroot/www/phpself.php

@ -1,3 +0,0 @@
<?php
print $_SERVER["PHP_SELF"];
?>

18
tests/fastcgi-10.conf

@ -4,8 +4,6 @@ server.pid-file = "@SRCDIR@/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 = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log"
@ -42,17 +40,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 ############################
@ -84,11 +71,6 @@ fastcgi.server = ( ".php" => (
"host" => "127.0.0.1",
"port" => 1026
)
# "ulf" => (
# "host" => "192.168.2.41",
# "docroot" => "/home/jan/servers/",
# "port" => 1026
# )
)
)

1
tests/fastcgi-13.conf

@ -88,6 +88,7 @@ fastcgi.server = ( ".php" => (
"host" => "127.0.0.1",
"port" => 1048,
"bin-path" => "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php -c /usr/local/lib/php.ini",
"bin-copy-environment" => ( "PATH", "SHELL", "USER" ),
)
)
)

32
tests/mod-fastcgi.t

@ -7,7 +7,7 @@ BEGIN {
}
use strict;
use Test::More tests => 44;
use Test::More tests => 45;
use LightyTest;
my $tf = LightyTest->new();
@ -52,7 +52,7 @@ EOF
ok($tf->handle_http($t) == 0, 'Status + Location via FastCGI');
$t->{REQUEST} = ( <<EOF
GET /phpself.php HTTP/1.0
GET /get-server-env.php?env=PHP_SELF HTTP/1.0
Host: www.example.org
EOF
);
@ -60,15 +60,15 @@ EOF
ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]');
$t->{REQUEST} = ( <<EOF
GET /phpself.php/foo HTTP/1.0
GET /get-server-env.php/foo?env=PHP_SELF HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/phpself.php' } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/get-server-env.php' } ];
ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]');
$t->{REQUEST} = ( <<EOF
GET /pathinfo.php/foo HTTP/1.0
GET /get-server-env.php/foo?env=PATH_INFO HTTP/1.0
Host: www.example.org
EOF
);
@ -76,7 +76,7 @@ EOF
ok($tf->handle_http($t) == 0, '$_SERVER["PATH_INFO"]');
$t->{REQUEST} = ( <<EOF
GET /phphost.php HTTP/1.0
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: www.example.org
EOF
);
@ -84,7 +84,7 @@ EOF
ok($tf->handle_http($t) == 0, 'SERVER_NAME');
$t->{REQUEST} = ( <<EOF
GET /phphost.php HTTP/1.0
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: foo.example.org
EOF
);
@ -92,7 +92,7 @@ EOF
ok($tf->handle_http($t) == 0, 'SERVER_NAME');
$t->{REQUEST} = ( <<EOF
GET /phphost.php HTTP/1.0
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: vvv.example.org
EOF
);
@ -100,7 +100,7 @@ EOF
ok($tf->handle_http($t) == 0, 'SERVER_NAME');
$t->{REQUEST} = ( <<EOF
GET /phphost.php HTTP/1.0
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: zzz.example.org
EOF
);
@ -156,7 +156,7 @@ EOF
$tf->{CONFIGFILE} = 'fastcgi-10.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
GET /phphost.php HTTP/1.0
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0
Host: zzz.example.org
EOF
);
@ -216,7 +216,7 @@ EOF
}
SKIP: {
skip "no php found", 3 unless -x "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php";
skip "no php found", 4 unless -x "/home/jan/Documents/php-5.1.0b3/sapi/cgi/php";
$tf->{CONFIGFILE} = 'fastcgi-13.conf';
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die();
$t->{REQUEST} = ( <<EOF
@ -227,6 +227,16 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ];
ok($tf->handle_http($t) == 0, 'FastCGI + local spawning');
$t->{REQUEST} = ( <<EOF
GET /get-env.php?env=MAIL HTTP/1.0
Host: www.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 , 'HTTP-Content' => '' } ];
ok($tf->handle_http($t) == 0, 'FastCGI + bin-copy-environment');
ok($tf->stop_proc == 0, "Stopping lighttpd");
}

Loading…
Cancel
Save