diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:34 +0100 |
commit | eb45c46b906e492f063f1469486190e93ff340ff (patch) | |
tree | 85d615969fa7bf8056a05b59006f77bc63e85892 /tests | |
parent | 6426b37107707a1d95ffd03f68620cbda8bdb942 (diff) | |
download | lighttpd-eb45c46b906e492f063f1469486190e93ff340ff.tar.gz |
Imported Upstream version 1.4.10upstream/1.4.10
Diffstat (limited to 'tests')
75 files changed, 7300 insertions, 0 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm new file mode 100755 index 0000000..85a08ef --- /dev/null +++ b/tests/LightyTest.pm @@ -0,0 +1,290 @@ +#! /usr/bin/perl -w + +package LightyTest; +use strict; +use IO::Socket; +use Test::More; +use Socket; +use Cwd 'abs_path'; + +sub mtime { + my $file = shift; + my @stat = stat $file; + return @stat ? $stat[9] : 0; +} +sub new { + my $class = shift; + my $self = {}; + my $lpath; + + $self->{CONFIGFILE} = 'lighttpd.conf'; + + $lpath = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'} : '..'); + $self->{BASEDIR} = abs_path($lpath); + + $lpath = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'}."/tests/" : '.'); + $self->{TESTDIR} = abs_path($lpath); + + $lpath = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.'); + $self->{SRCDIR} = abs_path($lpath); + + + if (mtime($self->{BASEDIR}.'/src/lighttpd') > mtime($self->{BASEDIR}.'/build/lighttpd')) { + $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/src/lighttpd'; + $self->{MODULES_PATH} = $self->{BASEDIR}.'/src/.libs'; + } else { + $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/build/lighttpd'; + $self->{MODULES_PATH} = $self->{BASEDIR}.'/build'; + } + $self->{LIGHTTPD_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/lighttpd.pid'; + $self->{PIDOF_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/pidof.pid'; + $self->{PORT} = 2048; + + my ($name, $aliases, $addrtype, $net) = gethostbyaddr(inet_aton("127.0.0.1"), AF_INET); + + $self->{HOSTNAME} = $name; + + bless($self, $class); + + return $self; +} + +sub listening_on { + my $self = shift; + my $port = shift; + + my $remote = + IO::Socket::INET->new(Proto => "tcp", + PeerAddr => "127.0.0.1", + PeerPort => $port) or return 0; + + close $remote; + + return 1; +} + +sub stop_proc { + my $self = shift; + + open F, $self->{LIGHTTPD_PIDFILE} or return -1; + my $pid = <F>; + close F; + + if (defined $pid) { + kill('TERM',$pid) or return -1; + select(undef, undef, undef, 0.01); + } + + return 0; +} + + +sub start_proc { + my $self = shift; + # kill old proc if necessary + $self->stop_proc; + + # pre-process configfile if necessary + # + + unlink($self->{TESTDIR}."/tmp/cfg.file"); + system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$self->{BASEDIR}.'/tests/#" > '.$self->{TESTDIR}.'/tmp/cfg.file'); + + unlink($self->{LIGHTTPD_PIDFILE}); + if (1) { + system($self->{LIGHTTPD_PATH}." -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{MODULES_PATH}); + } else { + system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{MODULES_PATH}." &"); + } + + select(undef, undef, undef, 0.1); + if (not -e $self->{LIGHTTPD_PIDFILE} or 0 == kill 0, `cat $self->{LIGHTTPD_PIDFILE}`) { + select(undef, undef, undef, 2); + } + + unlink($self->{TESTDIR}."/tmp/cfg.file"); + + # no pidfile, we failed + if (not -e $self->{LIGHTTPD_PIDFILE}) { + diag(sprintf('Could not find pidfile: %s', $self->{LIGHTTPD_PIDFILE})); + return -1; + } + + # the process is gone, we failed + if (0 == kill 0, `cat $self->{LIGHTTPD_PIDFILE}`) { + diag(sprintf('the process referenced by %s is not up', $self->{LIGHTTPD_PIDFILE})); + return -1; + } + + 0; +} + +sub handle_http { + my $self = shift; + my $t = shift; + my $EOL = "\015\012"; + my $BLANK = $EOL x 2; + my $host = "127.0.0.1"; + + my @request = $t->{REQUEST}; + my @response = $t->{RESPONSE}; + + my $remote = + IO::Socket::INET->new(Proto => "tcp", + PeerAddr => $host, + PeerPort => $self->{PORT}); + + if (not defined $remote) { + diag("connect failed: $!"); + return -1; + } + + $remote->autoflush(1); + + foreach(@request) { + # pipeline requests + s/\r//g; + s/\n/$EOL/g; + + print $remote $_.$BLANK; + } + + my $lines = ""; + + # read everything + while(<$remote>) { + $lines .= $_; + } + + close $remote; + + my $full_response = $lines; + + my $href; + foreach $href ( @{ $t->{RESPONSE} }) { + # first line is always response header + my %resp_hdr; + my $resp_body; + my $resp_line; + my $conditions = $_; + + for (my $ln = 0; defined $lines; $ln++) { + (my $line, $lines) = split($EOL, $lines, 2); + + # header finished + last if(length($line) == 0); + + if ($ln == 0) { + # response header + $resp_line = $line; + } else { + # response vars + + if ($line =~ /^([^:]+):\s*(.+)$/) { + (my $h = $1) =~ tr/[A-Z]/[a-z]/; + + if (defined $resp_hdr{$h}) { + diag(sprintf("header %s is duplicated: %s and %s\n", + $h, $resp_hdr{$h}, $2)); + } else { + $resp_hdr{$h} = $2; + } + } else { + diag(sprintf("unexpected line '$line'\n")); + return -1; + } + } + } + + # check length + if (defined $resp_hdr{"content-length"}) { + $resp_body = substr($lines, 0, $resp_hdr{"content-length"}); + if (length($lines) < $resp_hdr{"content-length"}) { + $lines = ""; + } else { + $lines = substr($lines, $resp_hdr{"content-length"}); + } + undef $lines if (length($lines) == 0); + } else { + $resp_body = $lines; + undef $lines; + } + + # check conditions + if ($resp_line =~ /^(HTTP\/1\.[01]) ([0-9]{3}) .+$/) { + if ($href->{'HTTP-Protocol'} ne $1) { + diag(sprintf("proto failed: expected '%s', got '%s'\n", $href->{'HTTP-Protocol'}, $1)); + return -1; + } + if ($href->{'HTTP-Status'} ne $2) { + diag(sprintf("status failed: expected '%s', got '%s'\n", $href->{'HTTP-Status'}, $2)); + return -1; + } + } else { + diag(sprintf("unexpected resp_line '$resp_line'\n")); + return -1; + } + + if (defined $href->{'HTTP-Content'}) { + $resp_body = "" unless defined $resp_body; + if ($href->{'HTTP-Content'} ne $resp_body) { + diag(sprintf("body failed: expected '%s', got '%s'\n", $href->{'HTTP-Content'}, $resp_body)); + return -1; + } + } + + if (defined $href->{'-HTTP-Content'}) { + if (defined $resp_body && $resp_body ne '') { + diag(sprintf("body failed: expected empty body, got '%s'\n", $resp_body)); + return -1; + } + } + + foreach (keys %{ $href }) { + next if $_ eq 'HTTP-Protocol'; + next if $_ eq 'HTTP-Status'; + next if $_ eq 'HTTP-Content'; + next if $_ eq '-HTTP-Content'; + + (my $k = $_) =~ tr/[A-Z]/[a-z]/; + + my $no_val = 0; + + if (substr($k, 0, 1) eq '+') { + $k = substr($k, 1); + $no_val = 1; + + } + + if (!defined $resp_hdr{$k}) { + diag(sprintf("required header '%s' is missing\n", $k)); + return -1; + } + + if ($no_val == 0) { + if ($href->{$_} =~ /^\/(.+)\/$/) { + if ($resp_hdr{$k} !~ /$1/) { + diag(sprintf("response-header failed: expected '%s', got '%s', regex: %s\n", + $href->{$_}, $resp_hdr{$k}, $1)); + return -1; + } + } elsif ($href->{$_} ne $resp_hdr{$k}) { + diag(sprintf("response-header failed: expected '%s', got '%s'\n", + $href->{$_}, $resp_hdr{$k})); + return -1; + } + } + } + } + + # we should have sucked up everything + if (defined $lines) { + diag(sprintf("unexpected lines '$lines'\n")); + return -1; + } + + return 0; +} + +1; + diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..d4a9b10 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,65 @@ +# lighttpd.conf and conformance.pl expect this directory +testdir=$(srcdir)/tmp/lighttpd/ + +if CHECK_WITH_FASTCGI +check_PROGRAMS=fcgi-auth fcgi-responder + +fcgi_auth_SOURCES=fcgi-auth.c +fcgi_auth_LDADD=-lfcgi + +fcgi_responder_SOURCES=fcgi-responder.c +fcgi_responder_LDADD=-lfcgi +endif + +TESTS=\ + prepare.sh \ + run-tests.pl \ + cleanup.sh + +CONFS=fastcgi-10.conf \ + fastcgi-auth.conf \ + fastcgi-responder.conf \ + fastcgi-13.conf \ + bug-06.conf \ + bug-12.conf \ + core-var-include.t \ + var-include.conf \ + var-include-sub.conf \ + condition.conf \ + core-condition.t \ + core-request.t \ + core-response.t \ + core-keepalive.t \ + core.t \ + mod-access.t \ + mod-auth.t \ + mod-cgi.t \ + mod-compress.t \ + mod-fastcgi.t \ + mod-redirect.t \ + mod-userdir.t \ + mod-rewrite.t \ + request.t \ + mod-ssi.t \ + LightyTest.pm \ + mod-setenv.t + + +TESTS_ENVIRONMENT=$(srcdir)/wrapper.sh $(srcdir) $(top_builddir) + +EXTRA_DIST=wrapper.sh lighttpd.conf \ + lighttpd.user \ + lighttpd.htpasswd \ + $(CONFS) \ + $(TESTS) + +SUBDIRS=docroot + +leak-check: + for i in $(TESTS); do \ + $(srcdir)/$$i; \ + echo $$?; \ + done + +clean-local: + rm -f *.out diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..2827b2f --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,712 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +SOURCES = $(fcgi_auth_SOURCES) $(fcgi_responder_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@CHECK_WITH_FASTCGI_TRUE@check_PROGRAMS = fcgi-auth$(EXEEXT) \ +@CHECK_WITH_FASTCGI_TRUE@ fcgi-responder$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__fcgi_auth_SOURCES_DIST = fcgi-auth.c +@CHECK_WITH_FASTCGI_TRUE@am_fcgi_auth_OBJECTS = fcgi-auth.$(OBJEXT) +fcgi_auth_OBJECTS = $(am_fcgi_auth_OBJECTS) +fcgi_auth_DEPENDENCIES = +am__fcgi_responder_SOURCES_DIST = fcgi-responder.c +@CHECK_WITH_FASTCGI_TRUE@am_fcgi_responder_OBJECTS = \ +@CHECK_WITH_FASTCGI_TRUE@ fcgi-responder.$(OBJEXT) +fcgi_responder_OBJECTS = $(am_fcgi_responder_OBJECTS) +fcgi_responder_DEPENDENCIES = +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(fcgi_auth_SOURCES) $(fcgi_responder_SOURCES) +DIST_SOURCES = $(am__fcgi_auth_SOURCES_DIST) \ + $(am__fcgi_responder_SOURCES_DIST) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ + +# lighttpd.conf and conformance.pl expect this directory +testdir = $(srcdir)/tmp/lighttpd/ +@CHECK_WITH_FASTCGI_TRUE@fcgi_auth_SOURCES = fcgi-auth.c +@CHECK_WITH_FASTCGI_TRUE@fcgi_auth_LDADD = -lfcgi +@CHECK_WITH_FASTCGI_TRUE@fcgi_responder_SOURCES = fcgi-responder.c +@CHECK_WITH_FASTCGI_TRUE@fcgi_responder_LDADD = -lfcgi +TESTS = \ + prepare.sh \ + run-tests.pl \ + cleanup.sh + +CONFS = fastcgi-10.conf \ + fastcgi-auth.conf \ + fastcgi-responder.conf \ + fastcgi-13.conf \ + bug-06.conf \ + bug-12.conf \ + core-var-include.t \ + var-include.conf \ + var-include-sub.conf \ + condition.conf \ + core-condition.t \ + core-request.t \ + core-response.t \ + core-keepalive.t \ + core.t \ + mod-access.t \ + mod-auth.t \ + mod-cgi.t \ + mod-compress.t \ + mod-fastcgi.t \ + mod-redirect.t \ + mod-userdir.t \ + mod-rewrite.t \ + request.t \ + mod-ssi.t \ + LightyTest.pm \ + mod-setenv.t + +TESTS_ENVIRONMENT = $(srcdir)/wrapper.sh $(srcdir) $(top_builddir) +EXTRA_DIST = wrapper.sh lighttpd.conf \ + lighttpd.user \ + lighttpd.htpasswd \ + $(CONFS) \ + $(TESTS) + +SUBDIRS = docroot +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +fcgi-auth$(EXEEXT): $(fcgi_auth_OBJECTS) $(fcgi_auth_DEPENDENCIES) + @rm -f fcgi-auth$(EXEEXT) + $(LINK) $(fcgi_auth_LDFLAGS) $(fcgi_auth_OBJECTS) $(fcgi_auth_LDADD) $(LIBS) +fcgi-responder$(EXEEXT): $(fcgi_responder_OBJECTS) $(fcgi_responder_DEPENDENCIES) + @rm -f fcgi-responder$(EXEEXT) + $(LINK) $(fcgi_responder_LDFLAGS) $(fcgi_responder_OBJECTS) $(fcgi_responder_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcgi-auth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcgi-responder.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list='$(TESTS)'; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *" $$tst "*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-TESTS \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ + clean-local clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am + + +leak-check: + for i in $(TESTS); do \ + $(srcdir)/$$i; \ + echo $$?; \ + done + +clean-local: + rm -f *.out +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/bug-06.conf b/tests/bug-06.conf new file mode 100644 index 0000000..5273c4a --- /dev/null +++ b/tests/bug-06.conf @@ -0,0 +1,163 @@ +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 + +# server.license = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c" + +## bind to localhost (default: all interfaces) +server.bind = "localhost" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_setenv", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", + "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +server.indexfiles = ( "index.html", + "index.htm", "default.htm", "index.php" ) + +#,-- 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 ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +setenv.add-environment = ( "TRAC_ENV" => "foo") +setenv.add-request-header = ( "FOO" => "foo") +setenv.add-response-header = ( "BAR" => "foo") + +fastcgi.debug = 0 +fastcgi.server = ( ".php" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 1026, +# "mode" => "authorizer", +# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +simple-vhost.document-root = "pages" +simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" +simple-vhost.default-host = "www.example.org" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + 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 new file mode 100644 index 0000000..491ff9e --- /dev/null +++ b/tests/bug-12.conf @@ -0,0 +1,165 @@ +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 + +# server.license = "00000001000000013feccb804014587f000000010000000105911c976a3d462c8eaa2d7ca850432c" + +## bind to localhost (default: all interfaces) +server.bind = "localhost" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_setenv", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", + "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +server.indexfiles = ( "index.html", + "index.htm", "default.htm", "index.php" ) + +server.error-handler-404 = "/indexfile/return-404.php" + +#,-- 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 ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +setenv.add-environment = ( "TRAC_ENV" => "foo") +setenv.add-request-header = ( "FOO" => "foo") +setenv.add-response-header = ( "BAR" => "foo") + +fastcgi.debug = 0 +fastcgi.server = ( ".php" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 1026, +# "mode" => "authorizer", +# "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +simple-vhost.document-root = "pages" +simple-vhost.server-root = "@SRCDIR@/tmp/lighttpd/servers/" +simple-vhost.default-host = "www.example.org" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + 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 new file mode 100755 index 0000000..5ee34a6 --- /dev/null +++ b/tests/cleanup.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if test x$srcdir = x; then + srcdir=. +fi + +tmpdir=$top_builddir/tests/tmp/ + +# remove test-framework +rm -rf $tmpdir + +printf "%-40s" "cleaning up" + +exit 0 diff --git a/tests/condition.conf b/tests/condition.conf new file mode 100644 index 0000000..7fd58d7 --- /dev/null +++ b/tests/condition.conf @@ -0,0 +1,59 @@ + +debug.log-request-handling = "enable" +debug.log-condition-handling = "enable" + +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 = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + + +server.modules = ( + "mod_redirect", + "mod_accesslog" ) + +######################## MODULE CONFIG ############################ + + +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 = "@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 = "@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 = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + server.name = "test2.example.org" + url.redirect = ("^" => "/match_3") +} + + # comments + +else $HTTP["host"] == "test3.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + server.name = "test3.example.org" + url.redirect = ("^" => "/match_4") + + # comments + $HTTP["url"] == "/index.html" { + url.redirect = ("^" => "/match_5") + } +} diff --git a/tests/core-condition.t b/tests/core-condition.t new file mode 100755 index 0000000..96b05d8 --- /dev/null +++ b/tests/core-condition.t @@ -0,0 +1,139 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 17; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +$tf->{CONFIGFILE} = 'condition.conf'; +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_1" } ]; +ok($tf->handle_http($t) == 0, 'config deny'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Host: test1.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_2" } ]; +ok($tf->handle_http($t) == 0, '2nd child of chaining'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Host: test2.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_3" } ]; +ok($tf->handle_http($t) == 0, '3rd child of chaining'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Host: test3.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/match_5" } ]; +ok($tf->handle_http($t) == 0, 'nesting'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + +$tf->{CONFIGFILE} = 'lighttpd.conf'; +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /nofile.png HTTP/1.0 +Host: referer.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'condition: Referer - no referer'); + +$t->{REQUEST} = ( <<EOF +GET /nofile.png HTTP/1.0 +Host: referer.example.org +Referer: http://referer.example.org/ +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'condition: Referer - referer matches regex'); + +$t->{REQUEST} = ( <<EOF +GET /image.jpg HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'condition: Referer - no referer'); + +$t->{REQUEST} = ( <<EOF +GET /image.jpg HTTP/1.0 +Host: www.example.org +Referer: http://referer.example.org/ +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'condition: Referer - referer matches regex'); + +$t->{REQUEST} = ( <<EOF +GET /image.jpg HTTP/1.0 +Host: www.example.org +Referer: http://evil-referer.example.org/ +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; +ok($tf->handle_http($t) == 0, 'condition: Referer - referer doesn\'t match'); + +$t->{REQUEST} = ( <<EOF +GET /nofile HTTP/1.1 +Host: bug255.example.org + +GET /nofile HTTP/1.1 +Host: bug255.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 403 }, { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 403 } ]; +ok($tf->handle_http($t) == 0, 'remote ip cache (#255)'); + +$t->{REQUEST} = ( <<EOF +GET /empty-ref.noref HTTP/1.0 +Cookie: empty-ref +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; +ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is no set'); + +$t->{REQUEST} = ( <<EOF +GET /empty-ref.noref HTTP/1.0 +Cookie: empty-ref +Referer: +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; +ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer is empty'); + +$t->{REQUEST} = ( <<EOF +GET /empty-ref.noref HTTP/1.0 +Cookie: empty-ref +Referer: foobar +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'condition: $HTTP["referer"] == "" and Referer: foobar'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/core-keepalive.t b/tests/core-keepalive.t new file mode 100755 index 0000000..e3f6541 --- /dev/null +++ b/tests/core-keepalive.t @@ -0,0 +1,92 @@ +#!/usr/bin/env perl + +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 7; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Connection: keep-alive +Host: 123.example.org + +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + +ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive'); + +undef $t->{RESPONSE}; + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Connection: keep-alive +Host: 123.example.org + +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Connection: keep-alive +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + +ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.0 Keep-Alive'); + +undef $t->{RESPONSE}; + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Connection: keep-alive +Host: 123.example.org + +GET /12345.txt HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.0 Keep-Alive'); + + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.1 +Connection: keep-alive +Host: 123.example.org + +GET /12345.txt HTTP/1.1 +Host: 123.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Explicit HTTP/1.1 Keep-Alive'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.1 +Host: 123.example.org + +GET /12345.txt HTTP/1.1 +Host: 123.example.org +Connection: close +EOF + ); + +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } , { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ]; + +ok($tf->handle_http($t) == 0, 'Implicit HTTP/1.1 Keep-Alive'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); diff --git a/tests/core-request.t b/tests/core-request.t new file mode 100755 index 0000000..f4db937 --- /dev/null +++ b/tests/core-request.t @@ -0,0 +1,278 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 33; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +## Low-Level Request-Header Parsing - URI + +$t->{REQUEST} = ( <<EOF +GET /index%2ehtml HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'URL-encoding'); + +$t->{REQUEST} = ( <<EOF +GET /index.html%00 HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'URL-encoding, %00'); + + + +## Low-Level Request-Header Parsing - Host + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'hostname'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: 127.0.0.1 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'IPv4 address'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: [::1] +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'IPv6 address'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: www.example.org:80 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'hostname + port'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: 127.0.0.1:80 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'IPv4 address + port'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: [::1]:80 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'IPv6 address + port'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: ../123.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'directory traversal'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: .jsdh.sfdg.sdfg. +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'leading and trailing dot'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: jsdh.sfdg.sdfg. +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'trailing dot is ok'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: .jsdh.sfdg.sdfg +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'leading dot'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: jsdh..sfdg.sdfg +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'two dots'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: jsdh.sfdg.sdfg:asd +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'broken port-number'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: jsdh.sfdg.sdfg:-1 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'negative port-number'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: :80 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'port given but host missing'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: .jsdh.sfdg.:sdfg. +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'port and host are broken'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: a.b-c.d123 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'allowed characters in host-name'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: -a.c +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'leading dash'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: . +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'dot only'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: a192.168.2.10:1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'broken IPv4 address - non-digit'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: 192.168.2:1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'broken IPv4 address - too short'); + + + +## Low-Level Request-Header Parsing - Content-Length + + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Content-Length: -2 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'negative Content-Length'); + +$t->{REQUEST} = ( <<EOF +POST /12345.txt HTTP/1.0 +Host: 123.example.org +Content-Length: 2147483648 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 413 } ]; +ok($tf->handle_http($t) == 0, 'Content-Length > max-request-size'); + +$t->{REQUEST} = ( <<EOF +POST /12345.txt HTTP/1.0 +Host: 123.example.org +Content-Length: +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 411 } ]; +ok($tf->handle_http($t) == 0, 'Content-Length is empty'); + +print "\nLow-Level Request-Header Parsing - HTTP/1.1\n"; +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.1 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Host missing'); + +print "\nContent-Type\n"; +$t->{REQUEST} = ( <<EOF +GET /image.jpg HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/jpeg' } ]; +ok($tf->handle_http($t) == 0, 'Content-Type - image/jpeg'); + +$t->{REQUEST} = ( <<EOF +GET /image.JPG HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'image/jpeg' } ]; +ok($tf->handle_http($t) == 0, 'Content-Type - image/jpeg (upper case)'); + +$t->{REQUEST} = ( <<EOF +GET /a HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'application/octet-stream' } ]; +ok($tf->handle_http($t) == 0, 'Content-Type - unknown'); + +$t->{REQUEST} = ( <<EOF +GET HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'empty request-URI'); + +$t->{REQUEST} = ( <<EOF +GET /Foo.txt HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'uppercase filenames'); + + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/core-response.t b/tests/core-response.t new file mode 100755 index 0000000..a8fbd00 --- /dev/null +++ b/tests/core-response.t @@ -0,0 +1,109 @@ +#!/usr/bin/env perl + +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 12; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +## Low-Level Response-Header Parsing - HTTP/1.1 + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.1 +Host: www.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Date' => '' } ]; +ok($tf->handle_http($t) == 0, 'Date header'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.1 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 400, 'Connection' => 'close' } ]; +ok($tf->handle_http($t) == 0, 'Host missing'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+ETag' => '' } ]; +ok($tf->handle_http($t) == 0, 'ETag is set'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'ETag' => '/^".+"$/' } ]; +ok($tf->handle_http($t) == 0, 'ETag has quotes'); + + + +## Low-Level Response-Header Parsing - Content-Length + + +$t->{REQUEST} = ( <<EOF +GET /12345.html HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' } ]; +ok($tf->handle_http($t) == 0, 'Content-Length for text/html'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' } ]; +ok($tf->handle_http($t) == 0, 'Content-Length for text/plain'); + + +## Low-Level Response-Header Parsing - Location + +$t->{REQUEST} = ( <<EOF +GET /dummydir HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/dummydir/' } ]; +ok($tf->handle_http($t) == 0, 'internal redirect in directory'); + +$t->{REQUEST} = ( <<EOF +GET /dummydir?foo HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/dummydir/?foo' } ]; +ok($tf->handle_http($t) == 0, 'internal redirect in directory + querystring'); + +## simple-vhost + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: no-simple.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Length' => '6' } ]; +ok($tf->handle_http($t) == 0, 'disabling simple-vhost via conditionals'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: simple.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'simple-vhost via conditionals'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/core-var-include.t b/tests/core-var-include.t new file mode 100755 index 0000000..a6ccbd3 --- /dev/null +++ b/tests/core-var-include.t @@ -0,0 +1,61 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 17; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +$ENV{"env_test"} = "good_env"; + +$tf->{CONFIGFILE} = 'var-include.conf'; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( "GET /index.html HTTP/1.0\r\nHost: www.example.org\r\n" ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => "/redirect" } ]; +ok($tf->handle_http($t) == 0, 'basic test'); + +my $myvar = "good"; +my $server_name = "test.example.org"; +my $mystr = "string"; +$mystr .= "_append"; +my $tests = { + "include" => "/good_include", + "concat" => "/good_" . "concat", + "servername1" => "/good_" . $server_name, + "servername2" => $server_name . "/good_", + "servername3" => "/good_" . $server_name . "/", + "var.myvar" => "/good_var_myvar" . $myvar, + "myvar" => "/good_myvar" . $myvar, + "env" => "/" . $ENV{"env_test"}, + + "number1" => "/good_number" . "1", + "number2" => "1" . "/good_number", + "array_append" => "/good_array_append", + "string_append" => "/good_" . $mystr, + "number_append" => "/good_" . "2", + + "include_shell" => "/good_include_shell_" . "456" +}; + +foreach my $test (keys %{ $tests }) { + my $expect = $tests->{$test}; + $t->{REQUEST} = ( <<EOF +GET /$test HTTP/1.0 +Host: $server_name +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => $expect } ]; + ok($tf->handle_http($t) == 0, $test); +} + +ok($tf->stop_proc == 0, "Stopping lighttpd"); diff --git a/tests/core.t b/tests/core.t new file mode 100755 index 0000000..6d11cc6 --- /dev/null +++ b/tests/core.t @@ -0,0 +1,137 @@ +#!/usr/bin/env perl + +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 17; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Valid HTTP/1.0 Request') or die(); + +$t->{REQUEST} = ( <<EOF +GET / +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'missing Protocol'); + +$t->{REQUEST} = ( <<EOF +BC / +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'missing protocol + unknown method'); + +$t->{REQUEST} = ( <<EOF +ABC +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'missing protocol + unknown method + missing URI'); + +$t->{REQUEST} = ( <<EOF +ABC / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 501 } ]; +ok($tf->handle_http($t) == 0, 'unknown method'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.3 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 505 } ]; +ok($tf->handle_http($t) == 0, 'unknown protocol'); + +$t->{REQUEST} = ( <<EOF +GET http://www.example.org/ HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'absolute URI'); + +print "\nLow-Level Request-Header Parsing\n"; +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +ABC : foo +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'whitespace after key'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +ABC a: foo +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'whitespace with-in key'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +ABC:foo +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'no whitespace'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +ABC:foo + bc +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'line-folding'); + +print "\nLow-Level Request-Header Parsing - URI\n"; +$t->{REQUEST} = ( <<EOF +GET /index%2ehtml HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'URL-encoding'); + +$t->{REQUEST} = ( <<EOF +GET /index.html%00 HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'URL-encoding, %00'); + +$t->{REQUEST} = ( <<EOF +OPTIONS * HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'OPTIONS'); + +$t->{REQUEST} = ( <<EOF +OPTIONS / HTTP/1.1 +Host: www.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'OPTIONS'); + + + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/docroot/123/12345.html b/tests/docroot/123/12345.html new file mode 100644 index 0000000..e56e15b --- /dev/null +++ b/tests/docroot/123/12345.html @@ -0,0 +1 @@ +12345 diff --git a/tests/docroot/123/12345.txt b/tests/docroot/123/12345.txt new file mode 100644 index 0000000..e56e15b --- /dev/null +++ b/tests/docroot/123/12345.txt @@ -0,0 +1 @@ +12345 diff --git a/tests/docroot/123/Makefile.am b/tests/docroot/123/Makefile.am new file mode 100644 index 0000000..64712d7 --- /dev/null +++ b/tests/docroot/123/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST=12345.html 12345.txt dummyfile.bla phpinfo.php diff --git a/tests/docroot/123/Makefile.in b/tests/docroot/123/Makefile.in new file mode 100644 index 0000000..cabff31 --- /dev/null +++ b/tests/docroot/123/Makefile.in @@ -0,0 +1,350 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot/123 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +EXTRA_DIST = 12345.html 12345.txt dummyfile.bla phpinfo.php +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/123/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/123/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/123/dummyfile.bla b/tests/docroot/123/dummyfile.bla new file mode 100644 index 0000000..e56e15b --- /dev/null +++ b/tests/docroot/123/dummyfile.bla @@ -0,0 +1 @@ +12345 diff --git a/tests/docroot/123/phpinfo.php b/tests/docroot/123/phpinfo.php new file mode 100644 index 0000000..147cebc --- /dev/null +++ b/tests/docroot/123/phpinfo.php @@ -0,0 +1 @@ +<?php phpinfo(); ?> diff --git a/tests/docroot/Makefile.am b/tests/docroot/Makefile.am new file mode 100644 index 0000000..d14aa28 --- /dev/null +++ b/tests/docroot/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=123 www diff --git a/tests/docroot/Makefile.in b/tests/docroot/Makefile.in new file mode 100644 index 0000000..5d39cdf --- /dev/null +++ b/tests/docroot/Makefile.in @@ -0,0 +1,507 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +SUBDIRS = 123 www +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/www/Makefile.am b/tests/docroot/www/Makefile.am new file mode 100644 index 0000000..9198f56 --- /dev/null +++ b/tests/docroot/www/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST=cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \ + redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \ + nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \ + exec-date.shtml +SUBDIRS=go indexfile expire diff --git a/tests/docroot/www/Makefile.in b/tests/docroot/www/Makefile.in new file mode 100644 index 0000000..55988be --- /dev/null +++ b/tests/docroot/www/Makefile.in @@ -0,0 +1,512 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot/www +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +EXTRA_DIST = cgi.php cgi.pl dummydir index.html index.txt phpinfo.php \ + redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \ + nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \ + exec-date.shtml + +SUBDIRS = go indexfile expire +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/www/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/www/cgi-pathinfo.pl b/tests/docroot/www/cgi-pathinfo.pl new file mode 100644 index 0000000..af8d4df --- /dev/null +++ b/tests/docroot/www/cgi-pathinfo.pl @@ -0,0 +1,7 @@ +#! /usr/bin/perl + +print "Content-Type: text/html\r\n\r\n"; + +print $ENV{"PATH_INFO"}; + +0; diff --git a/tests/docroot/www/cgi.php b/tests/docroot/www/cgi.php new file mode 100755 index 0000000..d92e52f --- /dev/null +++ b/tests/docroot/www/cgi.php @@ -0,0 +1,9 @@ +<?php + +#ob_start(/*"ob_gzhandler"*/); +print "12345<br />\n"; +#phpinfo(); +#header("Content-Length: ".ob_get_length()); +#ob_end_flush(); + +?> diff --git a/tests/docroot/www/cgi.pl b/tests/docroot/www/cgi.pl new file mode 100644 index 0000000..9695adf --- /dev/null +++ b/tests/docroot/www/cgi.pl @@ -0,0 +1,7 @@ +#! /usr/bin/perl + +print "Content-Type: text/html\r\n\r\n"; + +print $ENV{"SCRIPT_NAME"}; + +0; diff --git a/tests/docroot/www/exec-date.shtml b/tests/docroot/www/exec-date.shtml new file mode 100644 index 0000000..2c8535b --- /dev/null +++ b/tests/docroot/www/exec-date.shtml @@ -0,0 +1 @@ +<!--#exec cmd="expr 1 + 1"--> diff --git a/tests/docroot/www/expire/Makefile.am b/tests/docroot/www/expire/Makefile.am new file mode 100644 index 0000000..7812b14 --- /dev/null +++ b/tests/docroot/www/expire/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST=access.txt modification.txt diff --git a/tests/docroot/www/expire/Makefile.in b/tests/docroot/www/expire/Makefile.in new file mode 100644 index 0000000..23e0c31 --- /dev/null +++ b/tests/docroot/www/expire/Makefile.in @@ -0,0 +1,350 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot/www/expire +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +EXTRA_DIST = access.txt modification.txt +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/expire/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/www/expire/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/www/expire/access.txt b/tests/docroot/www/expire/access.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/docroot/www/expire/access.txt diff --git a/tests/docroot/www/expire/modification.txt b/tests/docroot/www/expire/modification.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/docroot/www/expire/modification.txt diff --git a/tests/docroot/www/get-env.php b/tests/docroot/www/get-env.php new file mode 100644 index 0000000..15ac94f --- /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-header.pl b/tests/docroot/www/get-header.pl new file mode 100644 index 0000000..905f3e7 --- /dev/null +++ b/tests/docroot/www/get-header.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl + +my $s = $ENV{$ENV{"QUERY_STRING"}}; + +printf("Content-Length: %d\r\n", length($s)); +print "Content-Type: text/plain\r\n\r\n"; + +print $s; diff --git a/tests/docroot/www/get-post-len.pl b/tests/docroot/www/get-post-len.pl new file mode 100644 index 0000000..bac8bbf --- /dev/null +++ b/tests/docroot/www/get-post-len.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl + + +print "Content-Type: text/plain\r\n\r\n"; + +if ($ENV{"REQUEST_METHOD"} eq "POST") { + my $l = 0; + while(<>) { + $l += length($_); + } + print $l; +} else { + print "0"; +} + diff --git a/tests/docroot/www/get-server-env.php b/tests/docroot/www/get-server-env.php new file mode 100644 index 0000000..17b4994 --- /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/go/Makefile.am b/tests/docroot/www/go/Makefile.am new file mode 100644 index 0000000..fe20c50 --- /dev/null +++ b/tests/docroot/www/go/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST=cgi.php diff --git a/tests/docroot/www/go/Makefile.in b/tests/docroot/www/go/Makefile.in new file mode 100644 index 0000000..de2af27 --- /dev/null +++ b/tests/docroot/www/go/Makefile.in @@ -0,0 +1,350 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot/www/go +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +EXTRA_DIST = cgi.php +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/go/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/www/go/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/www/go/cgi.php b/tests/docroot/www/go/cgi.php new file mode 100755 index 0000000..d92e52f --- /dev/null +++ b/tests/docroot/www/go/cgi.php @@ -0,0 +1,9 @@ +<?php + +#ob_start(/*"ob_gzhandler"*/); +print "12345<br />\n"; +#phpinfo(); +#header("Content-Length: ".ob_get_length()); +#ob_end_flush(); + +?> diff --git a/tests/docroot/www/index.html b/tests/docroot/www/index.html new file mode 100644 index 0000000..3c14967 --- /dev/null +++ b/tests/docroot/www/index.html @@ -0,0 +1,113 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> +<TITLE>Webserver testpage</TITLE> +<META content="iso-8859-1" http-equiv="charset"> +<META name="author" content="Christian Hofmann, SuSE Linux AG"> +</HEAD> +<BODY BGCOLOR="#ffffff" LINK="#669900" ALINK="#669900" VLINK="#fb8000" text=black marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"> +<TABLE border="0" width="760" cellpadding="0" cellspacing="0"> + <TR> + <TD rowspan="4" bgcolor="#669900" width="50"> </TD> + <td valign=top height="70" width="29" bgcolor="#669900"> </td> + <td valign="middle" height="70" width="152" align="center" bgcolor="#669900"> </td> + <td valign=middle height="70" width="529" bgcolor="#669900"> + <div align="center"> + <font face="Courier New,Courier,mono" size="5" color="white"><B>+++ testinfo - webserver +++</b></font> + </div> + </td> + </tr> + <TR> + <td width="29" height="100" valign="middle" bgcolor="#669900"> </td> + <td width="152" height="100" align="center" valign="bottom"><IMG src="gif/penguin.gif" width=90 height=76 hspace=0 vspace=0 border=0 alt=" "></td> + <td width="529" height="100" valign="middle"> + <div align="center"> + <font face="Courier New,Courier,mono" size="3"><I>This is only a test page for the webserver!</I></font><br> + <font face="Courier New,Courier,mono" size="-1">SuSE is not responsible for the contents of this domain!</font> + </div> + </td> + </tr> + <tr> + <td valign=top align=left colspan="4"> + <table border="0" cellpadding="0" cellspacing="0" width="710" vspace="0" hspace="0"> + <TR> + <TD bgcolor="#669900" width="29" height="20"> </TD> + <TD width="152" height="20"> </TD> + <TD width="558" height="20" colspan="2"> </TD> + </tr> + <TR> + <TD height="50" align=left width="181" colspan="2"><IMG src="gif/sysinfo_en.png" width="181" height="50" border="0" alt="system information"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica, arial, sans-serif"> + <B>Operating system:</B> [ SuSE Linux 8.0 (i386) + ]<BR> + <B>Host:</B> [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) + ] + </FONT> + </TD> + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="40"> </TD> + <TD width="181" height="40"> </TD> + </TR> + + <TR> + <TD height="50" align=left width="181" colspan="2"><IMG src="gif/version_en.png" width="181" height="50" border="0" alt="webserver and modules"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica,arial,sans-serif"> + <B>Webserver version:</B><br> + [ lighttpd/0.1.0 (Unix) ]<br><br> + + <B>Installed modules:</B><br> + <I>[ PHP module is not installed ]</I><br> + <I>[ Apache perl module (mod_perl) is not installed ]</I><br> + <I>[ Apache DAV module (mod_dav) is not installed ]</I><br> + <I>[ Apache Python module (mod_python) is not installed ]</I><br> + + </FONT> + </TD> + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="100"> </TD> + <TD width="181" height="100"> </TD> + </TR> + <TR> + <TD colspan="2" height="50" align=left width="181"><IMG src="gif/docu_en.png" width="181" height="50" border="0" alt="documentation"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica,arial,sans-serif"> +<I>[ This host is not configured as server for the SuSE help system ]</I><br><br> +<I>[ Apache manual is not installed ]</I><br> + + <BR> + <A HREF="http://www.suse.de/">[ The SuSE website ]</A><BR> + + + + </FONT> + </TD> + + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="90"> </TD> + <TD width="181" height="90"> </TD> + </Table> + </td> + </tr> + <tr> + <td width=29 bgcolor="#669900"> </td> + <td valign=bottom align=right width="681" colspan="3"><A HREF="http://www.suse.de/en/"><IMG src="gif/powered_by_suse.gif" alt="powered by SuSE" width=100 height=40 hspace=5 vspace=5 border=0></A></td> + </tr> + +</TABLE> +</BODY> +</HTML> + + + + + + + + + + diff --git a/tests/docroot/www/index.txt b/tests/docroot/www/index.txt new file mode 100644 index 0000000..3c14967 --- /dev/null +++ b/tests/docroot/www/index.txt @@ -0,0 +1,113 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<HTML> +<HEAD> +<TITLE>Webserver testpage</TITLE> +<META content="iso-8859-1" http-equiv="charset"> +<META name="author" content="Christian Hofmann, SuSE Linux AG"> +</HEAD> +<BODY BGCOLOR="#ffffff" LINK="#669900" ALINK="#669900" VLINK="#fb8000" text=black marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"> +<TABLE border="0" width="760" cellpadding="0" cellspacing="0"> + <TR> + <TD rowspan="4" bgcolor="#669900" width="50"> </TD> + <td valign=top height="70" width="29" bgcolor="#669900"> </td> + <td valign="middle" height="70" width="152" align="center" bgcolor="#669900"> </td> + <td valign=middle height="70" width="529" bgcolor="#669900"> + <div align="center"> + <font face="Courier New,Courier,mono" size="5" color="white"><B>+++ testinfo - webserver +++</b></font> + </div> + </td> + </tr> + <TR> + <td width="29" height="100" valign="middle" bgcolor="#669900"> </td> + <td width="152" height="100" align="center" valign="bottom"><IMG src="gif/penguin.gif" width=90 height=76 hspace=0 vspace=0 border=0 alt=" "></td> + <td width="529" height="100" valign="middle"> + <div align="center"> + <font face="Courier New,Courier,mono" size="3"><I>This is only a test page for the webserver!</I></font><br> + <font face="Courier New,Courier,mono" size="-1">SuSE is not responsible for the contents of this domain!</font> + </div> + </td> + </tr> + <tr> + <td valign=top align=left colspan="4"> + <table border="0" cellpadding="0" cellspacing="0" width="710" vspace="0" hspace="0"> + <TR> + <TD bgcolor="#669900" width="29" height="20"> </TD> + <TD width="152" height="20"> </TD> + <TD width="558" height="20" colspan="2"> </TD> + </tr> + <TR> + <TD height="50" align=left width="181" colspan="2"><IMG src="gif/sysinfo_en.png" width="181" height="50" border="0" alt="system information"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica, arial, sans-serif"> + <B>Operating system:</B> [ SuSE Linux 8.0 (i386) + ]<BR> + <B>Host:</B> [ grisu.home.kneschke.de, Kernel: 2.4.18-4GB (i686) + ] + </FONT> + </TD> + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="40"> </TD> + <TD width="181" height="40"> </TD> + </TR> + + <TR> + <TD height="50" align=left width="181" colspan="2"><IMG src="gif/version_en.png" width="181" height="50" border="0" alt="webserver and modules"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica,arial,sans-serif"> + <B>Webserver version:</B><br> + [ lighttpd/0.1.0 (Unix) ]<br><br> + + <B>Installed modules:</B><br> + <I>[ PHP module is not installed ]</I><br> + <I>[ Apache perl module (mod_perl) is not installed ]</I><br> + <I>[ Apache DAV module (mod_dav) is not installed ]</I><br> + <I>[ Apache Python module (mod_python) is not installed ]</I><br> + + </FONT> + </TD> + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="100"> </TD> + <TD width="181" height="100"> </TD> + </TR> + <TR> + <TD colspan="2" height="50" align=left width="181"><IMG src="gif/docu_en.png" width="181" height="50" border="0" alt="documentation"></TD> + <TD width="529" colspan="2" rowspan="2" valign=top> + <FONT face="helvetica,arial,sans-serif"> +<I>[ This host is not configured as server for the SuSE help system ]</I><br><br> +<I>[ Apache manual is not installed ]</I><br> + + <BR> + <A HREF="http://www.suse.de/">[ The SuSE website ]</A><BR> + + + + </FONT> + </TD> + + </TR> + <TR> + <TD bgcolor="#669900" width="29" height="90"> </TD> + <TD width="181" height="90"> </TD> + </Table> + </td> + </tr> + <tr> + <td width=29 bgcolor="#669900"> </td> + <td valign=bottom align=right width="681" colspan="3"><A HREF="http://www.suse.de/en/"><IMG src="gif/powered_by_suse.gif" alt="powered by SuSE" width=100 height=40 hspace=5 vspace=5 border=0></A></td> + </tr> + +</TABLE> +</BODY> +</HTML> + + + + + + + + + + diff --git a/tests/docroot/www/indexfile/Makefile.am b/tests/docroot/www/indexfile/Makefile.am new file mode 100644 index 0000000..0472730 --- /dev/null +++ b/tests/docroot/www/indexfile/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST=index.php return-404.php rewrite.php diff --git a/tests/docroot/www/indexfile/Makefile.in b/tests/docroot/www/indexfile/Makefile.in new file mode 100644 index 0000000..7812d5e --- /dev/null +++ b/tests/docroot/www/indexfile/Makefile.in @@ -0,0 +1,350 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = tests/docroot/www/indexfile +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +ATTR_LIB = @ATTR_LIB@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BZ_LIB = @BZ_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_WITH_FASTCGI_FALSE = @CHECK_WITH_FASTCGI_FALSE@ +CHECK_WITH_FASTCGI_TRUE = @CHECK_WITH_FASTCGI_TRUE@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ +CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ +CRYPT_LIB = @CRYPT_LIB@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIB = @DL_LIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FAM_CFLAGS = @FAM_CFLAGS@ +FAM_LIBS = @FAM_LIBS@ +FFLAGS = @FFLAGS@ +GDBM_LIB = @GDBM_LIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBER_LIB = @LBER_LIB@ +LDAP_LIB = @LDAP_LIB@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUACONFIG = @LUACONFIG@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MEMCACHE_LIB = @MEMCACHE_LIB@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_INCLUDE = @MYSQL_INCLUDE@ +MYSQL_LIBS = @MYSQL_LIBS@ +NO_RDYNAMIC_FALSE = @NO_RDYNAMIC_FALSE@ +NO_RDYNAMIC_TRUE = @NO_RDYNAMIC_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECONFIG = @PCRECONFIG@ +PCRE_LIB = @PCRE_LIB@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SENDFILE_LIB = @SENDFILE_LIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CFLAGS = @SQLITE_CFLAGS@ +SQLITE_LIBS = @SQLITE_LIBS@ +SSL_LIB = @SSL_LIB@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +Z_LIB = @Z_LIB@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +EXTRA_DIST = index.php return-404.php rewrite.php +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/docroot/www/indexfile/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/docroot/www/indexfile/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/docroot/www/indexfile/index.php b/tests/docroot/www/indexfile/index.php new file mode 100644 index 0000000..e0c7d9e --- /dev/null +++ b/tests/docroot/www/indexfile/index.php @@ -0,0 +1 @@ +<?php print $_SERVER["PHP_SELF"]; ?> diff --git a/tests/docroot/www/indexfile/return-404.php b/tests/docroot/www/indexfile/return-404.php new file mode 100644 index 0000000..dd680cc --- /dev/null +++ b/tests/docroot/www/indexfile/return-404.php @@ -0,0 +1,5 @@ +<?php + header("Status: 404"); + + print $_SERVER["PHP_SELF"]; +?> diff --git a/tests/docroot/www/indexfile/rewrite.php b/tests/docroot/www/indexfile/rewrite.php new file mode 100644 index 0000000..fb41290 --- /dev/null +++ b/tests/docroot/www/indexfile/rewrite.php @@ -0,0 +1,3 @@ +<?php + print $_SERVER["QUERY_STRING"]; +?> diff --git a/tests/docroot/www/nph-status.pl b/tests/docroot/www/nph-status.pl new file mode 100755 index 0000000..602cdc7 --- /dev/null +++ b/tests/docroot/www/nph-status.pl @@ -0,0 +1,4 @@ +#!/usr/bin/perl + +print "HTTP/1.0 30 FooBar\r\n"; +print "\r\n"; diff --git a/tests/docroot/www/phpinfo.php b/tests/docroot/www/phpinfo.php new file mode 100644 index 0000000..147cebc --- /dev/null +++ b/tests/docroot/www/phpinfo.php @@ -0,0 +1 @@ +<?php phpinfo(); ?> diff --git a/tests/docroot/www/prefix.fcgi b/tests/docroot/www/prefix.fcgi new file mode 100644 index 0000000..e388352 --- /dev/null +++ b/tests/docroot/www/prefix.fcgi @@ -0,0 +1,3 @@ +<?php +echo $_SERVER[$_GET["var"]]; +?> diff --git a/tests/docroot/www/redirect.php b/tests/docroot/www/redirect.php new file mode 100644 index 0000000..0489d22 --- /dev/null +++ b/tests/docroot/www/redirect.php @@ -0,0 +1,4 @@ +<?php + + header('Location: http://www.example.org:2048/'); +?> diff --git a/tests/docroot/www/ssi.shtml b/tests/docroot/www/ssi.shtml new file mode 100644 index 0000000..473c5c6 --- /dev/null +++ b/tests/docroot/www/ssi.shtml @@ -0,0 +1 @@ +<!--#echo var="SCRIPT_NAME" --> diff --git a/tests/fastcgi-10.conf b/tests/fastcgi-10.conf new file mode 100644 index 0000000..1300973 --- /dev/null +++ b/tests/fastcgi-10.conf @@ -0,0 +1,138 @@ +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 = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", +# "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +server.indexfiles = ( "index.php", "index.html", + "index.htm", "default.htm" ) + + +######################## MODULE CONFIG ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +fastcgi.debug = 0 +fastcgi.server = ( ".php" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 1026 + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + 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 new file mode 100644 index 0000000..f351208 --- /dev/null +++ b/tests/fastcgi-13.conf @@ -0,0 +1,155 @@ +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" +debug.log-request-handling = "enable" + +## bind to port (default: 80) +server.port = 2048 + +## bind to localhost (default: all interfaces) +server.bind = "localhost" +server.errorlog = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", +# "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +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 ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +fastcgi.debug = 0 +fastcgi.server = ( ".php" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 1048, + "bin-path" => "/home/jan/Documents/php-5.1.0/sapi/cgi/php -c /usr/local/lib/php.ini", + "bin-copy-environment" => ( "PATH", "SHELL", "USER" ), + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + 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 new file mode 100644 index 0000000..c55700c --- /dev/null +++ b/tests/fastcgi-auth.conf @@ -0,0 +1,159 @@ +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" +debug.log-request-handling = "enable" + +## 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" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", +# "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +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 ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +fastcgi.debug = 0 +fastcgi.server = ( "/" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 20000, + "bin-path" => "@SRCDIR@/fcgi-auth", + "mode" => "authorizer", + "docroot" => "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/", + + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + 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 new file mode 100644 index 0000000..7ced64b --- /dev/null +++ b/tests/fastcgi-responder.conf @@ -0,0 +1,162 @@ +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" +#debug.log-request-handling = "enable" +#debug.log-state-handling = "enable" + +#fastcgi.debug = 1 + +## 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" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + +## +## Format: <errorfile-prefix><status>.html +## -> ..../status-404.html for 'File not found' +#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", +# "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_accesslog" ) + +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 ############################ + + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +compress.filetype = ("text/plain", "text/html") + +fastcgi.debug = 0 +fastcgi.server = ( ".fcgi" => ( + "grisu" => ( + "host" => "127.0.0.1", + "port" => 10000, + "bin-path" => "@SRCDIR@/fcgi-responder", + "check-local" => "disable", + "max-procs" => 1, + "min-procs" => 1 + ) + ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + + + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" +auth.backend.plain.groupfile = "lighttpd.group" + +auth.backend.ldap.hostname = "localhost" +auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +auth.backend.ldap.filter = "(uid=$)" + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/auth.php" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "host=192.168.2.10") + "require" => "user=jan" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", +# "require" => ("group=www", "user=jan", "user=weigon", "host=192.168.2.10") + "require" => "group=www|user=jan|host=192.168.2.10" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) + +expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" +} + +$HTTP["host"] == "zzz.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + server.name = "zzz.example.org" +} + diff --git a/tests/fcgi-auth.c b/tests/fcgi-auth.c new file mode 100644 index 0000000..ddecddc --- /dev/null +++ b/tests/fcgi-auth.c @@ -0,0 +1,26 @@ +#include <fcgi_stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> + +int main () { + char* p; + + while (FCGI_Accept() >= 0) { + /* wait for fastcgi authorizer request */ + + printf("Content-type: text/html\r\n"); + + if (((p = getenv("QUERY_STRING")) == NULL) || + strcmp(p, "ok") != 0) { + printf("Status: 403 Forbidden\r\n\r\n"); + } else { + printf("\r\n"); + /* default Status is 200 - allow access */ + } + + printf("foobar\r\n"); + } + + return 0; +} diff --git a/tests/fcgi-responder.c b/tests/fcgi-responder.c new file mode 100644 index 0000000..7fbaf28 --- /dev/null +++ b/tests/fcgi-responder.c @@ -0,0 +1,40 @@ +#include <fcgi_stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> + +int main () { + int num_requests = 2; + + while (num_requests > 0 && + FCGI_Accept() >= 0) { + char* p; + + if (NULL != (p = getenv("QUERY_STRING"))) { + if (0 == strcmp(p, "lf")) { + printf("Status: 200 OK\n\n"); + } else if (0 == strcmp(p, "crlf")) { + printf("Status: 200 OK\r\n\r\n"); + } else if (0 == strcmp(p, "slow-lf")) { + printf("Status: 200 OK\n"); + fflush(stdout); + printf("\n"); + } else if (0 == strcmp(p,"slow-crlf")) { + printf("Status: 200 OK\r\n"); + fflush(stdout); + printf("\r\n"); + } else if (0 == strcmp(p, "die-at-end")) { + printf("Status: 200 OK\r\n\r\n"); + num_requests--; + } else { + printf("Status: 200 OK\r\n\r\n"); + } + } else { + printf("Status: 500 Internal Foo\r\n\r\n"); + } + + printf("test123"); + } + + return 0; +} diff --git a/tests/lighttpd.conf b/tests/lighttpd.conf new file mode 100644 index 0000000..8d38c09 --- /dev/null +++ b/tests/lighttpd.conf @@ -0,0 +1,201 @@ +debug.log-request-handling = "enable" +debug.log-condition-handling = "enable" +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 = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + +server.dir-listing = "enable" + +#server.event-handler = "linux-sysepoll" +#server.event-handler = "linux-rtsig" + +#server.modules.path = "" +server.modules = ( + "mod_rewrite", + "mod_setenv", + "mod_secdownload", + "mod_access", + "mod_auth", +# "mod_httptls", + "mod_status", + "mod_expire", + "mod_simple_vhost", + "mod_redirect", +# "mod_evhost", +# "mod_localizer", + "mod_fastcgi", + "mod_cgi", + "mod_compress", + "mod_userdir", + "mod_ssi", + "mod_accesslog" ) + +server.indexfiles = ( "index.php", "index.html", + "index.htm", "default.htm" ) + + +######################## MODULE CONFIG ############################ + +ssi.extension = ( ".shtml" ) + +accesslog.filename = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.access.log" + +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" ) + +$HTTP["host"] == "cache.example.org" { + compress.cache-dir = "@SRCDIR@/tmp/lighttpd/cache/compress/" +} +compress.filetype = ("text/plain", "text/html") + +setenv.add-environment = ( "TRAC_ENV" => "tracenv", "SETENV" => "setenv") +setenv.add-request-header = ( "FOO" => "foo") +setenv.add-response-header = ( "BAR" => "foo") + +$HTTP["url"] =~ "\.pdf$" { + server.range-requests = "disable" +} + +fastcgi.debug = 0 +fastcgi.server = ( ".php" => ( ( "host" => "127.0.0.1", "port" => 1026, "broken-scriptfilename" => "enable" ) ), + "/prefix.fcgi" => ( ( "host" => "127.0.0.1", "port" => 1026, "check-local" => "disable", "broken-scriptfilename" => "enable" ) ) + ) + + +cgi.assign = ( ".pl" => "/usr/bin/perl", + ".cgi" => "/usr/bin/perl", + ".py" => "/usr/bin/python" ) + +userdir.include-user = ( "jan" ) +userdir.path = "/" + +ssl.engine = "disable" +ssl.pemfile = "server.pem" + +$HTTP["host"] == "auth-htpasswd.example.org" { + auth.backend = "htpasswd" +} + +auth.backend = "plain" +auth.backend.plain.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.user" + +auth.backend.htpasswd.userfile = "@SRCDIR@/tmp/lighttpd/lighttpd.htpasswd" + + +auth.require = ( "/server-status" => + ( + "method" => "digest", + "realm" => "download archiv", + "require" => "group=www|user=jan|host=192.168.2.10" + ), + "/server-config" => + ( + "method" => "basic", + "realm" => "download archiv", + "require" => "valid-user" + ) + ) + +url.access-deny = ( "~", ".inc") + +url.rewrite = ( "^/rewrite/foo($|\?.+)" => "/indexfile/rewrite.php$1", + "^/rewrite/bar(?:$|\?(.+))" => "/indexfile/rewrite.php?bar&$1" ) + +expire.url = ( "/expire/access" => "access 2 hours", + "/expire/modification" => "access plus 1 seconds 2 minutes") + +#cache.cache-dir = "/home/weigon/wwwroot/cache/" + +#### status module +status.status-url = "/server-status" +status.config-url = "/server-config" + +$HTTP["host"] == "vvv.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + secdownload.secret = "verysecret" + secdownload.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + secdownload.uri-prefix = "/sec/" + secdownload.timeout = 120 +} + +$HTTP["host"] == "zzz.example.org" { + 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 = "@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 = "@SRCDIR@/tmp/lighttpd/servers/" + simple-vhost.default-host = "www.example.org" +} + +$HTTP["host"] =~ "(vvv).example.org" { + url.redirect = ( "^/redirect/$" => "http://localhost:2048/" ) +} + +$HTTP["host"] =~ "(zzz).example.org" { + url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" ) +} + +$HTTP["host"] =~ "(remoteip)\.example\.org" { + $HTTP["remoteip"] =~ "(127\.0\.0\.1)" { + url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" ) + } +} + +$HTTP["remoteip"] =~ "(127\.0\.0\.1)" { + $HTTP["host"] =~ "(remoteip2)\.example\.org" { + url.redirect = ( "^/redirect/$" => "http://localhost:2048/%1" ) + } +} + +$HTTP["host"] =~ "bug255\.example\.org$" { + $HTTP["remoteip"] == "127.0.0.1" { + url.access-deny = ( "" ) + } +} + +$HTTP["referer"] !~ "^($|http://referer\.example\.org)" { + url.access-deny = ( ".jpg" ) +} + +# deny access for all image stealers +$HTTP["host"] == "referer.example.org" { + $HTTP["referer"] !~ "^($|http://referer\.example\.org)" { + url.access-deny = ( ".png" ) + } +} + +$HTTP["cookie"] =~ "empty-ref" { + $HTTP["referer"] == "" { + url.access-deny = ( "" ) + } +} + + diff --git a/tests/lighttpd.htpasswd b/tests/lighttpd.htpasswd new file mode 100644 index 0000000..1faf25a --- /dev/null +++ b/tests/lighttpd.htpasswd @@ -0,0 +1,2 @@ +des:12tMnfw882VDQ +md5:$1$md5$kIa7Juuiv8zja0ILQPR36/ diff --git a/tests/lighttpd.user b/tests/lighttpd.user new file mode 100644 index 0000000..020aedc --- /dev/null +++ b/tests/lighttpd.user @@ -0,0 +1 @@ +jan:jan diff --git a/tests/mod-access.t b/tests/mod-access.t new file mode 100755 index 0000000..b32dfe0 --- /dev/null +++ b/tests/mod-access.t @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 3; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /index.html~ HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; +ok($tf->handle_http($t) == 0, 'forbid access to ...~'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/mod-auth.t b/tests/mod-auth.t new file mode 100755 index 0000000..8500ced --- /dev/null +++ b/tests/mod-auth.t @@ -0,0 +1,99 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 10; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /server-status HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ]; +ok($tf->handle_http($t) == 0, 'Missing Auth-token'); + +$t->{REQUEST} = ( <<EOF +GET /server-status HTTP/1.0 +Authorization: Basic amFuOmphb +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ]; +ok($tf->handle_http($t) == 0, 'Basic-Auth: Wrong Auth-token'); + +$t->{REQUEST} = ( <<EOF +GET /server-config HTTP/1.0 +Authorization: Basic amFuOmphbg== +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - plain'); + +$t->{REQUEST} = ( <<EOF +GET /server-config HTTP/1.0 +Host: auth-htpasswd.example.org +Authorization: Basic ZGVzOmRlcw== +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (des)'); + +SKIP: { + skip "no md5 for crypt under cygwin", 1 if $^O eq 'cygwin'; +$t->{REQUEST} = ( <<EOF +GET /server-config HTTP/1.0 +Host: auth-htpasswd.example.org +Authorization: Basic bWQ1Om1kNQ== +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token - htpasswd (md5)'); +} + +$t->{REQUEST} = ( <<EOF +GET /server-config HTTP/1.0 +Authorization: Basic bWQ1Om1kNA== +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ]; +ok($tf->handle_http($t) == 0, 'Basic-Auth: Valid Auth-token'); + +## this should not crash +$t->{REQUEST} = ( <<EOF +GET /server-status HTTP/1.0 +User-Agent: Wget/1.9.1 +Authorization: Digest username="jan", realm="jan", nonce="9a5428ccc05b086a08d918e73b01fc6f", + uri="/server-status", response="ea5f7d9a30b8b762f9610ccb87dea74f" +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 401 } ]; +ok($tf->handle_http($t) == 0, 'Digest-Auth: missing qop, no crash'); + +## this should not crash +$t->{REQUEST} = ( <<EOF +GET /server-status HTTP/1.0 +User-Agent: Wget/1.9.1 +Authorization: Digest username="jan", realm="jan", + nonce="b1d12348b4620437c43dd61c50ae4639", + uri="/MJ-BONG.xm.mpc", qop=auth, noncecount=00000001", + cnonce="036FCA5B86F7E7C4965C7F9B8FE714B7", + response="29B32C2953C763C6D033C8A49983B87E" +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Digest-Auth: missing nc (noncecount instead), no crash'); + + + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/mod-cgi.t b/tests/mod-cgi.t new file mode 100755 index 0000000..b205d8c --- /dev/null +++ b/tests/mod-cgi.t @@ -0,0 +1,120 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 15; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +# mod-cgi +# +$t->{REQUEST} = ( <<EOF +GET /cgi.pl HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'perl via cgi'); + +$t->{REQUEST} = ( <<EOF +GET /cgi.pl/foo HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/cgi.pl' } ]; +ok($tf->handle_http($t) == 0, 'perl via cgi + pathinfo'); + +$t->{REQUEST} = ( <<EOF +GET /cgi-pathinfo.pl/foo HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo' } ]; +ok($tf->handle_http($t) == 0, 'perl via cgi + pathinfo'); + +$t->{REQUEST} = ( <<EOF +GET /nph-status.pl HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'NPH + perl, Bug #14'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?GATEWAY_INTERFACE HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'CGI/1.1' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: GATEWAY_INTERFACE'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?QUERY_STRING HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'QUERY_STRING' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: QUERY_STRING'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?GATEWAY_INTERFACE HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'CGI/1.1' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: GATEWAY_INTERFACE'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_HOST HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_XX_YY123 HTTP/1.0 +xx-yy123: foo +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'foo' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: quoting headers with numbers'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_HOST HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_HOST HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_HOST HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'Content-Type' => 'text/plain' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_HOST HTTP/1.1 +Host: www.example.org +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Content-Length' => '' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/mod-compress.t b/tests/mod-compress.t new file mode 100755 index 0000000..e4f110f --- /dev/null +++ b/tests/mod-compress.t @@ -0,0 +1,92 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 10; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Accept-Encoding: deflate +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '' } ]; +ok($tf->handle_http($t) == 0, 'Vary is set'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Accept-Encoding: deflate +Host: no-cache.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } ]; +ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is set'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Accept-Encoding: deflate +Host: cache.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1288', '+Content-Encoding' => '' } ]; +ok($tf->handle_http($t) == 0, 'deflate - Content-Length and Content-Encoding is set'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Accept-Encoding: gzip +Host: no-cache.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1306', '+Content-Encoding' => '' } ]; +ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Accept-Encoding: gzip +Host: cache.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Length' => '1306', '+Content-Encoding' => '' } ]; +ok($tf->handle_http($t) == 0, 'gzip - Content-Length and Content-Encoding is set'); + + +$t->{REQUEST} = ( <<EOF +GET /index.txt HTTP/1.0 +Accept-Encoding: gzip, deflate +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '' } ]; +ok($tf->handle_http($t) == 0, 'gzip, deflate - Content-Length and Content-Encoding is set'); + +$t->{REQUEST} = ( <<EOF +GET /index.txt HTTP/1.0 +Accept-Encoding: gzip, deflate +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', '+Content-Encoding' => '', 'Content-Type' => "text/plain" } ]; +ok($tf->handle_http($t) == 0, 'Content-Type is from the original file'); + +$t->{REQUEST} = ( <<EOF +GET /index.txt HTTP/1.0 +Accept-encoding: +X-Accept-encoding: x-i2p-gzip;q=1.0, identity;q=0.5, deflate;q=0, gzip;q=0, *;q=0 +User-Agent: MYOB/6.66 (AN/ON) +Connection: close +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '+Vary' => '', 'Content-Type' => "text/plain" } ]; +ok($tf->handle_http($t) == 0, 'Empty Accept-Encoding'); + + +ok($tf->stop_proc == 0, "Stopping lighttpd"); diff --git a/tests/mod-fastcgi.t b/tests/mod-fastcgi.t new file mode 100755 index 0000000..d3ea4a8 --- /dev/null +++ b/tests/mod-fastcgi.t @@ -0,0 +1,311 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use Test::More tests => 45; +use LightyTest; + +my $tf = LightyTest->new(); + +my $t; + +SKIP: { + skip "no PHP running on port 1026", 28 unless $tf->listening_on(1026); + + ok($tf->start_proc == 0, "Starting lighttpd") or die(); + + $t->{REQUEST} = ( <<EOF +GET /phpinfo.php HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, 'valid request'); + + $t->{REQUEST} = ( <<EOF +GET /phpinfofoobar.php HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; + ok($tf->handle_http($t) == 0, 'file not found'); + + $t->{REQUEST} = ( <<EOF +GET /go/ HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, 'index-file handling'); + + $t->{REQUEST} = ( <<EOF +GET /redirect.php HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 302, 'Location' => 'http://www.example.org:2048/' } ]; + ok($tf->handle_http($t) == 0, 'Status + Location via FastCGI'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=PHP_SELF HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]'); + + $t->{REQUEST} = ( <<EOF +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' => '/get-server-env.php' } ]; + ok($tf->handle_http($t) == 0, '$_SERVER["PHP_SELF"]'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php/foo?env=PATH_INFO HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo' } ]; + ok($tf->handle_http($t) == 0, '$_SERVER["PATH_INFO"]'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; + ok($tf->handle_http($t) == 0, 'SERVER_NAME'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 +Host: foo.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; + ok($tf->handle_http($t) == 0, 'SERVER_NAME'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 +Host: vvv.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; + ok($tf->handle_http($t) == 0, 'SERVER_NAME'); + + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 +Host: zzz.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'www.example.org' } ]; + ok($tf->handle_http($t) == 0, 'SERVER_NAME'); + + $t->{REQUEST} = ( <<EOF +GET /cgi.php/abc HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, 'PATHINFO'); + + $t->{REQUEST} = ( <<EOF +GET /www/abc/def HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; + ok($tf->handle_http($t) == 0, 'PATHINFO on a directory'); + + $t->{REQUEST} = ( <<EOF +GET /indexfile/ HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ]; + ok($tf->handle_http($t) == 0, 'PHP_SELF + Indexfile, Bug #3'); + + $t->{REQUEST} = ( <<EOF +GET /prefix.fcgi?var=SCRIPT_NAME HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/prefix.fcgi' } ]; + ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off'); + + $t->{REQUEST} = ( <<EOF +GET /prefix.fcgi/foo/bar?var=SCRIPT_NAME HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/prefix.fcgi' } ]; + ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off'); + + $t->{REQUEST} = ( <<EOF +GET /prefix.fcgi/foo/bar?var=PATH_INFO HTTP/1.0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/foo/bar' } ]; + ok($tf->handle_http($t) == 0, 'PATH_INFO, check-local off'); + + + ok($tf->stop_proc == 0, "Stopping lighttpd"); + + + $tf->{CONFIGFILE} = 'fastcgi-10.conf'; + ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); + $t->{REQUEST} = ( <<EOF +GET /get-server-env.php?env=SERVER_NAME HTTP/1.0 +Host: zzz.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'zzz.example.org' } ]; + ok($tf->handle_http($t) == 0, 'FastCGI + Host'); + + ok($tf->stop_proc == 0, "Stopping lighttpd"); + + $tf->{CONFIGFILE} = 'bug-06.conf'; + ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); + $t->{REQUEST} = ( <<EOF +GET /indexfile/ HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '/indexfile/index.php' } ]; + ok($tf->handle_http($t) == 0, 'Bug #6'); + + 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(); + $t->{REQUEST} = ( <<EOF +POST /indexfile/abc HTTP/1.0 +Host: www.example.org +Content-Length: 0 +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, 'HTTP-Content' => '/indexfile/return-404.php' } ]; + ok($tf->handle_http($t) == 0, 'Bug #12'); + + ok($tf->stop_proc == 0, "Stopping lighttpd"); +} + +SKIP: { + skip "no fcgi-auth found", 4 unless -x $tf->{BASEDIR}."/tests/fcgi-auth" || -x $tf->{BASEDIR}."/tests/fcgi-auth.exe"; + + $tf->{CONFIGFILE} = 'fastcgi-auth.conf'; + ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); + $t->{REQUEST} = ( <<EOF +GET /index.html?ok HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; + ok($tf->handle_http($t) == 0, 'FastCGI - Auth'); + + $t->{REQUEST} = ( <<EOF +GET /index.html?fail HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 403 } ]; + ok($tf->handle_http($t) == 0, 'FastCGI - Auth'); + + ok($tf->stop_proc == 0, "Stopping lighttpd"); +} + +SKIP: { + skip "no php found", 4 unless -x "/home/jan/Documents/php-5.1.0/sapi/cgi/php"; + $tf->{CONFIGFILE} = 'fastcgi-13.conf'; + ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); + $t->{REQUEST} = ( <<EOF +GET /indexfile/index.php HTTP/1.0 +Host: www.example.org +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"); +} + + +SKIP: { + skip "no fcgi-responder found", 9 unless -x $tf->{BASEDIR}."/tests/fcgi-responder" || -x $tf->{BASEDIR}."/tests/fcgi-responder.exe"; + + $tf->{CONFIGFILE} = 'fastcgi-responder.conf'; + ok($tf->start_proc == 0, "Starting lighttpd with $tf->{CONFIGFILE}") or die(); + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?lf HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'line-ending \n\n'); + + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?crlf HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'line-ending \r\n\r\n'); + + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?slow-lf HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'line-ending \n + \n'); + + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?slow-crlf HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'line-ending \r\n + \r\n'); + + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?die-at-end HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'killing fastcgi and wait for restart'); + + select(undef, undef, undef, 2); + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?die-at-end HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'killing fastcgi and wait for restart'); + + + select(undef, undef, undef, 2); + $t->{REQUEST} = ( <<EOF +GET /index.fcgi?crlf HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ]; + ok($tf->handle_http($t) == 0, 'regular response of after restart'); + + + ok($tf->stop_proc == 0, "Stopping lighttpd"); +} + diff --git a/tests/mod-redirect.t b/tests/mod-redirect.t new file mode 100755 index 0000000..666ca80 --- /dev/null +++ b/tests/mod-redirect.t @@ -0,0 +1,51 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 6; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /redirect/ HTTP/1.0 +Host: vvv.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/' } ]; +ok($tf->handle_http($t) == 0, 'external redirect'); + +$t->{REQUEST} = ( <<EOF +GET /redirect/ HTTP/1.0 +Host: zzz.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/zzz' } ]; +ok($tf->handle_http($t) == 0, 'external redirect with cond regsub'); + +$t->{REQUEST} = ( <<EOF +GET /redirect/ HTTP/1.0 +Host: remoteip.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/127.0.0.1' } ]; +ok($tf->handle_http($t) == 0, 'external redirect with cond regsub on remoteip'); + +$t->{REQUEST} = ( <<EOF +GET /redirect/ HTTP/1.0 +Host: remoteip2.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/remoteip2' } ]; +ok($tf->handle_http($t) == 0, 'external redirect with cond regsub on remoteip2'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); diff --git a/tests/mod-rewrite.t b/tests/mod-rewrite.t new file mode 100755 index 0000000..31c7d1a --- /dev/null +++ b/tests/mod-rewrite.t @@ -0,0 +1,48 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 5; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + + +SKIP: { + skip "no PHP running on port 1026", 5 unless $tf->listening_on(1026); + + ok($tf->start_proc == 0, "Starting lighttpd") or die(); + + $t->{REQUEST} = ( <<EOF +GET /rewrite/foo 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, 'valid request'); + + $t->{REQUEST} = ( <<EOF +GET /rewrite/foo?a=b HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'a=b' } ]; + ok($tf->handle_http($t) == 0, 'valid request'); + + $t->{REQUEST} = ( <<EOF +GET /rewrite/bar?a=b HTTP/1.0 +Host: www.example.org +EOF + ); + $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'bar&a=b' } ]; + ok($tf->handle_http($t) == 0, 'valid request'); + + ok($tf->stop_proc == 0, "Stopping lighttpd"); +} diff --git a/tests/mod-setenv.t b/tests/mod-setenv.t new file mode 100755 index 0000000..1eb32a1 --- /dev/null +++ b/tests/mod-setenv.t @@ -0,0 +1,53 @@ +#!/usr/bin/env perl + +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 6; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?TRAC_ENV HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'tracenv' } ]; +ok($tf->handle_http($t) == 0, 'query first setenv'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?SETENV HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'setenv' } ]; +ok($tf->handle_http($t) == 0, 'query second setenv'); + +$t->{REQUEST} = ( <<EOF +GET /get-header.pl?HTTP_FOO HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'foo' } ]; +ok($tf->handle_http($t) == 0, 'query add-request-header'); + +$t->{REQUEST} = ( <<EOF +GET /index.html HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'BAR' => 'foo' } ]; +ok($tf->handle_http($t) == 0, 'query add-response-header'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/mod-ssi.t b/tests/mod-ssi.t new file mode 100755 index 0000000..8bc88cc --- /dev/null +++ b/tests/mod-ssi.t @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 4; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +# mod-cgi +# +$t->{REQUEST} = ( <<EOF +GET /ssi.shtml HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "/ssi.shtml\n" } ]; +ok($tf->handle_http($t) == 0, 'ssi - echo '); + + +## bug #280 +$t->{REQUEST} = ( <<EOF +GET /exec-date.shtml HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => "2\n\n" } ]; +ok($tf->handle_http($t) == 0, 'ssi - echo '); + + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/mod-userdir.t b/tests/mod-userdir.t new file mode 100755 index 0000000..30d546a --- /dev/null +++ b/tests/mod-userdir.t @@ -0,0 +1,44 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 5; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +# get current user + +$t->{REQUEST} = ( <<EOF +GET /~foobar/ HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'valid user'); + +$t->{REQUEST} = ( <<EOF +GET /~jan HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://'.$tf->{HOSTNAME}.':'.$tf->{PORT}.'/~jan/' } ]; +ok($tf->handle_http($t) == 0, 'valid user + redirect'); + +$t->{REQUEST} = ( <<EOF +GET /~jan HTTP/1.0 +Host: www.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://www.example.org/~jan/' } ]; +ok($tf->handle_http($t) == 0, 'valid user + redirect'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/prepare.sh b/tests/prepare.sh new file mode 100755 index 0000000..71816d1 --- /dev/null +++ b/tests/prepare.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +if test x$srcdir = x; then + srcdir=. +fi + +if test x$top_builddir = x; then + top_builddir=.. +fi + +tmpdir=$top_builddir/tests/tmp/lighttpd + +# create test-framework +rm -rf $tmpdir +mkdir -p $tmpdir/servers/www.example.org/pages/ +mkdir -p $tmpdir/servers/www.example.org/pages/dummydir/ +mkdir -p $tmpdir/servers/www.example.org/pages/go/ +mkdir -p $tmpdir/servers/www.example.org/pages/expire/ +mkdir -p $tmpdir/servers/www.example.org/pages/indexfile/ +mkdir -p $tmpdir/servers/123.example.org/pages/ +mkdir -p $tmpdir/logs/ +mkdir -p $tmpdir/cache/ +mkdir -p $tmpdir/cache/compress/ + +# copy everything into the right places +cp $srcdir/docroot/www/*.html \ + $srcdir/docroot/www/*.php \ + $srcdir/docroot/www/*.pl \ + $srcdir/docroot/www/*.fcgi \ + $srcdir/docroot/www/*.shtml \ + $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/ +cp $srcdir/docroot/www/indexfile/*.php $tmpdir/servers/www.example.org/pages/indexfile/ +cp $srcdir/docroot/123/*.txt \ + $srcdir/docroot/123/*.html \ + $srcdir/docroot/123/*.php \ + $srcdir/docroot/123/*.bla $tmpdir/servers/123.example.org/pages/ +cp $srcdir/lighttpd.user $tmpdir/ +cp $srcdir/lighttpd.htpasswd $tmpdir/ +cp $srcdir/var-include-sub.conf $tmpdir/../ +touch $tmpdir/servers/www.example.org/pages/image.jpg \ + $tmpdir/servers/www.example.org/pages/image.JPG \ + $tmpdir/servers/www.example.org/pages/Foo.txt \ + $tmpdir/servers/www.example.org/pages/a +echo "12345" > $tmpdir/servers/www.example.org/pages/range.pdf + +printf "%-40s" "preparing infrastructure" + +exit 0 diff --git a/tests/request.t b/tests/request.t new file mode 100755 index 0000000..e581879 --- /dev/null +++ b/tests/request.t @@ -0,0 +1,352 @@ +#!/usr/bin/env perl +BEGIN { + # add current source dir to the include-path + # we need this for make distcheck + (my $srcdir = $0) =~ s#/[^/]+$#/#; + unshift @INC, $srcdir; +} + +use strict; +use IO::Socket; +use Test::More tests => 34; +use LightyTest; + +my $tf = LightyTest->new(); +my $t; + +ok($tf->start_proc == 0, "Starting lighttpd") or die(); + +## Basic Request-Handling + +$t->{REQUEST} = ( <<EOF +GET /foobar HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'file not found'); + +$t->{REQUEST} = ( <<EOF +GET /foobar?foobar HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ]; +ok($tf->handle_http($t) == 0, 'file not found + querystring'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'text/plain' } ]; +ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype text/plain'); + +$t->{REQUEST} = ( <<EOF +GET /12345.html HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'text/html' } ]; +ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype text/html'); + +$t->{REQUEST} = ( <<EOF +GET /dummyfile.bla HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'application/octet-stream' } ]; +ok($tf->handle_http($t) == 0, 'GET, content == 12345, mimetype application/octet-stream'); + +$t->{REQUEST} = ( <<EOF +POST / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 411 } ]; +ok($tf->handle_http($t) == 0, 'POST request, no Content-Length'); + + +$t->{REQUEST} = ( <<EOF +POST / HTTP/1.0 +Content-type: application/x-www-form-urlencoded +Content-length: 0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'POST request, empty request-body'); + +$t->{REQUEST} = ( <<EOF +HEAD / HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => ''} ]; +ok($tf->handle_http($t) == 0, 'HEAD request, no content'); + +$t->{REQUEST} = ( <<EOF +HEAD /12345.html HTTP/1.0 +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, '-HTTP-Content' => '', 'Content-Type' => 'text/html', 'Content-Length' => '6'} ]; +ok($tf->handle_http($t) == 0, 'HEAD request, mimetype text/html, content-length'); + +$t->{REQUEST} = ( <<EOF +HEAD /foobar?foobar HTTP/1.0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404, '-HTTP-Content' => '' } ]; +ok($tf->handle_http($t) == 0, 'HEAD request, file-not-found, query-string'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.1 +Connection: close +Expect: 100-continue +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 417, '-HTTP-Content' => ''} ]; +ok($tf->handle_http($t) == 0, 'Continue, Expect'); + +## ranges + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=0-3 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 206, 'HTTP-Content' => '1234' } ]; +ok($tf->handle_http($t) == 0, 'GET, Range 0-3'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=-3 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 206, 'HTTP-Content' => '45'."\n" } ]; +ok($tf->handle_http($t) == 0, 'GET, Range -3'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=3- +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 206, 'HTTP-Content' => '45'."\n" } ]; +ok($tf->handle_http($t) == 0, 'GET, Range 3-'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=0-1,3-4 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 206, 'HTTP-Content' => <<EOF +\r +--fkj49sn38dcn3\r +Content-Range: bytes 0-1/6\r +Content-Type: text/plain\r +\r +12\r +--fkj49sn38dcn3\r +Content-Range: bytes 3-4/6\r +Content-Type: text/plain\r +\r +45\r +--fkj49sn38dcn3--\r +EOF + } ]; +ok($tf->handle_http($t) == 0, 'GET, Range 0-1,3-4'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=0-- +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'GET, Range 0--'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=-2-3 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'GET, Range -2-3'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=-0 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 416, 'HTTP-Content' => <<EOF +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>416 - Requested Range Not Satisfiable</title> + </head> + <body> + <h1>416 - Requested Range Not Satisfiable</h1> + </body> +</html> +EOF + } ]; +ok($tf->handle_http($t) == 0, 'GET, Range -0'); + +$t->{REQUEST} = ( <<EOF +GET /12345.txt HTTP/1.0 +Host: 123.example.org +Range: bytes=25- +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 416, 'HTTP-Content' => <<EOF +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>416 - Requested Range Not Satisfiable</title> + </head> + <body> + <h1>416 - Requested Range Not Satisfiable</h1> + </body> +</html> +EOF + } ]; + +ok($tf->handle_http($t) == 0, 'GET, Range start out of range'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Hsgfsdjf: asdfhdf +hdhd: shdfhfdasd +hfhr: jfghsdfg +jfuuehdmn: sfdgjfdg +jvcbzufdg: sgfdfg +hrnvcnd: jfjdfg +jfusfdngmd: gfjgfdusdfg +nfj: jgfdjdfg +jfue: jfdfdg +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'larger headers'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Host: www.example.org +Host: 123.example.org +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate Host headers, Bug #25'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Content-Length: 5 +Content-Length: 4 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate Content-Length headers'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Content-Type: 5 +Content-Type: 4 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate Content-Type headers'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Range: bytes=5-6 +Range: bytes=5-9 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate Range headers'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +If-None-Match: 5 +If-None-Match: 4 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate If-None-Match headers'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +If-Modified-Since: 5 +If-Modified-Since: 4 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate If-Modified-Since headers'); + +$t->{REQUEST} = ( <<EOF +GET /range.pdf HTTP/1.0 +Range: bytes=0- +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'GET, Range with range-requests-disabled'); + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'GET with Content-Length'); + +$t->{REQUEST} = ( <<EOF +OPTIONS / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'OPTIONS with Content-Length'); + +$t->{REQUEST} = ( <<EOF +OPTIONS rtsp://221.192.134.146:80 RTSP/1.1 +Host: 221.192.134.146:80 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'OPTIONS for RTSP'); + +$t->{REQUEST} = ( <<EOF +HEAD / HTTP/1.0 +Content-Length: 4 + +1234 +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 400 } ]; +ok($tf->handle_http($t) == 0, 'HEAD with Content-Length'); + + +$t->{REQUEST} = ( <<EOF +GET / HTTP/1.0 +If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT +If-Modified-Since: Sun, 1970 Jan 01 00:00:01 GMT +EOF + ); +$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200 } ]; +ok($tf->handle_http($t) == 0, 'Duplicate If-Mod-Since, with equal timestamps'); + +ok($tf->stop_proc == 0, "Stopping lighttpd"); + diff --git a/tests/run-tests.pl b/tests/run-tests.pl new file mode 100755 index 0000000..44e76a9 --- /dev/null +++ b/tests/run-tests.pl @@ -0,0 +1,19 @@ +#! /usr/bin/env perl + +use strict; + +use Test::Harness qw(&runtests $verbose); +$verbose=0; + +my $srcdir = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.'); + +opendir DIR, $srcdir; +my (@fs, $f); +while ($f = readdir(DIR)) { + if ($f =~ /\.t$/) { + push @fs, $srcdir.'/'.$f; + } +} +closedir DIR; +runtests @fs; + diff --git a/tests/var-include-sub.conf b/tests/var-include-sub.conf new file mode 100644 index 0000000..3e0c3b9 --- /dev/null +++ b/tests/var-include-sub.conf @@ -0,0 +1,34 @@ +# file to be included +$HTTP["host"] =~ "^" + server.name + "$" { + url.redirect = ( + "^/include$" => "/good_include", + "^/concat$" => "/good_" + "concat", + "^/servername1$" => "/good_" + server.name, + "^/servername2$" => server.name + "/good_", + "^/servername3$" => "/good_" + server.name + "/", + "^/var.myvar$" => "/good_var_myvar" + var.myvar, + "^/myvar$" => "/good_myvar" + myvar, + "^/number1$" => "/good_number" + one, + "^/number2$" => one + "/good_number", + "^/env$" => "/" + env.env_test, + ) + num = 1 + num2 = 2 + num2 += 1 + # without var prefix + mystr = "string" + mystr += "_append" + # from parent + one += 1 + url.redirect += ( + "^/array_append$" => "/good_array_append", + "^/string_append$" => "/good_" + mystr, + "^/number_append$" => "/good_" + one, + ) + + cmd = "echo cmd_ok=456" + include_shell cmd + url.redirect += ( + "^/include_shell$" => "/good_include_shell_" + cmd_ok, + ) +} diff --git a/tests/var-include.conf b/tests/var-include.conf new file mode 100644 index 0000000..00595ba --- /dev/null +++ b/tests/var-include.conf @@ -0,0 +1,41 @@ + +debug.log-request-handling = "enable" +debug.log-condition-handling = "enable" + +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 = "@SRCDIR@/tmp/lighttpd/logs/lighttpd.error.log" +server.name = "www.example.org" +server.tag = "Apache 1.3.29" + + +server.modules = ( "mod_redirect", + "mod_accesslog" ) + +######################## MODULE CONFIG ############################ + + +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 = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + server.name = "www.example.org" + url.redirect = ("^" => "/redirect") +} +$HTTP["host"] == "test.example.org" { + server.document-root = "@SRCDIR@/tmp/lighttpd/servers/www.example.org/pages/" + server.name = "test.example.org" + var.myvar = "good" + var.one = 1 + include "var-include-sub.conf" +} diff --git a/tests/wrapper.sh b/tests/wrapper.sh new file mode 100755 index 0000000..5ba80ed --- /dev/null +++ b/tests/wrapper.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +## get some parameters from the makefile + +export srcdir=$1 +export top_builddir=$2 +export SHELL + +$3 |