Commit Graph

846 Commits

Author SHA1 Message Date
Daniel Stenberg
b0394b1535
runtests: if DISABLED cannot be read, error out
Because then runtests cannot disable the right set of tests and things
will be annoying.

Closes #14411
2024-08-07 00:30:17 +02:00
Daniel Stenberg
7d45b52166
KNOWN_BUGS: mention AppleIDN and WinIDN test problems
Closes #14176
Closes #14387
2024-08-05 08:23:37 +02:00
Viktor Szakats
f81f351b9a
tidy-up: OS names
Use these words and casing more consistently across text, comments and
one curl tool output:
AIX, ALPN, ANSI, BSD, Cygwin, Darwin, FreeBSD, GitHub, HP-UX, Linux,
macOS, MS-DOS, MSYS, MinGW, NTLM, POSIX, Solaris, UNIX, Unix, Unicode,
WINE, WebDAV, Win32, winbind, WinIDN, Windows, Windows CE, Winsock.

Mostly OS names and a few more.

Also a couple of other minor text fixups.

Closes #14360
2024-08-04 19:17:45 +02:00
Viktor Szakats
4f198c8525
tests: fixup tests/data/Makefile.am references
Follow-up to f5b826532f #14357
Reported-by: Stefan Eissing
Fixes #14371
Closes #14372
2024-08-04 15:28:29 +02:00
Viktor Szakats
1565c02ab4
runtests: fold timing details with GHA, sync -r tflags
- move timing details into a foldable group when run in GitHub Actions.
  Spec:
  https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

- enable `-r` (run time stats) option in autotools' `test-ci` target,
  syncing it with cmake.

Closes #14284
2024-07-27 19:17:31 +02:00
Viktor Szakats
1dd71312bf
runtests: fix newline glitch in FAIL details
Follow-up to bae5553599 #14174
2024-07-18 01:10:29 +02:00
Viktor Szakats
bae5553599
runtests: show name and keywords for failed tests in summary
Useful to see what the numbers listed in the `TESTFAIL:` and `IGNORED:`
lines mean. Also list test keywords to help catching failure patterns.

Example:
```
FAIL 1034: 'HTTP over proxy with malformatted IDN host name' HTTP, HTTP GET, HTTP proxy, IDN, FAILURE, config file
FAIL 1035: 'HTTP over proxy with too long IDN host name' HTTP, HTTP GET, HTTP proxy, IDN, FAILURE

TESTFAIL: These test cases failed: 1034 1035
```

Closes #14174
2024-07-16 11:56:34 +02:00
Viktor Szakats
58772b0e08
runtests: set SOURCE_DATE_EPOCH to fix failing around midnight
To make sure that `managen` called by test 1706 uses the same date as
the test expects in the `%DATE` macro.

Before this patch when tests started running before UTC midnight and
reached test 1706 after, these dates were different and the test failed.

Follow-up to 0e73b69b3d
Fixes #14173
Closes #14187
2024-07-16 02:13:48 +02:00
Viktor Szakats
18f1cd7a77
tests: sync feature names with curl -V
Some feature names used in tests had minor differences compared to
the well-known ones from `curl -V`. This patch syncs them to make test
results easier to grok.

Closes #14183
2024-07-16 00:44:55 +02:00
Stefan Eissing
9e5b11c659
sendf: fix CRLF conversion of input
When CRLF line end conversion was enabled (--crlf), input after the last
newline in the upload buffer was not sent, if the buffer contained a
newline.

Reported-by: vuonganh1993 on github
Fixes #14165
Closes #14169
2024-07-15 23:47:33 +02:00
Viktor Szakats
2583d11f22
tests: delete CharConv remains
Closes #14100
2024-07-04 18:12:40 +02:00
Daniel Stenberg
cdbfad96ff
runtests: fix %VERNUM
It needs to be set to the leading digits and dots only, so that the
`-[date]` suffix strings are not included, as those used in the daily
snapshots.

Fixes #14035
Reported-by: Marcel Raad
Closes #14036
2024-06-27 12:48:35 +02:00
Daniel Stenberg
0e73b69b3d
runtests: support %DATE for YYYY-MM-DD of right now 2024-06-26 15:49:26 +02:00
Daniel Stenberg
348882ee79
runtests: support %VERNUM
For the plain version number of the built curl without -DEV etc. Only
digits and dots.
2024-06-26 15:49:26 +02:00
Daniel Stenberg
a7ec6a76ab
runtests: support crlf="yes" for the <stderr> section 2024-06-24 08:43:40 +02:00
Viktor Szakats
a40204aff4
runtests: sort test IDs in summary lines
Changing this output:
```
TESTFAIL: These test cases failed: 2301 2303 2302 2307
```
Ref: https://github.com/curl/curl/actions/runs/9228638364/job/25393106631#step:6:21181

To:
```
TESTFAIL: These test cases failed: 2301 2302 2303 2307
```

