Commit Graph

320 Commits (3034147e5156da29f267c3839d21d591dce761b6)

Author SHA1 Message Date
Glenn Strauss 3034147e51 [tests] remove unused mod from tests/lighttpd.conf
remove unused module mod_userdir from tests/lighttpd.conf
(module is tested in src/t/test_mod_userdir.c)
2021-11-15 11:59:18 -05:00
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
Glenn Strauss a2bfccd1be [tests] force Fcntl::F_SETFD() autovivification (#3110)
  "RPM build fails at"
2021-10-10 18:28:01 -04:00
Glenn Strauss 78eb0e3945 [tests] force POSIX::WNOHANG() autovivification (fixes #3110)
  "RPM build fails at"
2021-10-10 15:19:05 -04:00
Glenn Strauss ed2c698300 [tests] ignore SIGINT, SIGUSR1 in fcgi-responder
ignore SIGINT, SIGUSR1 in fcgi-responder if HAVE_SIGNAL is defined
(must be defined separately since config.h is not included)

Not required for test framework.  Added as an example in the code,
e.g. if code is reused with lighttpd and graceful shutdown or restart.
(backend will be sent SIGTERM when server is ready to restart)
2021-10-01 06:39:47 -04:00
Glenn Strauss 9a37ba54d1 [tests] skip time-sensitive test during CI testing 2021-09-09 04:55:26 -04:00
Glenn Strauss 18ec4f419c [tests] move tests/docroot/www contents up 1 level
reduce directories under tests
(because automake is sloooow and the fewer dirs, the better)
2021-09-08 15:06:07 -04:00
Glenn Strauss 83338cb7dd [tests] IO::Socket::INET->new( Timeout => 1 )
(to be used when supported by the underlying Perl lib)
2021-09-08 15:06:07 -04:00
Glenn Strauss ca2898f678 [tests] t/test_mod_indexfile
also remove some now-redundant tests from request.t
and reduce scripts and directories under tests
(because automake is sloooow and the fewer dirs, the better)
2021-09-08 15:06:07 -04:00
Glenn Strauss 9c9cd37320 [tests] speed up mod-fastcgi and mod-scgi tests
On platforms where lighttpd gets SIGCHLD,
lighttpd can quickly detect exit of backend process
and can restart backend process
2021-09-04 08:08:26 -04:00
Glenn Strauss 5294d7e18f [tests] combine *.t using tests/condition.conf
combine tests/*.t using tests/condition.conf into tests/core-condition.t

Platforms which are horrifically slow starting processes (e.g. Windows)
take much more time to start and stop lighttpd many times for
independent *.t instances run through the Perl Test::More framework
2021-09-04 08:08:26 -04:00
Glenn Strauss f472611597 [tests] combine *.t using tests/lighttpd.conf
combine tests/*.t using tests/lighttpd.conf into tests/request.t

Platforms which are horrifically slow starting processes (e.g. Windows)
take much more time to start and stop lighttpd many times for
independent *.t instances run through the Perl Test::More framework
2021-09-04 08:08:26 -04:00
Glenn Strauss 91472ab768 [tests] t/test_mod_staticfile
move some tests from tests/request.t to src/t/test_mod_staticfile.c
2021-09-04 08:08:26 -04:00
Glenn Strauss a0a8cf821d [tests] mv tests from request.t to test_request.c
move some tests from tests/*.t to src/t/test_request.c
2021-08-27 02:16:54 -04:00
Glenn Strauss f7bebe99a5 [tests] use generated date in HTTP If conditionals
replace hard-coded date in HTTP If conditional tests

  "Make tests pass after 2035"

github: closes #106
2021-08-27 02:16:54 -04:00
Glenn Strauss 6881f79c32 [mod_auth] detect and skip BWS (bad whitespace)
detect and skip BWS (bad whitespace) in Authorization
2021-08-27 02:16:54 -04:00
Glenn Strauss e2bd776f8f [tests] disable secdownload HMAC tests for NSS
NSS crypto lib does not expose interfaces to HMAC funcs
2021-05-07 16:39:52 -04:00
Glenn Strauss cc35c03c3c [core] RFC 7233 Range handling for non-streaming
RFC 7233 Range handling for all non-streaming responses,
including (non-streaming) dynamic responses

(previously Range responses handled only for static files)
2021-03-02 10:14:25 -05:00
Glenn Strauss dc4ff14c1f [tests] remove stray option in test lighttpd.conf 2021-02-05 19:40:22 -05:00
Glenn Strauss 5b1b9f7824 [tests] use ephemeral ports in tests
avoid spurious test failures due to conflicts with ports in use by
other processes, which might occur when tests use hard-coded ports
2021-01-05 12:52:11 -05:00
Glenn Strauss 5ec5e124c1 [tests] consolidate some tests/ content 2020-12-27 21:39:04 -05:00
Glenn Strauss db0cd76618 [build] add GNUMAKEFLAGS=--no-print-directory
quiet some automake noise during build
(can use 'make -s' to quiet more)

In doc/ and tests/docroot/, add GNUMAKEFLAGS=--no-print-directory -s
2020-12-27 21:37:28 -05:00
Glenn Strauss 0c6a6d06c6 [tests] OpenBSD crypt() support limited to bcrypt
OpenBSD crypt() does not support (insecure) crypt-des or crypt-md5

(The password used in the tests and lighttpd.htpasswd is crypt-des.
 Something else could be used so that the tests can execute,
 though that something might be different on different platforms.)
2020-12-26 03:47:41 -05:00
Glenn Strauss 91e94f4875 [tests] load required modules in alt .conf tests
load only required modules in alt .conf tests
2020-12-24 23:39:52 -05:00
Glenn Strauss d228b06655 [tests] slight speed up checking for server ready
make connection attempt every 10ms instead of every 20ms
2020-12-24 23:09:23 -05:00
Glenn Strauss 122094e3e3 [multiple] employ http_date.h, sys-time.h
- replace use of strptime() w/ implementation specialized for HTTP dates
- use thread-safe gmtime_r(), localtime_r() (replace localtime, gmtime)
2020-12-24 16:13:20 -05:00
Glenn Strauss b598bb53f9 [tests] remove FastCGI test dependency on PHP 2020-12-23 03:50:13 -05:00
Glenn Strauss fc01b820ec [tests] remove FastCGI test dependency on libfcgi
- rewrite fcgi-responder as standalone app
  fcgi-responder is now a minimal, standalone FastCGI server for tests
- remove dependency on fcgi-devel package
- merge fcgi-auth into fcgi-responder
2020-12-23 03:49:43 -05:00
Glenn Strauss c68a7b4552 [tests] collect code for "die-at-end" tests 2020-12-18 20:36:30 -05:00
Glenn Strauss 213373948a [tests] allow LIGHTTPD_EXE_PATH override
allow LIGHTTPD_EXE_PATH override to be able to run source tree tests/*.t
against installed executable, e.g. LIGHTTPD_EXE_PATH=/usr/sbin/lighttpd

Beware that tests might not pass or might not be supported if the target
executable is not the same version as that of the source tree

(Possible use for this override is by Debian autopkgtests)
2020-11-09 05:07:05 -05:00
Glenn Strauss 2576b2c3d0 [tests] OpenBSD crypt() support limited to bcrypt
OpenBSD crypt() does not support (insecure) crypt-des or crypt-md5
2020-10-26 11:45:48 -04:00
Glenn Strauss a363383a92 [tests] detect multiple SSL/TLS/crypto providers 2020-10-19 21:40:14 -04:00
Glenn Strauss dc51e9d61c [tests] simulate slow, small packets more quickly
simulate slow, small packets more quickly
1ms between chars is plenty slow; 100ms is excessive

2020-10-19 21:40:14 -04:00
Glenn Strauss 96abd9cfb8 [core] coalesce nearby ranges in Range requests
Range requests must be HTTP/1.1 or later (not HTTP/1.0)
2020-10-19 21:40:14 -04:00
Glenn Strauss 1d9709b8ab [core] update HTTP status codes list from IANA 2020-10-11 12:19:26 -04:00
Glenn Strauss 140c0fb8f4 [doc] update README and INSTALL
also add tests/README with some testing notes
2020-10-11 12:19:26 -04:00
Glenn Strauss a3af9833c6 [core] fix crash on master if blank line request
(bug on master branch; never released)

(thx avij)

fix crash on master if blank line precedes HTTP/1.1 keep-alive request

header parsing code previously made assumptions that request was
HTTP/1.0 or HTTP/1.1, where a request-line was required, and which
would error out elsewhere if request-line was missing.  The parsing
code also previously looked for "\r\n\r\n" to end headers.

The header offset parsing code was modified and invalidated the above
assumptions, now looking only for blank line "\r\n", but the calling
code had not properly been updated.  (until this patch)
2020-10-11 12:19:26 -04:00
Glenn Strauss 8e2cf55250 [core] redirect to dir using relative-path
Location response header is permitted to use relative-path in
RFC 7231 Section 7.1.2. Location

Prefer relative path in redirection for the benefit of reverse proxies
and CDNs.  Doing so also avoids potentially disclosing internal schemes
and server names which client might not be able to directly reach.

To restore prior behavior of sending a fully-qualified absolute URI:
server.feature-flags += ("absolute-dir-redirect" => "enable")

2020-10-11 11:43:06 -04:00
Stefan Bühler 5515bb2a08 scons: fix check environment
if os.environ is a special class the scons.Environment Clone() doesn't
work properly.

show builddir in so we can actually see it works.
2020-08-02 20:05:33 +02:00
Glenn Strauss de9e2f9881 [tests] mod_compress -> mod_deflate 2020-08-02 06:46:22 -04:00
Glenn Strauss 8dd33a72dd [mod_deflate] mod_deflate subsumes mod_compress
translate config server.modules "mod_compress" to "mod_deflate"
accept compress.* directives, but issue DEPRECATED warning trace

mod_deflate differences from mod_compress:
- mod_compress compress.filetype was exact match; deflate.mimetypes is
  prefix match (behavior change might compress longer mimetype matches,
  which are likely of similar type and compressability)
- mod_compress always sent entire (compressed) file for Range request
  mod_deflate will stream compress range result (not stored in cache)
- mod_compress would short-circuit request with 403 Forbidden error
  if request file did not exist (stat() failed) (This behavior was
  unfriendly to other handlers)
- mod_compress compress.cache-dir layout differs from deflate.cache-dir
  layout; file cache should be cleared (or renamed) when migrating from
  mod_compress to mod_deflate
- mod_deflate does not issue Vary: Accept-Encoding if request does not
  contain Accept-Encoding.  The identity response can be cache by
  proxies and served to clients.  Historically, some proxies disabled
  caching if any Vary: response was seen.  If the Vary header is
  desirable, mod_deflate code which checks for Accept-Encoding and
  compression type can be moved down a few lines to be below the
  setting of the Vary response header.
2020-08-02 06:46:22 -04:00
Glenn Strauss c75fd15d7a [build] remove tests/mod-userdir.t from builds
(replaced with src/t/test_mod_userdir.c)
2020-07-10 03:29:42 -04:00
Glenn Strauss c18f442a63 [multiple] add summaries to top of some modules 2020-07-08 22:51:31 -04:00
Glenn Strauss af836b94d3 [tests] fix skip count in mod-fastcgi w/o php-cgi
(fix test skip count when php-cgi is not available)
2020-07-08 19:54:30 -04:00
Glenn Strauss c8a1cba0c1 [tests] t/test_mod_userdir
create t/test_mod_userdir to replace sparse tests in tests/mod-userdir.t
remove tests/mod-userdir.t
2020-07-08 19:54:29 -04:00
Glenn Strauss 362ccedc41 [mod_indexfile] use config_plugin_values_init() 2020-05-23 17:59:29 -04:00
Glenn Strauss fa4ab19275 [core] reduce use of struct parse_header_state 2020-02-24 11:15:32 -05:00
Glenn Strauss 61f85d14ee [core] reject WS following header field-name (fixes #2985)
reject whitespace following request header field-name and before colon
Such whitespace is forbidden in RFC 7230 Section 3.2.4.

strict header parsing is enabled by default in lighttpd.  However,
if explicitly disabled in lighttpd.conf, lighttpd will continue to
accept (and re-format) such field-names before passing to any backend.
  UNSAFE: server.http-parseopts = ( "header-strict" => "disable" )
  This is NOT RECOMMENDED since doing so disables other protections
  provided by lighttpd strict http header parsing.

(thx fedormixalich)

  stricter request header parsing
2020-01-26 00:40:20 -05:00
Glenn Strauss d5774fc6b3 [tests] skip mod-secdownload HMAC-SHA1,HMAC-SHA256
skip mod-secdownload.t HMAC-SHA1, HMAC-SHA256 tests if crypto algorithms
are not available (e.g. lighttpd build without openssl)
2019-05-13 21:01:57 -04:00
Glenn Strauss da6a94efbb [tests] has_feature() helper func
has_feature() helper func so that tests
can be skipped if support is not present
2019-05-13 21:01:57 -04:00