Commit Graph

747 Commits

Author SHA1 Message Date
Dan Fandrich
d792cd103c runtests: more refactoring for clarity
Ref: #10818
2023-03-30 09:12:52 -07:00
Dan Fandrich
1ae94c0930 runtests: don't start servers if -l is given 2023-03-30 09:12:52 -07:00
Dan Fandrich
44ec1986da runtests: fix typos 2023-03-30 09:12:52 -07:00
Dan Fandrich
53abe3809d runtests: refactor singletest() into separate functions
This takes it from a 1200 line behemoth into something more manageable.
The content and order of the functions is taken almost directly from
singletest() so the diff sans whitespace is quite short.

Ref: #10818
2023-03-30 09:12:52 -07:00
Dan Fandrich
6c0ee77c8a runtests: refactor singletest() into distinct sections
Namely:
- Verify that this test case should be run
- Start the servers needed to run this test case
- Check that test environment is fine to run this test case
- Prepare the test environment to run this test case
- Run the test command
- Clean up after test command
- Verify test succeeded

Ref: #10818
2023-03-30 09:12:52 -07:00
Dan Fandrich
1dc3088de3 runtests: stop copying a few arrays where not needed
Unlike some other languages that just copy a pointer, perl copies the
entire array contents which takes time for a large array.

Ref: #10818
2023-03-30 09:12:52 -07:00
Dan Fandrich
d428f00db0 runtests: reduce redundant calls to getpart/getpartattr
These functions scan through the entire test file every time to find the
right section, so they can be slow for large test files.

Ref: #10818
2023-03-30 09:12:52 -07:00
Daniel Stenberg
70afa0d251
runtests: die if curl version can be found
Closes #10813
2023-03-22 14:01:45 +01:00
Dan Fandrich
caf5fd1759 tests: sync option lists in runtests.pl & its man page 2023-03-13 17:13:08 -07:00
Patrick Monnerat
5855c478cb
tests: support for imaps/pop3s/smtps protocols
Closes #10077
2023-02-25 11:49:31 +01:00
Patrick Monnerat
8bfa4d66de
runtests: use a hash table for server port numbers
Closes #10077
2023-02-25 11:49:31 +01:00
Matt Jolly
cbf5717615
tests: HTTP server fixups
- httpserver.pl -> http-server.pl for consistency
- add http3-server.pl to EXTRA_DIST; alphabetise for maintainability
- nghttpx proxy invocation scripts should not use getcwd

Closes #10568
2023-02-20 12:59:27 +01:00
Daniel Stenberg
2fdc1d816e
tests: make sure gnuserv-tls has SRP support before using it
Reported-by: fundawang on github
Fixes #10522
Closes #10524
2023-02-15 23:42:42 +01:00
Daniel Stenberg
f1d09231ad
runtests: fix "uninitialized value $port"
by using a more appropriate variable

Reported-by: fundawang on github
Fixes #10518
Closes #10520
2023-02-15 16:09:05 +01:00
Patrick Monnerat
f22cd67b7d
runtests: fix detection of TLS backends
Built-in TLS backends are detected at test time by scanning for their
names in the version string line returned by the cli tool: as this line
may also list the libssh configuration that mentions its own backend,
the curl backend may be wrongly determined.

In example, if the version line contains "libssh/0.10.4/openssl/zlib",
OpenSSL is detected as a curl-configured backend even if not.

This fix requires the backend names to appear as full words preceded by
spacing in the version line to be recognized as curl TLS backends.

Closes #10236
2023-01-05 23:49:10 +01:00
Daniel Stenberg
22f795c834
runtests: consider warnings fatal and error on them
To help us detect and fix warnings in this script easier and faster.

Assisted-by: Jakob Hirsch

Ref: #10206
Closes #10208
2023-01-03 09:29:52 +01:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Timmy Schierling
7baff01fd6
runtest.pl: add expected fourth return value
Fixes warning in autobild log: "Use of uninitialized value $HTTP2TLSPORT
in substitution iterator at /tests/runtests.pl line 3516"

Closes #10206
2023-01-02 16:03:28 +01:00
Daniel Stenberg
d9ee0e47c1
runtests: make 'mbedtls' a testable feature
Also add to FILEFORMAT.md
2022-12-27 22:41:19 +01:00
Daniel Stenberg
dc0725244a
runtests: support crlf="yes" for verify/proxy 2022-12-27 15:22:32 +01:00
Stefan Eissing
4ab601d93a
runtests: also tear down http2/http3 servers when https server is stopped
Closes #10114
2022-12-23 08:56:53 +01:00
Stefan Eissing
c7fb341c0e
tests: add 3 new HTTP/2 test cases, plus https: support for nghttpx
- a simple https get
- a simple https post
- a multi get of 4 requests and check that same connection was used

