You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lighttpd1.4/tests
Glenn Strauss 63beba3a4c [core] allow redirect,rewrite ext subst w/o pcre
allow redirect and rewrite extended substitution when lighttpd is built
without pcre.  When built without pcre, url.rewrite and url.redirect
always match first list entry as if it were "", and numerical
substitutions ($0 %0 $1 %1 etc) are always ignored, but other extended
substitutions (e.g. ${url.path}) may still occur.
1 year ago
..
docroot [core] permit env w/ blank value (fix regression) 1 year ago
CMakeLists.txt [build] Haiku build fix (fixes #3136) 1 year ago
LightyTest.pm [tests] revert _WIN32 adjustments in LightyTest.pm 1 year ago
Makefile.am [tests] combine *.t using tests/condition.conf 2 years ago
README [tests] remove FastCGI test dependency on PHP 2 years ago
SConscript [build] update tests/SConscript 1 year ago
cleanup.sh [scons] various improvements 8 years ago
condition.conf [tests] able to run tests when built w/o pcre 1 year ago
core-condition.t [core] allow redirect,rewrite ext subst w/o pcre 1 year ago
fastcgi-responder.conf [tests] able to run tests when built w/o pcre 1 year ago
fcgi-responder.c [core] define __EXTENSIONS__ on Illumos 1 year ago
lighttpd.conf [tests] able to run tests when built w/o pcre 1 year ago
lighttpd.htpasswd [mod_auth] skip blank lines and comment lines (fixes #2327) 7 years ago
lighttpd.user moved everything below trunk/ and added branches/ and tags/ 19 years ago
meson.build [build] Haiku build fix (fixes #3136) 1 year ago
mod-fastcgi.t [tests] skip time-sensitive test during CI testing 2 years ago
mod-scgi.t [tests] skip time-sensitive test during CI testing 2 years ago
prepare.sh [tests] revert _WIN32 adjustments in LightyTest.pm 1 year ago
proxy.conf [tests] able to run tests when built w/o pcre 1 year ago
request.t [tests] able to run tests when built w/o pcre 1 year ago
run-tests.pl Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105) 14 years ago
scgi-responder.c [tests] remove FastCGI test dependency on PHP 2 years ago
scgi-responder.conf [core] allow tests/tmp/bind.conf override (#3137) 1 year ago
var-include-sub.conf [tests] able to run tests when built w/o pcre 1 year ago
wrapper.sh Add static-file.disable-pathinfo option to prevent handling of urls like .../secret.php/image.jpg as static file 12 years ago

README

Running tests
-------------

  $ make check

If run from tests/ dir, tests will fail to run tests if lighttpd not built.
If run from top level, 'make' will build lighttpd exectuable if not yet built,
and then will run tests.


Running individual tests programs
---------------------------------

prep
  $ cd tests/
  $ ./prepare.sh

then, for any particular *.t such as request.t,
  $ ./request.t
or
  $ VERBOSE=1 RUNTESTS=request ./run-tests.pl

More information is output by tests with additional environment settings:
  $ TRACE_HTTP=1     ./request.t

See LightyTest.pm before trying TRACEME
  $ less LightyTest.pm

  $ TRACEME=strace   ./request.t   # output to file 'strace'
  $ TRACEME=truss    ./request.t   # output to file 'strace'
  $ TRACEME=gdb      ./request.t   # not for interactive debugging (see below)
  $ TRACEME=valgrind ./request.t

To reduce noise from valgrind --show-leak-kinds=all (or =reachable), avoid FAM.
Use server.stat-cache-engine = "simple" (not server.stat-cache-engine = "fam")
in lighttpd.conf.  (FAM creates /usr/libexec/gam_server as child process.)


Running lighttpd server with a config from tests/*.conf
-------------------------------------------------------

Each *.t loads the lighttpd server with one or more config files.
See each *.t for which config file is used, e.g. tests/lighttpd.conf

To run a specific config
  repo=$PWD      # from root of src repository
  cd tests/
  ./prepare.sh
  PERL=/usr/bin/perl SRCDIR=$repo/tests \
    $repo/src/lighttpd -D -f lighttpd.conf -m $repo/src/.libs

The PERL, PHP, and SRCDIR environment variables are set by LightyTest.pm
when 'make check' is run.  PERL and PHP can be set to paths to perl and php,
e.g. export PERL=/usr/bin/perl

To run a specific config under gdb
  repo=$PWD      # from root of src repository
  cd tests/
  ./prepare.sh
  PERL=/usr/bin/perl SRCDIR=$repo/tests \
    gdb --args $repo/src/lighttpd -D -f lighttpd.conf -m $repo/src/.libs

  (gdb) start
  (gdb) ...


Hints and tips
--------------
Q: What do I do if tests fail with:
     bind: Address already in use at LightyTest.pm line 429.
A: It is likely that something else on the machine is already using the port
   that tests are trying to use to run a backend.  Try exiting out of your web
   browser and then run the tests again.  (root can use 'netstat' or 'ss' to
   find out which process is using the port.)


Additional documentation
------------------------
https://redmine.lighttpd.net/projects/lighttpd/wiki/RunningUnitTests
https://redmine.lighttpd.net/projects/lighttpd/wiki/HowToReportABug
https://redmine.lighttpd.net/projects/lighttpd/wiki/DebugVariables