lighttpd1.4/tests
Stefan Bühler e9480dfa8e [tests] use current perl interpreter path for env.PERL in lighttpd.conf 2023-07-26 03:05:23 -04:00
..
docroot [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
CMakeLists.txt [build] Haiku build fix (fixes #3136) 2022-01-06 02:03:31 -05:00
LightyTest.pm [tests] use current perl interpreter path for env.PERL in lighttpd.conf 2023-07-26 03:05:23 -04:00
Makefile.am [build] _WIN32 mingw build 2023-05-03 23:11:34 -04:00
README [multiple] spelling: github action check-spelling 2023-01-09 00:25:11 -05:00
SConscript [build] update tests/SConscript 2022-01-03 04:25:11 -05:00
cleanup.sh [scons] various improvements 2015-08-29 09:28:04 +00:00
condition.conf [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
core-condition.t [core] allow redirect,rewrite ext subst w/o pcre 2022-04-08 06:33:02 -04:00
fastcgi-responder.conf [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
fcgi-responder.c [tests] _WIN32 fcgi-responder.c, scgi-responder.c 2023-05-03 23:11:34 -04:00
lighttpd.conf [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
lighttpd.htpasswd [tests] drop des-crypt and crypt-md5 auth tests - deprecated/not available on various platforms 2023-07-12 18:05:32 +02:00
lighttpd.user moved everything below trunk/ and added branches/ and tags/ 2005-02-20 14:27:00 +00:00
meson.build [build] Haiku build fix (fixes #3136) 2022-01-06 02:03:31 -05:00
mod-fastcgi.t [tests] use sha crypt for fastcgi auth environment tests 2023-07-12 18:05:05 +02:00
mod-scgi.t [tests] _WIN32 skip time-sensitive tests during CI 2023-05-03 23:11:35 -04:00
prepare.sh [tests] tests/prepare.sh comment w/ alt build root 2023-05-10 02:08:25 -04:00
proxy.conf [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
request.t [tests] drop des-crypt and crypt-md5 auth tests - deprecated/not available on various platforms 2023-07-12 18:05:32 +02:00
run-tests.pl Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105) 2009-11-29 14:13:13 +00:00
scgi-responder.c [tests] _WIN32 fcgi-responder.c, scgi-responder.c 2023-05-03 23:11:34 -04:00
scgi-responder.conf [tests] _WIN32 cygwin test support 2023-05-03 23:11:34 -04:00
var-include-sub.conf [tests] able to run tests when built w/o pcre 2022-04-08 06:33:02 -04:00
wrapper.sh Add static-file.disable-pathinfo option to prevent handling of urls like .../secret.php/image.jpg as static file 2011-08-30 22:13:59 +00:00

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 executable 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