Closes #10114
2022-12-23 08:56:53 +01:00
Daniel Stenberg
42bcca4af0
runtests: silence nghttpx errors
Also, move the output of the nghttpx_h3 info to the general "Env:" line
in the test output header.

Reported-by: Marcel Raad
Ref: ca15b7512e (commitcomment-92015094)
Closes #10044
2022-12-08 11:02:11 +01:00
Daniel Stenberg
3dfb6aeabb
runtests: only do CRLF replacements for hyper if it is HTTP
Closes #10016
2022-12-01 21:19:40 +01:00
Daniel Stenberg
2f34a7347f
runtests: do CRLF replacements per section only
The `crlf="yes"` attribute and "hyper mode" are now only applied on a
subset of dedicated sections: data, datacheck, stdout and protocol.

Updated test 2500 accordingly.

Also made test1 use crlf="yes" for <protocol>, mostly because it is
often used as a template test case. Going forward, using this attribute
we should be able to write test cases using linefeeds only and avoid
mixed line ending encodings.

Follow-up to ca15b7512e

Fixes #10009
Closes #10010
2022-12-01 15:04:23 +01:00
Stefan Eissing
ca15b7512e
tests: add HTTP/3 test case, custom location for proper nghttpx
- adding support for HTTP/3 test cases via a nghttpx server that is
  build with ngtcp2 and nghttp3.
- test2500 is the first test case, performing a simple GET.
- nghttpx is checked for support and the 'feature' nghttpx-h3
  is set accordingly. test2500 will only run, when supported.
- a specific nghttpx location can be given in the environment
  variable NGHTTPX or via the configure option
    --with-test-nghttpx=<path>

Extend NGHTTPX config to H2 tests as well

* use $ENV{NGHTTPX} and the configured default also in http2 server starts
* always provide the empty test/nghttpx.conf to nghttpx. as it defaults to
  reading /etc/nghttpx/nghttpx.conf otherwise.

Added nghttpx to CI ngtcp2 jobs to run h3 tests.

Closes #9031
2022-11-30 13:56:06 +01:00
Daniel Stenberg
280cbeee27
runtests: --no-debuginfod now disables DEBUGINFOD_URLS
Prior to this change, DEBUGINFOD_URLS was always disabled by runtests
due to a report of it slowing down tests. However, some setups need it
to fetch debug symbols, and if it is disabled on those systems then curl
tests with valgrind will fail.

Reported-by: Mark Gaiser

Ref: #8805
Closes #9950
2022-11-25 09:33:52 +01:00
Daniel Stenberg
f5e5384ec3
test644: verify --xattr (with redirect) 2022-10-22 23:56:38 +02:00
Jay Satiro
d57f906b2a runtests: fix uninitialized value on ignored tests
- Don't show TESTFAIL message (ie tests failed which aren't ignored) if
  only ignored tests failed.

Before:
IGNORED: failed tests: 571 612 1056
TESTDONE: 1214 tests out of 1217 reported OK: 99%
Use of uninitialized value $failed in concatenation (.) or string at
./runtests.pl line 6290.
TESTFAIL: These test cases failed:

After:
IGNORED: failed tests: 571 612 1056
TESTDONE: 1214 tests out of 1217 reported OK: 99%

Closes https://github.com/curl/curl/pull/9648
2022-10-05 04:00:40 -04:00
Marc Hoersken
c5c6e86783
CI/runtests.pl: add param for dedicated curl to talk to APIs
This should make it possible to also report test failures
if our freshly build curl binary is not fully functional.

Reviewed-by: Daniel Stenberg
Closes #9360
2022-08-28 19:18:22 +02:00
Jay Satiro
51e0b8fc60 runtests: add "threadsafe" to detected features
Follow-up to recent commits which added thread-safety support.

Bug: https://github.com/curl/curl/pull/9012#discussion_r902018782
Reported-by: Marc Hörsken

Closes https://github.com/curl/curl/pull/9030
2022-06-21 03:17:56 -04:00
Daniel Stenberg
f0f587d347
runtests: skip starting the ssh server if user name is lacking
Because the ssh server startup script *requires* a user name there's no
point in invoking it if no name was found.

