lighttpd1.4/tests
Glenn Strauss adf2f816df [tests] mod_ssi tests moved to src/t/test_mod_ssi
remove mod_ssi Perl tests now performed by src/t/test_mod_ssi
2021-11-12 17:56:38 -05:00
..
docroot [tests] mod_ssi tests moved to src/t/test_mod_ssi 2021-11-12 17:56:38 -05:00
CMakeLists.txt [tests] combine *.t using tests/condition.conf 2021-09-04 08:08:26 -04:00
LightyTest.pm [tests] force Fcntl::F_SETFD() autovivification (#3110) 2021-10-10 18:28:01 -04:00
Makefile.am [tests] combine *.t using tests/condition.conf 2021-09-04 08:08:26 -04:00
README [tests] remove FastCGI test dependency on PHP 2020-12-23 03:50:13 -05:00
SConscript [tests] remove FastCGI test dependency on libfcgi 2020-12-23 03:49:43 -05:00
cleanup.sh [scons] various improvements 2015-08-29 09:28:04 +00:00
condition.conf [tests] combine *.t using tests/condition.conf 2021-09-04 08:08:26 -04:00
core-condition.t [tests] combine *.t using tests/condition.conf 2021-09-04 08:08:26 -04:00
fastcgi-responder.conf [tests] combine *.t using tests/lighttpd.conf 2021-09-04 08:08:26 -04:00
fcgi-responder.c [tests] ignore SIGINT, SIGUSR1 in fcgi-responder 2021-10-01 06:39:47 -04:00
lighttpd.conf [tests] mod_ssi tests moved to src/t/test_mod_ssi 2021-11-12 17:56:38 -05:00
lighttpd.htpasswd [mod_auth] skip blank lines and comment lines (fixes #2327) 2016-04-28 13:13:43 -04:00
lighttpd.user moved everything below trunk/ and added branches/ and tags/ 2005-02-20 14:27:00 +00:00
meson.build [tests] combine *.t using tests/condition.conf 2021-09-04 08:08:26 -04:00
mod-fastcgi.t [tests] skip time-sensitive test during CI testing 2021-09-09 04:55:26 -04:00
mod-scgi.t [tests] skip time-sensitive test during CI testing 2021-09-09 04:55:26 -04:00
prepare.sh [tests] mod_ssi tests moved to src/t/test_mod_ssi 2021-11-12 17:56:38 -05:00
proxy.conf [tests] use ephemeral ports in tests 2021-01-05 12:52:11 -05:00
request.t [tests] mod_ssi tests moved to src/t/test_mod_ssi 2021-11-12 17:56:38 -05: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] remove FastCGI test dependency on PHP 2020-12-23 03:50:13 -05:00
scgi-responder.conf [tests] combine *.t using tests/lighttpd.conf 2021-09-04 08:08:26 -04:00
var-include-sub.conf [tests] search for perl in PATH instead of /usr/bin; whitespace + test config cleanups 2015-08-22 20:51:08 +00: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 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