|
|
|
@ -7,17 +7,26 @@ BEGIN {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
use strict; |
|
|
|
|
use Test::More tests => 47; |
|
|
|
|
use Test::More tests => 49; |
|
|
|
|
use LightyTest; |
|
|
|
|
|
|
|
|
|
my $tf = LightyTest->new(); |
|
|
|
|
|
|
|
|
|
my $t; |
|
|
|
|
my $php_child = -1; |
|
|
|
|
|
|
|
|
|
my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi'); |
|
|
|
|
|
|
|
|
|
SKIP: { |
|
|
|
|
skip "PHP already running on port 1026", 1 if $tf->listening_on(1026); |
|
|
|
|
skip "no php binary found", 1 unless -x $phpbin; |
|
|
|
|
ok(-1 != ($php_child = $tf->spawnfcgi($phpbin, 1026)), "Spawning php"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SKIP: { |
|
|
|
|
skip "no PHP running on port 1026", 29 unless $tf->listening_on(1026); |
|
|
|
|
|
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd") or die(); |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup; |
|
|
|
|
|
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
GET /phpinfo.php HTTP/1.0 |
|
|
|
@ -161,7 +170,7 @@ EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tf->{CONFIGFILE} = 'fastcgi-10.conf'; |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup; |
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 |
|
|
|
|
Host: zzz.example.org |
|
|
|
@ -173,7 +182,7 @@ EOF
|
|
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd"); |
|
|
|
|
|
|
|
|
|
$tf->{CONFIGFILE} = 'bug-06.conf'; |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or goto cleanup; |
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
GET /indexfile/ HTTP/1.0 |
|
|
|
|
Host: www.example.org |
|
|
|
@ -185,7 +194,7 @@ EOF
|
|
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd"); |
|
|
|
|
|
|
|
|
|
$tf->{CONFIGFILE} = 'bug-12.conf'; |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with bug-12.conf") or die(); |
|
|
|
|
ok($tf->start_proc == 0, "Starting lighttpd with bug-12.conf") or goto cleanup; |
|
|
|
|
$t->{REQUEST} = ( <<EOF |
|
|
|
|
POST /indexfile/abc HTTP/1.0 |
|
|
|
|
Host: www.example.org |
|
|
|
@ -198,6 +207,12 @@ EOF
|
|
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SKIP: { |
|
|
|
|
skip "PHP not started, cannot stop it", 1 unless $php_child != -1; |
|
|
|
|
ok(0 == $tf->endspawnfcgi($php_child), "Stopping php"); |
|
|
|
|
$php_child = -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SKIP: { |
|
|
|
|
skip "no fcgi-auth found", 4 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe"; |
|
|
|
|
|
|
|
|
@ -325,3 +340,10 @@ EOF
|
|
|
|
|
ok($tf->stop_proc == 0, "Stopping lighttpd"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
exit 0; |
|
|
|
|
|
|
|
|
|
cleanup: ; |
|
|
|
|
|
|
|
|
|
$tf->endspawnfcgi($php_child) if $php_child != -1; |
|
|
|
|
|
|
|
|
|
die(); |
|
|
|
|