[tests] more test config cleanup

This commit is contained in:
Glenn Strauss 2018-12-18 00:08:46 -05:00
parent fe3dc17968
commit a1077d18cb
5 changed files with 6 additions and 84 deletions

View File

@ -24,40 +24,23 @@ server.indexfiles = (
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
$HTTP["host"] == "bin-env.example.org" {
fastcgi.server = (
".php" => (
"grisu" => (
"host" => "127.0.0.1",
"port" => 1048,
"bin-path" => env.PHP,
"bin-copy-environment" => ( "PATH", "SHELL", "USER", ),
),
),
)
}
else {
fastcgi.debug = 0
fastcgi.server = (
".php" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"broken-scriptfilename" => "enable",
"bin-path" => env.PHP,
"bin-copy-environment" => ( "PATH", "SHELL", "USER", ),
"allow-x-send-file" => "enable",
) ),
"/prefix.fcgi" => ( (
"host" => "127.0.0.1",
"port" => 1026,
"check-local" => "disable",
"broken-scriptfilename" => "enable",
"bin-path" => env.PHP,
"bin-copy-environment" => ( "PATH", "SHELL", "USER", ),
) ),
)
}
server.error-handler-404 = "/indexfile/return-404.php"
$HTTP["host"] == "zzz.example.org" {
@ -65,7 +48,6 @@ $HTTP["host"] == "zzz.example.org" {
}
$HTTP["host"] == "auth.example.org" {
server.document-root = env.SRCDIR + "/tmp/lighttpd/servers/www.example.org/pages/"
server.name = "auth.example.org"
auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
auth.backend = "htpasswd"

View File

@ -11,50 +11,18 @@ server.breakagelog = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.breakage.
server.force-lowercase-filenames = "enable"
server.modules = (
"mod_setenv",
"mod_secdownload",
"mod_access",
"mod_auth",
"mod_authn_file",
"mod_status",
"mod_expire",
"mod_cgi",
)
server.indexfiles = (
"index.html",
"index.htm",
"default.htm",
)
mimetype.assign = (
".png" => "image/png",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".html" => "text/html",
".htm" => "text/html",
".pdf" => "application/pdf",
".swf" => "application/x-shockwave-flash",
".spl" => "application/futuresplash",
".txt" => "text/plain",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".gz" => "application/x-gzip",
".c" => "text/plain",
".conf" => "text/plain",
)
cgi.assign = (
".pl" => env.PERL,
".cgi" => env.PERL,
)
auth.backend = "plain"
auth.backend.plain.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.user"
auth.backend.htpasswd.userfile = env.SRCDIR + "/tmp/lighttpd/lighttpd.htpasswd"
$HTTP["host"] == "lowercase-auth" {
auth.require = (
"/image.jpg" => (

View File

@ -7,22 +7,15 @@ BEGIN {
}
use strict;
use Test::More tests => 48;
use Test::More tests => 46;
use LightyTest;
my $tf = LightyTest->new();
my $t;
my $php_child = -1;
SKIP: {
skip "PHP already running on port 1026", 1 if $tf->listening_on(1026);
skip "no php binary found", 1 unless $LightyTest::HAVE_PHP;
ok(-1 != ($php_child = $tf->spawnfcgi($ENV{'PHP'}, 1026)), "Spawning php");
}
SKIP: {
skip "no PHP running on port 1026", 31 unless $tf->listening_on(1026);
skip "no php binary found", 31 unless $LightyTest::HAVE_PHP;
$tf->{CONFIGFILE} = 'fastcgi-10.conf';
ok($tf->start_proc == 0, "Starting lighttpd") or goto cleanup;
@ -261,12 +254,6 @@ 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, fcgi-responder found", 15
unless (-x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe")
@ -392,6 +379,4 @@ exit 0;
cleanup: ;
$tf->endspawnfcgi($php_child) if $php_child != -1;
die();

View File

@ -15,7 +15,6 @@ my $tf_real = LightyTest->new();
my $tf_proxy = LightyTest->new();
my $t;
my $php_child = -1;
## we need two procs
## 1. the real webserver
@ -63,7 +62,6 @@ exit 0;
cleanup:
$tf_real->endspawnfcgi($php_child) if $php_child != -1;
$tf_real->stop_proc;
$tf_proxy->stop_proc;

View File

@ -12,23 +12,12 @@ server.tag = "Proxy"
server.modules = (
"mod_rewrite",
"mod_setenv",
"mod_proxy",
"mod_accesslog",
)
accesslog.filename = env.SRCDIR + "/tmp/lighttpd/logs/lighttpd.access.log"
setenv.add-environment = (
"TRAC_ENV" => "foo",
)
setenv.add-request-header = (
"FOO" => "foo",
)
setenv.add-response-header = (
"BAR" => "foo",
)
proxy.debug = 1
proxy.server = ( "" => (
"grisu" => (