diff options
-rw-r--r-- | tests/docroot/www/get-env.php | 3 | ||||
-rw-r--r-- | tests/docroot/www/get-server-env.php | 3 | ||||
-rw-r--r-- | tests/docroot/www/pathinfo.php | 3 | ||||
-rw-r--r-- | tests/docroot/www/phphost.php | 3 | ||||
-rw-r--r-- | tests/docroot/www/phpself.php | 3 | ||||
-rw-r--r-- | tests/fastcgi-10.conf | 18 | ||||
-rw-r--r-- | tests/fastcgi-13.conf | 1 | ||||
-rwxr-xr-x | tests/mod-fastcgi.t | 32 |
8 files changed, 28 insertions, 38 deletions
diff --git a/tests/docroot/www/get-env.php b/tests/docroot/www/get-env.php new file mode 100644 index 00000000..15ac94f6 --- /dev/null +++ b/tests/docroot/www/get-env.php @@ -0,0 +1,3 @@ +<?php + print $_ENV[$_GET["env"]]; +?> diff --git a/tests/docroot/www/get-server-env.php b/tests/docroot/www/get-server-env.php new file mode 100644 index 00000000..17b49945 --- /dev/null +++ b/tests/docroot/www/get-server-env.php @@ -0,0 +1,3 @@ +<?php + print $_SERVER[$_GET["env"]]; +?> diff --git a/tests/docroot/www/pathinfo.php b/tests/docroot/www/pathinfo.php deleted file mode 100644 index 39cfce92..00000000 --- a/tests/docroot/www/pathinfo.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - print $_SERVER["PATH_INFO"]; -?> diff --git a/tests/docroot/www/phphost.php b/tests/docroot/www/phphost.php deleted file mode 100644 index edf2f68e..00000000 --- a/tests/docroot/www/phphost.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - print $_SERVER["SERVER_NAME"]; -?> diff --git a/tests/docroot/www/phpself.php b/tests/docroot/www/phpself.php deleted file mode 100644 index b78b9953..00000000 --- a/tests/docroot/www/phpself.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - print $_SERVER["PHP_SELF"]; -?> diff --git a/tests/fastcgi-10.conf b/tests/fastcgi-10.conf index dc082d9e..1300973a 100644 --- a/tests/fastcgi-10.conf +++ b/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 -# ) ) ) diff --git a/tests/fastcgi-13.conf b/tests/fastcgi-13.conf index 9d57974f..2d6a2bd7 100644 --- a/tests/fastcgi-13.conf +++ b/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" ), ) ) ) diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t index 8bcf81fd..fcda5d4d 100755 --- a/tests/mod-fastcgi.t +++ b/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"); } |