From 15b010907193c23e7d89918e74b90ff36e21bab9 Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Mon, 29 Aug 2005 12:08:00 +0000 Subject: [PATCH] run tests in build root (merged #228) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@640 152afb58-edef-0310-8abb-c4023f1b3aa9 --- tests/LightyTest.pm | 29 ++++++++++++++++++----------- tests/Makefile.am | 2 +- tests/bug-06.conf | 20 ++++++++++---------- tests/bug-12.conf | 20 ++++++++++---------- tests/cleanup.sh | 4 ++-- tests/condition.conf | 16 ++++++++-------- tests/fastcgi-10.conf | 16 ++++++++-------- tests/fastcgi-13.conf | 16 ++++++++-------- tests/fastcgi-auth.conf | 18 +++++++++--------- tests/fastcgi-responder.conf | 16 ++++++++-------- tests/lighttpd.conf | 20 ++++++++++---------- tests/mod-proxy.t | 4 ++-- tests/prepare.sh | 9 ++++++--- tests/proxy.conf | 20 ++++++++++---------- tests/var-include.conf | 12 ++++++------ 15 files changed, 116 insertions(+), 106 deletions(-) diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index 2fade4c7..0578a7f8 100755 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -8,14 +8,23 @@ use Test::More; sub new { my $class = shift; my $self = {}; + my $lpath; $self->{CONFIGFILE} = 'lighttpd.conf'; - $self->{BASEDIR} = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'} : '..'); - $self->{SRCDIR} = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.'); + + $lpath = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'} : '..'); + $lpath = `readlink -f '$lpath'`; + chomp $lpath; + $self->{BASEDIR} = $lpath; + + $lpath = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.'); +# $lpath = `readlink -f '$lpath'`; +# chomp $lpath; + $self->{SRCDIR} = $lpath; $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/src/lighttpd'; - $self->{LIGHTTPD_PIDFILE} = '/tmp/lighttpd/lighttpd.pid'; - $self->{PIDOF_PIDFILE} = '/tmp/lighttpd/pidof.pid'; + $self->{LIGHTTPD_PIDFILE} = $self->{SRCDIR}.'/tmp/lighttpd/lighttpd.pid'; + $self->{PIDOF_PIDFILE} = $self->{SRCDIR}.'/tmp/lighttpd/pidof.pid'; $self->{PORT} = 2048; bless($self, $class); @@ -63,24 +72,22 @@ sub start_proc { # pre-process configfile if necessary # - my $pwd = `pwd`; - chomp($pwd); - unlink("/tmp/cfg.file"); - system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$pwd.'/'.$self->{BASEDIR}.'/tests/#" > /tmp/cfg.file'); + unlink($self->{SRCDIR}."/tmp/cfg.file"); + system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$self->{BASEDIR}.'/tests/#" > '.$self->{SRCDIR}.'/tmp/cfg.file'); unlink($self->{LIGHTTPD_PIDFILE}); if (1) { - system($self->{LIGHTTPD_PATH}." -f /tmp/cfg.file"); + system($self->{LIGHTTPD_PATH}." -f ".$self->{SRCDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs"); select(undef, undef, undef, 0.1); } else { - system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f /tmp/cfg.file &"); + system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f ".$self->{SRCDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs &"); select(undef, undef, undef, 2); } # sleep(1); - unlink("/tmp/cfg.file"); + unlink($self->{SRCDIR}."/tmp/cfg.file"); # no pidfile, we failed if (not -e $self->{LIGHTTPD_PIDFILE}) { diff --git a/tests/Makefile.am b/tests/Makefile.am index 6cca0ab8..ba04ca8b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ # lighttpd.conf and conformance.pl expect this directory -testdir=/tmp/lighttpd/ +testdir=$(srcdir)/tmp/lighttpd/ if CHECK_WITH_FASTCGI check_PROGRAMS=fcgi-auth fcgi-responder diff --git a/tests/bug-06.conf b/tests/bug-06.conf index 89407903..5273c4ac 100644 --- a/tests/bug-06.conf +++ b/tests/bug-06.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 @@ -8,7 +8,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -59,7 +59,7 @@ server.indexfiles = ( "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -77,7 +77,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") setenv.add-environment = ( "TRAC_ENV" => "foo") @@ -90,7 +90,7 @@ fastcgi.server = ( ".php" => ( "host" => "127.0.0.1", "port" => 1026, # "mode" => "authorizer", -# "docroot" => "/tmp/lighttpd/servers/www.example.org/pages/", +# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", ) ) ) @@ -106,7 +106,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -149,15 +149,15 @@ status.status-url = "/server-status" status.config-url = "/server-config" simple-vhost.document-root = "pages" -simple-vhost.server-root = "/tmp/lighttpd/servers/" +simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" simple-vhost.default-host = "www.example.org" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/bug-12.conf b/tests/bug-12.conf index ad006a4a..491ff9e9 100644 --- a/tests/bug-12.conf +++ b/tests/bug-12.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 @@ -8,7 +8,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -61,7 +61,7 @@ server.error-handler-404 = "/indexfile/return-404.php" ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -79,7 +79,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") setenv.add-environment = ( "TRAC_ENV" => "foo") @@ -92,7 +92,7 @@ fastcgi.server = ( ".php" => ( "host" => "127.0.0.1", "port" => 1026, # "mode" => "authorizer", -# "docroot" => "/tmp/lighttpd/servers/www.example.org/pages/", +# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", ) ) ) @@ -108,7 +108,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -151,15 +151,15 @@ status.status-url = "/server-status" status.config-url = "/server-config" simple-vhost.document-root = "pages" -simple-vhost.server-root = "/tmp/lighttpd/servers/" +simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" simple-vhost.default-host = "www.example.org" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/cleanup.sh b/tests/cleanup.sh index 88e241f7..a02ae9ae 100755 --- a/tests/cleanup.sh +++ b/tests/cleanup.sh @@ -1,11 +1,11 @@ #!/bin/sh -tmpdir=/tmp/lighttpd - if test x$srcdir = x; then srcdir=. fi +tmpdir=$srcdir/tmp/lighttpd + # create test-framework # rm -rf $tmpdir diff --git a/tests/condition.conf b/tests/condition.conf index 67eaeaf2..7fd58d7e 100644 --- a/tests/condition.conf +++ b/tests/condition.conf @@ -2,15 +2,15 @@ debug.log-request-handling = "enable" debug.log-condition-handling = "enable" -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -22,25 +22,25 @@ server.modules = ( ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".html" => "text/html" ) url.redirect = ("^" => "/default") $HTTP["host"] == "www.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "www.example.org" url.redirect = ("^" => "/match_1") } else $HTTP["host"] == "test1.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "test1.example.org" url.redirect = ("^" => "/match_2") } # comments else $HTTP["host"] == "test2.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "test2.example.org" url.redirect = ("^" => "/match_3") } @@ -48,7 +48,7 @@ else $HTTP["host"] == "test2.example.org" { # comments else $HTTP["host"] == "test3.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "test3.example.org" url.redirect = ("^" => "/match_4") diff --git a/tests/fastcgi-10.conf b/tests/fastcgi-10.conf index 8c6bcaea..dc082d9e 100644 --- a/tests/fastcgi-10.conf +++ b/tests/fastcgi-10.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 @@ -8,7 +8,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -57,7 +57,7 @@ server.indexfiles = ( "index.php", "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -75,7 +75,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") fastcgi.debug = 0 @@ -103,7 +103,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -146,11 +146,11 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/fastcgi-13.conf b/tests/fastcgi-13.conf index 18afbe13..9d57974f 100644 --- a/tests/fastcgi-13.conf +++ b/tests/fastcgi-13.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" debug.log-request-header = "enable" debug.log-response-header = "enable" @@ -12,7 +12,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -61,7 +61,7 @@ server.indexfiles = ( "index.php", "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -79,7 +79,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") fastcgi.debug = 0 @@ -103,7 +103,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -146,11 +146,11 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/fastcgi-auth.conf b/tests/fastcgi-auth.conf index df278bec..c55700cf 100644 --- a/tests/fastcgi-auth.conf +++ b/tests/fastcgi-auth.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" debug.log-request-header = "enable" debug.log-response-header = "enable" @@ -12,7 +12,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -61,7 +61,7 @@ server.indexfiles = ( "index.php", "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -79,7 +79,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") fastcgi.debug = 0 @@ -89,7 +89,7 @@ fastcgi.server = ( "/" => ( "port" => 20000, "bin-path" => "@SRCDIR@/fcgi-auth", "mode" => "authorizer", - "docroot" => "/tmp/lighttpd/servers/www.example.org/pages/", + "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", ) ) @@ -106,7 +106,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -149,11 +149,11 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/fastcgi-responder.conf b/tests/fastcgi-responder.conf index 92e57ac7..7ced64bd 100644 --- a/tests/fastcgi-responder.conf +++ b/tests/fastcgi-responder.conf @@ -1,5 +1,5 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" #debug.log-request-header = "enable" #debug.log-response-header = "enable" @@ -15,7 +15,7 @@ server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -64,7 +64,7 @@ server.indexfiles = ( "index.php", "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -82,7 +82,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") fastcgi.debug = 0 @@ -109,7 +109,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -152,11 +152,11 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf index 52d560a5..7ecb246a 100644 --- a/tests/lighttpd.conf +++ b/tests/lighttpd.conf @@ -1,12 +1,12 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -44,7 +44,7 @@ server.indexfiles = ( "index.php", "index.html", ssi.extension = ( ".shtml" ) -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -62,7 +62,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") secdownload.secret = "verysecret" @@ -91,7 +91,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -136,22 +136,22 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } $HTTP["host"] == "no-simple.example.org" { - server.document-root = "/tmp/lighttpd/servers/123.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/123.example.org/pages/" server.name = "zzz.example.org" } $HTTP["host"] !~ "(no-simple\.example\.org)" { simple-vhost.document-root = "pages" - simple-vhost.server-root = "/tmp/lighttpd/servers/" + simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" simple-vhost.default-host = "www.example.org" } diff --git a/tests/mod-proxy.t b/tests/mod-proxy.t index dcc27678..2f53ddc3 100755 --- a/tests/mod-proxy.t +++ b/tests/mod-proxy.t @@ -22,11 +22,11 @@ my $t; $tf_real->{PORT} = 2048; $tf_real->{CONFIGFILE} = 'lighttpd.conf'; -$tf_real->{LIGHTTPD_PIDFILE} = '/tmp/lighttpd/lighttpd.pid'; +$tf_real->{LIGHTTPD_PIDFILE} = $tf_real->{SRCDIR}.'/tmp/lighttpd/lighttpd.pid'; $tf_proxy->{PORT} = 2050; $tf_proxy->{CONFIGFILE} = 'proxy.conf'; -$tf_proxy->{LIGHTTPD_PIDFILE} = '/tmp/lighttpd/lighttpd-proxy.pid'; +$tf_proxy->{LIGHTTPD_PIDFILE} = $tf_proxy->{SRCDIR}.'/tmp/lighttpd/lighttpd-proxy.pid'; ok($tf_real->start_proc == 0, "Starting lighttpd") or die(); diff --git a/tests/prepare.sh b/tests/prepare.sh index 451151a6..e7a68a92 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -1,11 +1,11 @@ #!/bin/sh -tmpdir=/tmp/lighttpd - if test x$srcdir = x; then srcdir=. fi +tmpdir=$srcdir/tmp/lighttpd + # create test-framework rm -rf $tmpdir mkdir -p $tmpdir/servers/www.example.org/pages/ @@ -24,6 +24,9 @@ cp $srcdir/docroot/www/*.html \ $srcdir/docroot/www/*.pl \ $srcdir/docroot/www/*.fcgi \ $srcdir/docroot/www/*.shtml \ + $srcdir/docroot/www/*.jpg \ + $srcdir/docroot/www/*.JPG \ + $srcdir/docroot/www/a \ $srcdir/docroot/www/*.txt $tmpdir/servers/www.example.org/pages/ cp $srcdir/docroot/www/go/*.php $tmpdir/servers/www.example.org/pages/go/ cp $srcdir/docroot/www/expire/*.txt $tmpdir/servers/www.example.org/pages/expire/ @@ -33,7 +36,7 @@ cp $srcdir/docroot/123/*.txt \ $srcdir/docroot/123/*.php \ $srcdir/docroot/123/*.bla $tmpdir/servers/123.example.org/pages/ cp $srcdir/lighttpd.user $tmpdir/ -cp $srcdir/var-include-sub.conf /tmp/ +cp $srcdir/var-include-sub.conf $srcdir/tmp printf "%-40s" "preparing infrastructure" diff --git a/tests/proxy.conf b/tests/proxy.conf index e6ac8653..e272b2ff 100644 --- a/tests/proxy.conf +++ b/tests/proxy.conf @@ -1,12 +1,12 @@ -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd-proxy.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd-proxy.pid" ## bind to port (default: 80) server.port = 2050 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Proxy" @@ -42,7 +42,7 @@ server.indexfiles = ( "index.php", "index.html", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", @@ -60,7 +60,7 @@ mimetype.assign = ( ".png" => "image/png", ".c" => "text/plain", ".conf" => "text/plain" ) -compress.cache-dir = "/tmp/lighttpd/cache/compress/" +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" compress.filetype = ("text/plain", "text/html") setenv.add-environment = ( "TRAC_ENV" => "foo") @@ -88,7 +88,7 @@ ssl.engine = "disable" ssl.pemfile = "server.pem" auth.backend = "plain" -auth.backend.plain.userfile = "/tmp/lighttpd/lighttpd.user" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" auth.backend.plain.groupfile = "lighttpd.group" auth.backend.ldap.hostname = "localhost" @@ -135,22 +135,22 @@ status.status-url = "/server-status" status.config-url = "/server-config" $HTTP["host"] == "vvv.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" } $HTTP["host"] == "zzz.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "zzz.example.org" } $HTTP["host"] == "no-simple.example.org" { - server.document-root = "/tmp/lighttpd/servers/123.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/123.example.org/pages/" server.name = "zzz.example.org" } $HTTP["host"] !~ "(no-simple\.example\.org)" { simple-vhost.document-root = "pages" - simple-vhost.server-root = "/tmp/lighttpd/servers/" + simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" simple-vhost.default-host = "www.example.org" } diff --git a/tests/var-include.conf b/tests/var-include.conf index ab8d22c6..00595ba6 100644 --- a/tests/var-include.conf +++ b/tests/var-include.conf @@ -2,15 +2,15 @@ debug.log-request-handling = "enable" debug.log-condition-handling = "enable" -server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" -server.pid-file = "/tmp/lighttpd/lighttpd.pid" +server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +server.pid-file = "@SRCDIR@/tmp/lighttpd/lighttpd.pid" ## bind to port (default: 80) server.port = 2048 ## bind to localhost (default: all interfaces) server.bind = "localhost" -server.errorlog = "/tmp/lighttpd/logs/lighttpd.error.log" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" server.name = "www.example.org" server.tag = "Apache 1.3.29" @@ -21,19 +21,19 @@ server.modules = ( "mod_redirect", ######################## MODULE CONFIG ############################ -accesslog.filename = "/tmp/lighttpd/logs/lighttpd.access.log" +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" mimetype.assign = ( ".html" => "text/html" ) url.redirect = ("^" => "/default") $HTTP["host"] == "www.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "www.example.org" url.redirect = ("^" => "/redirect") } $HTTP["host"] == "test.example.org" { - server.document-root = "/tmp/lighttpd/servers/www.example.org/pages/" + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" server.name = "test.example.org" var.myvar = "good" var.one = 1