Reported-by: Ricardo M. Correia
Ref: #9007
Closes #9013
2022-06-15 08:31:57 +02:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Daniel Stenberg
f317b75c5e
runtests: fix skipping tests not done event-based
... and call timestampskippedevents() to avoid the flood of
uninitialized variable warnings.

Closes #8977
2022-06-08 10:56:37 +02:00
Fabian Keil
3561e4ed9b
runtests.pl: add the --repeat parameter to the --help output
Closes #8959
2022-06-06 12:26:18 +02:00
Balakrishnan Balasubramanian
dfa84a0450
socks: support unix sockets for socks proxy
Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668
2022-05-19 15:35:03 +02:00
Daniel Gustafsson
93cfed2b73 misc: fix typos
Fix a few random typos is comments and workflow names.
2022-04-21 09:43:35 +02:00
Matteo Baccan
0a6eebfc14 perl: removed a double semicolon at end of line
Remove double semicolons at end of line in Perl code.

Closes: #8709
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-04-14 13:55:32 +02:00
Daniel Stenberg
71a0e053e9
runtests: add 'bearssl' as testable feature
Closes #8684
2022-04-07 08:36:27 +02:00
Daniel Stenberg
7c8c723682
configure: add --enable-headers-api to enable the headers API
Defaults to disabled while labeled EXPERIMENTAL.

Make all the headers API tests require 'headers-api' to run.
2022-03-22 08:24:26 +01:00
Daniel Stenberg
7e145dd270
hyper: no h2c support
Make tests require h2c feature present to run, and only set h2c if
nghttp2 is used in the build. Hyper does not support it.

Remove those tests from DISABLED

Fixes #8605
Closes #8613
2022-03-20 16:45:08 +01:00
Paul Howarth
4b01a57c95
runtests: make 'oldlibssh' be before 0.9.4
The 'oldlibssh' feature indicates that the error code returned by libssh
for a broken known_hosts file should be 67 rather than 60 (test1459).
This feature was added as part of #8444 with 'oldlibssh' mapping to
libssh versions prior to 0.9.6, and then refined as part of #8511 to map
to versions prior to 0.9.5.

In Red Hat Enterprise Linux 8.5 there is a patched version of libssh
version 0.9.4 (https://git.centos.org/rpms/libssh/blob/c8/f/SOURCES) in
which test1459 fails because it returns the "new" value rather than the
"old" one. It's plausible that one of the patches is responsible for
this rather than the underlying code but I don't think so.

This change therefore drops the 'oldlibssh' version check to map to
libssh versions older than 0.9.4, which fixes builds on RHEL-8.

Closes #8548
2022-03-07 08:59:03 +01:00
Daniel Stenberg
c3c736c061
runtests: make 'oldlibssh' be before 0.9.5
Closes #8511
2022-02-26 23:44:53 +01:00
Daniel Stenberg
7c140f6b2d
runtests: set 'oldlibssh' for libssh versions before 0.9.6
... and make test 1459 check for the different return code then.

Closes #8444
2022-02-14 08:26:44 +01:00
Fabian Keil
2cb0eaba75 runtests.pl: tolerate test directories without Makefile.inc
Silences the following warnings when using a Makefile.inc-free
TESTDIR using the "-o" argument:

   readline() on closed filehandle D at ./runtests.pl line 592.
   Use of uninitialized value $disttests in pattern match (m//) at
   ./runtests.pl line 3602.

Closes https://github.com/curl/curl/pull/8379
2022-02-03 16:38:36 -05:00
Patrick Monnerat
52826d3b79
runtests.pl: disable debuginfod
Valgrind and gdb implement this feature: as this highly slows down tests,
disable it.

Closes #8291
2022-01-17 22:26:52 +01:00
Fabian Keil
736847611a
runtests.pl: support the nonewline attribute for the data part
Added to FILEFORMAT

Closes #8239
2022-01-10 15:54:54 +01:00
Daniel Stenberg
223f26c28a
mesalink: remove support
Mesalink has ceased development. We can no longer encourage use of it.
It seems to be continued under the name TabbySSL, but no attempts have
(yet) been to make curl support it.

Fixes #8188
Closes #8191
2022-01-10 11:27:59 +01:00
Daniel Stenberg
cfb4f8b626
runtests: make 'wolfssl' a testable feature
Closes #8252
2022-01-09 18:08:14 +01:00
Daniel Stenberg
1fefa1a856
runtests: make 'rustls' a testable feature 2022-01-09 16:06:19 +01:00