summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* md4: only build when usedMarcel Raad2023-05-131-1/+1
| | | | | | | | Its only usage in curl_ntlm_core.c is guarded by `USE_CURL_NTLM_CORE`, so let's use this here too. Ref: https://github.com/curl/curl/issues/11098 Closes https://github.com/curl/curl/pull/11102
* test2306: verify getting a second response with folded headersDaniel Stenberg2023-05-124-2/+124
| | | | | | Reproduces the isue #11101 and verifies the fix. Verifies a17b2a503f
* tool_operate: refuse (--data or --form) and --continue-at comboDaniel Stenberg2023-05-082-1/+35
| | | | | | | | | | | | | libcurl assumes that a --continue-at resumption is done to continue an upload using the read callback and neither --data nor --form use that and thus won't do what the user wants. Whatever the user wants with this strange combination. Add test 426 to verify. Reported-by: Smackd0wn on github Fixes #11081 Closes #11083
* runtests: fix -c option when run with valgrindDan Fandrich2023-05-053-10/+27
| | | | | | | | | | 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
* runtests: support creating more than one runner processDan Fandrich2023-05-052-33/+72
| | | | | | | The controller currently only creates and uses one, but more are now possible. Ref: #10818
* runtests: spawn a new process for the test runnerDan Fandrich2023-05-053-21/+110
| | | | | | | | | | | 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
* runtests: turn singletest() into a state machineDan Fandrich2023-05-052-140/+210
| | | | | | This allows it to run in a non-blocking manner. Ref: #10818
* runtests: change runner interface to be asynchronousDan Fandrich2023-05-052-14/+210
| | | | | | | | | | | | | | Program arguments are marshalled and then written to the end of a pipe which is later read from and the arguments unmarshalled before the desired function is called normally. The function return values are then marshalled and written into another pipe when is later read from and unmarshalled before being returned to the caller. The implementation is currently blocking but can be made non-blocking without any changes to the API. This allows calling multiple runners without blocking in the future. Ref: #10818
* runtests: call citest_finishtest in singletestDan Fandrich2023-05-051-8/+21
| | | | | | This is where citest_starttest is called. Ref: #10818
* runtests: add a runner initialization functionDan Fandrich2023-05-052-16/+37
| | | | | | This sets up the runner environment to start running tests. Ref: #10818
* runtests: remove directory from server filename variablesDan Fandrich2023-05-054-54/+58
| | | | | | | | There will soon be multiple log directories so the paths will no longer be static in runtests.pl. Also, get rid of $SERVER2IN which was not used. Ref: #10818
* runtests: reduce package exports after refactoringDan Fandrich2023-05-052-36/+15
| | | | | | | | Some recent refactoring made these export no longer necessary. Also, stop displaying the Unix socket paths at startup since there will soon be many of them and they're not that interesting. Ref: #10818
* runtests: use a function to obtain $LOGDIR for a testDan Fandrich2023-05-052-21/+44
| | | | | | This will no longer be static soon. Ref: #10818
* checksrc: find bad indentation in conditions without open braceDaniel Stenberg2023-04-282-5/+5
| | | | | | | | | | | If the previous line starts with if/while/for AND ends with a closed parenthesis and there's an equal number of open and closed parentheses on that line, verify that this line is indented $indent more steps, if not a cpp line. Also adjust the fall-out from this fix. Closes #11054
* http2: do flow window accounting for cancelled streamsStefan Eissing2023-04-282-32/+148
| | | | | | | | | | - nghttp2 does not free connection level window flow for aborted streams - when closing transfers, make sure that any buffered response data is "given back" to the flow control window - add tests test_02_22 and test_02_23 to reproduce Closes #11052
* tests/http: make curl_setup.h the first includeMarcel Raad2023-04-284-18/+20
| | | | | | | | | | | This is required for the macros there to take effect for system libraries. Specifically, including the system libraries first led to warnings about `_FILE_OFFSET_BITS` being redefined in curl_config.h on the Solaris autobuilds for ws-data.c and ws-pingpong.c. Also make the curl includes come first for the other source files here for consistency. Closes https://github.com/curl/curl/pull/11046
* tests/http: fix out-of-tree buildsDan Fandrich2023-04-273-2/+4
| | | | | | | | | | Add both lib/ directories (src & build) to the search path so curl_setup.h and its dependencies can be found. Followup-to acd82c8b Ref: #11006 Closes #11036
* tests/http: more tests with specific clientsStefan Eissing2023-04-2620-15/+1515
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Makefile support for building test specific clients in tests/http/clients - auto-make of clients when invoking pytest - added test_09_02 for server PUSH_PROMISEs using clients/h2-serverpush - added test_02_21 for lib based downloads and pausing/unpausing transfers curl url parser: - added internal method `curl_url_set_authority()` for setting the authority part of a url (used for PUSH_PROMISE) http2: - made logging of PUSH_PROMISE handling nicer Placing python test requirements in requirements.txt files - separate files to base test suite and http tests since use and module lists differ - using the files in the gh workflows websocket test cases, fixes for we and bufq - bufq: account for spare chunks in space calculation - bufq: reset chunks that are skipped empty - ws: correctly encode frames with 126 bytes payload - ws: update frame meta information on first call of collect callback that fills user buffer - test client ws-data: some test/reporting improvements Closes #11006
* man pages: simplify the .TH sectionsDaniel Stenberg2023-04-262-2/+2
| | | | | | | | | | - remove the version numbers - simplify the texts The date and version number will be put there for releases when maketgz runs the updatemanpages.pl script. Closes #11029
* hostcheck: fix host name wildcard checkingDaniel Stenberg2023-04-264-152/+180
| | | | | | | | | | | The leftmost "label" of the host name can now only match against single '*'. Like the browsers have worked for a long time. - extended unit test 1397 for this - move some SOURCE variables from unit/Makefile.am to unit/Makefile.inc Reported-by: Hiroki Kurosawa Closes #11018
* smbserver: remove temporary files before exitDan Fandrich2023-04-251-1/+54
| | | | | | | | Each execution of test 1451 would leave a file in /tmp before. Since Windows can't delete a file while it's open, all the temporary file names are stored and deleted on exit. Closes #10990
* Websocket en-/decodingStefan Eissing2023-04-251-0/+15
| | | | | | | | | | - state is fully kept at connection, since curl_ws_send() and curl_ws_rec() have lifetime beyond usual transfers - no more limit on frame sizes Reported-by: simplerobot on github Fixes #10962 Closes #10999
* h2/h3: replace `state.drain` counter with `state.dselect_bits`Stefan Eissing2023-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | - `drain` was used by http/2 and http/3 implementations to indicate that the transfer requires send/recv independant from its socket poll state. Intended as a counter, it was used as bool flag only. - a similar mechanism exists on `connectdata->cselect_bits` where specific protocols can indicate something similar, only for the whole connection. - `cselect_bits` are cleard in transfer.c on use and, importantly, also set when the transfer loop expended its `maxloops` tries. `drain` was not cleared by transfer and the http2/3 implementations had to take care of that. - `dselect_bits` is cleared *and* set by the transfer loop. http2/3 does no longer clear it, only set when new events happen. This change unifies the handling of socket poll overrides, extending `cselect_bits` by a easy handle specific value and a common treatment in transfers. Closes #11005
* runtests: support buffering log messages in runner & serversDan Fandrich2023-04-245-33/+100
| | | | | | | | | | | | | | | | | Log messages generated with logmsg can now be buffered and returned from the runner as a return value. This will be needed with parallel testing to allow all messages for one test to be displayed together instead of interspersed with messages of multiple tests. Buffering can be disabled by setting a logging callback function with setlogfunc, which is currently being done to preserve existing logging behaviour for now. Some additional output is generated in verbose and debugprotocol modes, which don't always use logmsg. These modes also impact some servers which generate extra messages. No attempt is made to buffer everything if these modes are enabled. Ref: #10818 Closes #11016
* runtests: more consistently use logmsg in server control codeDan Fandrich2023-04-241-15/+16
| | | | | | Also, display an error when sshversioninfo returns one. Ref: #10818
* runtests: create runner functions for clearlocks and stopserversDan Fandrich2023-04-243-6/+24
| | | | | | | runtests.pl now uses runner for all server actions beyond the initial variable configuration. Ref: #10818
* runtests: tightened servers package exportsDan Fandrich2023-04-243-8/+28
| | | | | The defaults are intended for runtests.pl, whereas runner.pm needs to explicitly specify them.
* runtests: display logs on server failure in singletest()Dan Fandrich2023-04-242-22/+29
| | | | | | | | | | This is closer to the place where logs are displayed on test failure. Also, only display these logs if -p is given, which is the same flag that controls display of test failure logs. Some server log files need to be deleted later so that they stay around long enough to be displayed on failure. Ref: #10818
* runtests: turn a print into a logmsgDan Fandrich2023-04-241-3/+4
| | | | | | Also enable another couple of useful messages in verbose mode. Ref: #10818
* runtests: move showdiff into runtests.plDan Fandrich2023-04-222-45/+46
| | | | It's not used anywhere else.
* devtest: add a new script for testing the test harnessDan Fandrich2023-04-222-1/+194
| | | | | | | | | | This is currently useful for starting a test server on its own without an associated test, which can be used for interactive curl testing or for validating parts of the test harness itself. More commands can be added to perform additional functions in the future. Ref: #10818 Closes #11008
* runtests: refactor the main test loop into twoDan Fandrich2023-04-223-68/+123
| | | | | | | | | | | | | | | | | | | | | | The test loop now has an initial loop that first runs through all possible tests to build a set of those to attempt on this run based on features and keywords and only then goes through that new list to run them. This actually makes it three loops through all tests cases, as there is an existing loop that gathers possible test numbers from the test files on disk. This has two minor effects on the output: all the tests that will be skipped are displayed at the start (instead of being interspersed with other tests) and the -l option no longer shows a count of tests at the end or a (misleading) statement that tests have run successfully. The skipped tests are also omitted from the test results sent to AppVeyor and Azure in CI builds. Another effect is a reduction in the amount of work considered part of the "Test definition reading and preparation time" reported with -r making those figures slightly lower than before. Ref: #10818
* runtests: track only the current test timings in runner.pmDan Fandrich2023-04-223-53/+81
| | | | | | | This avoids passing these data through through global variables, which soon won't be possible. Ref: #10818
* runtests: skip test preprocessing when doing -lDan Fandrich2023-04-221-16/+20
| | | | This speeds up the output tremendously by avoiding unnecessary work.
* runtests: simplify value returned regarding use of valgrindDan Fandrich2023-04-222-11/+10
| | | | | | | As a side effect this will now also show in verbose mode that valgrind is being skipped on tests that explicitly disable it, such as 600. Ref: #10818
* runtests: fix quoting in Appveyor and Azure test integrationDan Fandrich2023-04-222-57/+57
| | | | | | | | Test 1442's name was not quoted correctly so wasn't registered in Appveyor and it had the wrong name in Azure. The JSON string quotes were also invalid, even though both servers happened to accept it regardless. Closes #11010
* runtests: spread out the port numbers used by serversDan Fandrich2023-04-181-21/+29
| | | | | | | | | | | | The server ports are chosen randomly for each server, but the random ranges chosen were inconsistently-sized and overlapping. Now, they are spread out more so at least the first random port chosen for each server is guaranteed to not also be chosen by another server. The starting port numbers are also raised to put them in the Ephemeral Port range—not the range defined by RFC 6335 but the one used by Linux, which starts lower and gives us more room to work with. Reported-by: Daniel Stenberg
* runtests: fix problems on <killserver> failureDan Fandrich2023-04-181-0/+3
| | | | | The verify time must be set in this case, like all cases. An error message needs to be displayed as well.
* runtests: fix perl warning when <tool> is wrongDan Fandrich2023-04-181-1/+1
|
* runtests: don't try to stop stunnel before trying againDan Fandrich2023-04-181-2/+7
| | | | | | | | | | | | Calling stopserver() before retrying stunnel due to an error would stop the dependent server (such as HTTP) meaning stunnel would have nothing to talk to when it came up. Don't try to force a stop when it didn't actually start. Also, don't mark the server as bad for future use when it starts up on a retry. Reported-by: eaglegai at github Tested-by: eaglegai at github Fixes #10976
* runtests: don't accidentally randomly choose the same portDan Fandrich2023-04-181-10/+10
| | | | | | | | If a server couldn't be started on a port, a new one is randomly chosen and the server is tried again. Avoid accidentally using a randomly-chosen 0 port offset by adding 1 to the random number. Found-by: Daniel Stenberg
* runtests: don't attempt to use a port we know is in useDan Fandrich2023-04-181-1/+16
| | | | | | This reduces the startup time when there is a known conflict on the random port chosen for a server. This was already done for stunnel, but now it's done for all servers.
* http-server: fix server name in a log messageDan Fandrich2023-04-181-1/+1
| | | | This changed when the file was renamed in commit cbf57176
* runtests: refactor into more packagesDan Fandrich2023-04-186-303/+332
| | | | | | | | | | | testutil.pm now contains a few miscellaneous functions that are used in several places but have no better place to live. subvariables moves to servers.pm since most variables that it substitutes relate to servers, so this is the most appropriate place. Rename a few functions for better naming consistency. Ref: #10818 Closes #10995
* runtests: call timestampskippedevents() in singletestDan Fandrich2023-04-182-10/+1
| | | | ..rather than by the runner
* runtests: assume a newer Valgrind by defaultDan Fandrich2023-04-182-6/+10
| | | | | The tests for an older Valgrind version should probably just be deleted, given that they're testing for an 18-year-old version.
* runtests: refactor test runner code into runner.pmDan Fandrich2023-04-184-833/+989
| | | | | | | | This is code that is directly responsible for running a single test. This will eventually run in a separate process as part of the parallel testing project. Ref: #10818
* runtests: skip unneeded work if test won't be runningDan Fandrich2023-04-181-25/+35
| | | | | | This speeds up tests by avoiding unnecessary processing. Ref: #10818
* runtests: factor out singletest_postcheckDan Fandrich2023-04-181-7/+24
| | | | | | This will eventually need to be part of the test runner. Ref: #10818
* test303: kill server after testDan Fandrich2023-04-181-0/+3
| | | | | | Otherwise, an HTTP test closely following this one with a tight time constraint (e.g. 672) could fail because the test server stays sitting with the wait command for a while.