Cherry-picked from #13766
Closes #13774
2024-05-26 22:43:05 +02:00
Evgeny Grin
6d6113e122
tests: add SHA-512/256 unit test 2024-02-20 11:36:03 +01:00
Daniel Stenberg
8620b11c3a
runtests: for mode="text" on <stdout>, fix newlines on both parts
Closes #12612
2024-01-02 08:44:01 +01:00
Daniel Stenberg
3dcf301752
runtests: support -gl. Like -g but for lldb.
Follow-up to 63b5748

Invokes the test case via lldb instead of gdb. Since using gdb is such a
pain on mac, using lldb is sometimes less quirky.

Closes #12547
2023-12-18 11:13:30 +01:00
Jacob Hoffman-Andrews
5ecbe4df22
tets: make test documentation more user-friendly
Put the instructions to run tests right at the top of tests/README.md.

Give instructions to read the runtests.1 man page for information
about flags. Delete redundant copy of the flags documentation in the
README.

Add a mention in README.md of the important parallelism flag, to make
test runs go much faster.

Move documentation of output line format into the runtests.1 man page,
and update it with missing flags.

Fix the order of two flags in the man page.

Closes #12193
2023-10-25 07:54:54 +02:00
Dan Fandrich
65729f65c7 runtests: display the test status if tests appear hung
It sometimes happens that a test hangs during a test run and never
returns. The test harness will wait indefinitely for the results and on
CI servers the CI job will eventually be killed after an hour or two.
At the end of a test run, if results haven't come in within a couple of
minutes, display the status of all test runners and what tests they're
running to help in debugging the problem.

This feature is really only kick in with parallel testing enabled, which
is fine because without parallel testing it's usually easy to tell what
test has hung.

Closes #11980
2023-09-29 08:58:52 -07:00
Viktor Szakats
7370a7c760
tests: show which curl tool runtests.pl is using
To help debugging when there is issue finding or running it.

Closes #11953
2023-09-26 22:09:11 +00:00
Dan Fandrich
0d89c9096d runtests: slightly increase the longest log file displayed
The new limit provides enough space for a 64 KiB data block to be logged
in a trace file, plus a few lines at the start and end for context. This
happens to be the amount of data sent at a time in a PUT request.
2023-08-22 15:32:16 -07:00
Daniel Stenberg
1c3fcbdaa9
tests: add 'large-time' as a testable feature
This allows test cases to require this feature to run and to be used in
%if conditions.

Large here means larger than 32 bits. Ie does not suffer from y2038.

Closes #11696
2023-08-19 23:37:02 +02:00
Viktor Szakats
db70846e2e
tests: ensure libcurl.def contains all exports
Add `test1279` to verify that `libcurl.def` lists all exported API
functions found in libcurl headers.

Also:

- extend test suite XML `stdout` tag with the `loadfile` attribute.

- fix `tests/extern-scan.pl` and `test1135` to include websocket API.

- use all headers (sorted) in `test1135` instead of a manual list.

- add options `--sort`, `--heading=` to `tests/extern-scan.pl`.

- add `libcurl.def` to the auto-labeler GHA task.

Follow-up to 2ebc74c36a

Closes #11570
2023-08-03 11:07:47 +00:00
Stefan Eissing
bb07240263
tests: fix h3 server check and parallel instances
- fix check for availability of nghttpx server
- add `tcp` frontend config for same port as quic, as
  without this, port 3000 is bound which clashes for parallel
  testing

Closes #11553
2023-08-01 16:11:48 +02:00
Daniel Stenberg
1032f56efa
curl: make %output{} in -w specify a file to write to
It can be used multiple times. Use %output{>>name} to append.

Add docs. Test 990 and 991 verify.

Idea: #11400
Suggested-by: ed0d2b2ce19451f2
Closes #11416
2023-07-31 23:10:59 +02:00
Patrick Monnerat
038c46f61f
configure, cmake, lib: more form api deprecation
Introduce a --enable-form-api configure option to control its inclusion
in builds. The condition name defined for it is CURL_DISABLE_FORM_API.

Form api code is dependent of MIME: configure and CMake handle this
dependency automatically: CMake by making it a dependent option
explicitly, configure by inheriting the MIME value by default and
rejecting explicit incompatible values.

"form-api" is now a new hidden test feature.

Update libcurl modules to respect this option and adjust tests
accordingly.

Closes #9621
2023-07-31 08:31:38 +02:00
Daniel Stenberg
7c8bae0d9c
nss: remove support for this TLS library
Closes #11459
2023-07-29 23:44:28 +02:00
Dan Fandrich
0526525c33 runtests: work around a perl without SIGUSR1
At least msys2 perl v5.32.1 doesn't seem to define this signal. Since
this signal is only used for debugging, just ignore if setting it fails.

