version 1.1, 2013/10/14 10:32:47
|
version 1.1.1.2, 2016/11/02 10:35:00
|
Line 15 my $tf = LightyTest->new();
|
Line 15 my $tf = LightyTest->new();
|
my $t; |
my $t; |
my $php_child = -1; |
my $php_child = -1; |
|
|
my $phpbin = (defined $ENV{'PHP'} ? $ENV{'PHP'} : '/usr/bin/php-cgi'); |
|
$ENV{'PHP'} = $phpbin; |
|
|
|
SKIP: { |
SKIP: { |
skip "PHP already running on port 1026", 1 if $tf->listening_on(1026); |
skip "PHP already running on port 1026", 1 if $tf->listening_on(1026); |
skip "no php binary found", 1 unless -x $phpbin; | skip "no php binary found", 1 unless $LightyTest::HAVE_PHP; |
ok(-1 != ($php_child = $tf->spawnfcgi($phpbin, 1026)), "Spawning php"); | ok(-1 != ($php_child = $tf->spawnfcgi($ENV{'PHP'}, 1026)), "Spawning php"); |
} |
} |
|
|
SKIP: { |
SKIP: { |
Line 132 EOF
|
Line 129 EOF
|
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; |
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; |
ok($tf->handle_http($t) == 0, 'PATHINFO'); |
ok($tf->handle_http($t) == 0, 'PATHINFO'); |
|
|
|
if ($^O ne "cygwin") { |
$t->{REQUEST} = ( <<EOF |
$t->{REQUEST} = ( <<EOF |
GET /cgi.php%20%20%20 HTTP/1.0 |
GET /cgi.php%20%20%20 HTTP/1.0 |
EOF |
EOF |
); |
); |
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; |
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; |
ok($tf->handle_http($t) == 0, 'No source retrieval'); |
ok($tf->handle_http($t) == 0, 'No source retrieval'); |
|
} else { |
|
ok(1, 'No source retrieval; skipped on cygwin; see response.c'); |
|
} |
|
|
$t->{REQUEST} = ( <<EOF |
$t->{REQUEST} = ( <<EOF |
GET /www/abc/def HTTP/1.0 |
GET /www/abc/def HTTP/1.0 |
Line 295 EOF
|
Line 296 EOF
|
} |
} |
|
|
SKIP: { |
SKIP: { |
skip "no php found", 5 unless -x $phpbin; | skip "no php found", 5 unless $LightyTest::HAVE_PHP; |
$tf->{CONFIGFILE} = 'fastcgi-13.conf'; |
$tf->{CONFIGFILE} = 'fastcgi-13.conf'; |
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); |
ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); |
$t->{REQUEST} = ( <<EOF |
$t->{REQUEST} = ( <<EOF |