Reported-by: Marcel Raad
Fixes #11350
Closes #11366
2023-06-21 23:22:07 -07:00
Dan Fandrich
62a9731533 runtests: use more consistent failure lines
After a test failure log a consistent log message to make it easier to
parse the log file.  Also, log a consistent message with "ignored" for
failures that cause the test to be not considered at all. These should
perhaps be counted in the skipped category, but this commit does not
change that behaviour.
2023-06-21 14:42:37 -07:00
Dan Fandrich
69e3485e0d runtests: consistently write the test check summary block
The memory check character was erroneously omitted if the memory
checking file was not available for some reason, making the block of
characters an inconsistent length.
2023-06-21 12:39:51 -07:00
Dan Fandrich
089a84660d runtests: better detect and handle pipe errors in the controller
Errors reading and writing to the pipes are now better detected and
propagated up to the main test loop so it can be cleanly shut down. Such
errors are usually due to a runner dying so it doesn't make much sense
to try to continue the test run.
2023-06-19 17:14:27 -07:00
Dan Fandrich
2fe52412b1 runtests: improve error logging
Give more information about test harness error conditions to help figure
out what might be wrong. Print some internal test state when SIGUSR1 is
sent to runtests.pl.

Ref: #11328
2023-06-19 17:14:27 -07:00
Dan Fandrich
847e42d868 runtests: better handle ^C during slow tests
Since the SIGINT handler now just sets a flag that must be checked in the
main controller loop, make sure that runs periodically.  Rather than
blocking on a response from a test runner near the end of the test run,
add a short timeout to allow it.
2023-06-19 17:14:27 -07:00
Dan Fandrich
7d62f0d9b8 runtests; give each server a unique log lock file
Logs are written by several servers and all of them must be finished
writing before the test results can be determined. This means each
server must have its own lock file rather than sharing a single one,
which is how it was done up to now. Previously, the first server to
complete a test would clear the lock before the other server was done,
which caused flaky tests.

Lock files are now all found in their own directory, so counting locks
equals counting the files in that directory.  The result is that the
proxy logs are now reliably written which actually changes the expected
output for two tests.

Fixes #11231
Closes #11259
2023-06-07 16:02:58 -07:00
Daniel Stenberg
92d7dd3955
runtests: move parallel log dirs from logN to log/N
Having several hundreds of them in there gets annoying.

Closes #11264
2023-06-07 23:32:41 +02:00
Dan Fandrich
6e4fedeef7 runtests: document the -j parallel testing option
Reported-by: Daniel Stenberg
Ref: #10818
Closes #11255
2023-06-05 13:39:44 -07:00
Dan Fandrich
f24b4b980d runtests: create multiple test runners when requested
Parallel testing is enabled by using a nonzero value for the -j option
to runtests.pl. Performant values seem to be about 7*num CPU cores, or
1.3*num CPU cores if Valgrind is in use.

Flaky tests due to improper log locking (bug #11231) are exacerbated
while parallel testing, so it is not enabled by default yet.

Fixes #10818
Closes #11246
2023-06-05 11:16:06 -07:00
Dan Fandrich
d454af4737 runtests: handle repeating tests in multiprocess mode
Such as what happens with the --repeat option.  Some functions are
changed to pass the runner ID instead of relying on the non-unique test
number.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
51c22af890 runtests: buffer logmsg while running singletest()
This allows all messages relating to a single test case to be displayed
together at the end of the test.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
296baf45a0 runtests: call initserverconfig() in the runner
This must be done so variables pick up the runner's unique $LOGDIR.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
78d8bc4c63 runtests: use a per-runner random seed
Each runner needs a unique random seed to reduce the chance of port
number collisions. The new scheme uses a consistent per-runner source of
randomness which results in deterministic behaviour, as it did before.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
4317c5549b runtests: complete main test loop refactor for multiple runners
The main test loop is now able to handle multiple runners, or no
additional runner processes at all. At most one process is still
created, however.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
acc0a92897 runtests: prepare main test loop for multiple runners
Some variables are expanded to arrays and hashes so that multiple
runners can be used for running tests.

Ref: #10818
2023-06-05 11:16:06 -07:00
Dan Fandrich
8ac18ee2bb runtests: abort test run after failure without -a
This was broken in a recent refactor and test runs would not stop.

Follow-up to d4a1b5b6

Reported-by: Daniel Stenberg
Fixes #11225
Closes #11227
2023-05-30 13:49:48 -07:00
Dan Fandrich
3d75029859 runtests: fix -c option when run with valgrind
The curl binary argument wasn't being quoted properly. This seems to
have broken at some point after quoting was added in commit 606b29fe.

Reported-by: Daniel Stenberg
Ref: #11073
Fixes #11074
Closes #11076
2023-05-05 09:52:38 -07:00
Dan Fandrich
faebcee349 runtests: support creating more than one runner process
The controller currently only creates and uses one, but more are now
possible.

Ref: #10818
2023-05-05 00:45:43 -07:00
Dan Fandrich
38465f9a55 runtests: spawn a new process for the test runner
When the -j option is given, a new process is spawned in which the test
programs are run and from which test servers are started. Only one
process can be started at once, but this is sufficient to test that the
infrastructure can isolate those functions in a new task. There should
be no visible difference between the two modes at the moment.

Ref: #10818
Closes #11064
2023-05-05 00:45:43 -07:00
Dan Fandrich
d4a1b5b60c runtests: turn singletest() into a state machine
This allows it to run in a non-blocking manner.

Ref: #10818
2023-05-05 00:45:43 -07:00