summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* print_category: print help descriptions alignedbagder/help-alignedDaniel Stenberg2021-09-303-18/+18
| | | | | | | | Adjust the description position to make an aligned column when doing help listings, which is more pleasing to the eye. Suggested-by: Gisle Vanem Closes #7792
* tool_listhelp: easier to generate with gen.plDaniel Stenberg2021-09-303-8/+8
| | | | | | | | | | | | | | | tool_listhelp.c is now a separate file with only the command line --help output, exactly as generated by gen.pl. This makes it easier to generate updates according to what's in the docs/cmdline-opts docs. cd $srcroot/docs/cmdline-opts ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c With a configure build, this also works: make -C src listhelp Closes #7787
* scripts/copyright: .muse is .lift nowDaniel Stenberg2021-09-285-5/+5
| | | | And update 5 files with old copyright year range
* CURLOPT_PREREQFUNCTION: add new callbackMax Dymond2021-09-2711-3/+375
| | | | | | | | | | | | | | Triggered before a request is made but after a connection is set up Changes: - callback: Update docs and callback for pre-request callback - Add documentation for CURLOPT_PREREQDATA and CURLOPT_PREREQFUNCTION, - Add redirect test and callback failure test - Note that the function may be called multiple times on a redirection - Disable new 2086 test due to Windows weirdness Closes #7477
* urlapi: support UNC paths in file: URLs on WindowsSergey Markelov2021-09-272-0/+4
| | | | | | | | | | - file://host.name/path/file.txt is a valid UNC path \\host.name\path\files.txt to a non-local file transformed into URI (RFC 8089 Appendix E.3) - UNC paths on other OSs must be smb: URLs Closes #7366
* urlapi: add curl_url_strerror()i-ky2021-09-277-49/+76
| | | | | | | | | | Add curl_url_strerror() to convert CURLUcode into readable string and facilitate easier troubleshooting in programs using URL API. Extend CURLUcode with CURLU_LAST for iteration in unit tests. Update man pages with a mention of new function. Update example code and tests with new functionality where it fits. Closes #7605
* libssh2: add SHA256 fingerprint supportMats Lindestam2021-09-268-4/+122
| | | | | | | Added support for SHA256 fingerprint in command line curl and in libcurl. Closes #7646
* cleanup: constify unmodified static structsRikard Falkeborn2021-09-236-16/+16
| | | | | | | Constify a number of static structs that are never modified. Make them const to show this. Closes #7759
* test897: verify delivery of IMAP post-body header contentDaniel Stenberg2021-09-213-2/+79
| | | | | | | | | | | | | The "content" is delivered as "body" by curl, but the envelope continues after the body and the rest of it should be delivered as header. The IMAP server can now get 'POSTFETCH' set to include more data to include after the body and test 897 is done to verify that such "extra" header data is in fact delivered by curl as header. Ref: #7284 but fails to reproduce the issue Closes #7748
* http: fix the broken >3 digit response code detectionDaniel Stenberg2021-09-172-1/+46
| | | | | | | | | | | | | When the "reason phrase" in the HTTP status line starts with a digit, that was treated as the forth response code digit and curl would claim the response to be non-compliant. Added test 1466 to verify this case. Regression brought by 5dc594e44f73b17 Reported-by: Glenn de boer Fixes #7738 Closes #7739
* hsts: CURLSTS_FAIL from hsts read callback should fail transferDaniel Stenberg2021-09-162-2/+28
| | | | | | | | | | ... and have CURLE_ABORTED_BY_CALLBACK returned. Extended test 1915 to verify. Reported-by: Jonathan Cardoso Fixes #7726 Closes #7729
* test1184: disableDaniel Stenberg2021-09-161-0/+2
| | | | | | | | | The test should be fine and it works for me repeated when run manually, but clearly it causes CI failures and it needs more research. Reported-by: RiderALT on github Fixes #7725 Closes #7732
* tests/sshserver.pl: make it work with openssh-8.7p1Kamil Dudka2021-09-161-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by not using options with no argument where an argument is required: === Start of file tests/log/ssh_server.log curl_sshd_config line 6: no argument after keyword "DenyGroups" curl_sshd_config line 7: no argument after keyword "AllowGroups" curl_sshd_config line 10: Deprecated option AuthorizedKeysFile2 curl_sshd_config line 29: Deprecated option KeyRegenerationInterval curl_sshd_config line 39: Deprecated option RhostsRSAAuthentication curl_sshd_config line 40: Deprecated option RSAAuthentication curl_sshd_config line 41: Deprecated option ServerKeyBits curl_sshd_config line 45: Deprecated option UseLogin curl_sshd_config line 56: no argument after keyword "AcceptEnv" curl_sshd_config: terminating, 3 bad configuration options === End of file tests/log/ssh_server.log === Start of file log/sftp_server.log curl_sftp_config line 33: Unsupported option "rhostsrsaauthentication" curl_sftp_config line 34: Unsupported option "rsaauthentication" curl_sftp_config line 52: no argument after keyword "sendenv" curl_sftp_config: terminating, 1 bad configuration options Connection closed. Connection closed === End of file log/sftp_server.log Closes #7724
* hsts: handle unlimited expiryDaniel Stenberg2021-09-153-13/+22
| | | | | | | | | | | | | | | | | | | When setting a blank expire string, meaning unlimited, curl would pass TIME_T_MAX to getime_r() when creating the output, while on 64 bit systems such a large value cannot be convetered to a tm struct making curl to exit the loop with an error instead. It can't be converted because the year it would represent doesn't fit in the 'int tm_year' field! Starting now, unlimited expiry is instead handled differently by using a human readable expiry date spelled out as "unlimited" instead of trying to use a distant actual date. Test 1660 and 1915 have been updated to help verify this change. Reported-by: Jonathan Cardoso Fixes #7720 Closes #7721
* ftp,imap,pop3,smtp: reject STARTTLS server response pipeliningPatrick Monnerat2021-09-135-1/+221
| | | | | | | | | | | | | If a server pipelines future responses within the STARTTLS response, the former are preserved in the pingpong cache across TLS negotiation and used as responses to the encrypted commands. This fix detects pipelined STARTTLS responses and rejects them with an error. CVE-2021-22947 Bug: https://curl.se/docs/CVE-2021-22947.html
* ftp,imap,pop3: do not ignore --ssl-reqdPatrick Monnerat2021-09-134-0/+165
| | | | | | | | | | | | In imap and pop3, check if TLS is required even when capabilities request has failed. In ftp, ignore preauthentication (230 status of server greeting) if TLS is required. Bug: https://curl.se/docs/CVE-2021-22946.html CVE-2021-22946
* http_proxy: fix the User-Agent inclusion in CONNECTDaniel Stenberg2021-09-132-1/+109
| | | | | | | | | | | | It should not refer to the uagent string that is allocated and created for the end server http request, as that pointer may be cleared on subsequent CONNECT requests. Added test case 1184 to verify. Reported-by: T200proX7 on github Fixes #7705 Closes #7707
* runtests: add option -u to error on server unexpectedly aliveMarc Hoersken2021-09-092-26/+98
| | | | | | | | | | | | | | | Let's try to actually handle the server unexpectedly alive case by first making them visible on CI builds as failures. This is needed to detect issues with killing of the test servers completely including nested process chains with multiple PIDs per test server (including bash and perl). On Windows/cygwin platforms this is especially helpful with debugging PID mixups due to cygwin using its own PID space. Reviewed-by: Daniel Stenberg Closes #7180
* copyrights: update copyright year rangesDaniel Stenberg2021-09-086-6/+6
|
* curl: stop retry if Retry-After: is longer than allowedDaniel Stenberg2021-09-062-1/+50
| | | | | | | | | | | If Retry-After: specifies a period that is longer than what fits within --retry-max-time, then stop retrying immediately. Added test 366 to verify. Reported-by: Kari Pahula Fixes #7675 Closes #7676
* test1173: check references to libcurl optionsDaniel Stenberg2021-09-042-17/+65
| | | | | | | ... that they refer to actual existing libcurl options. Reviewed-by: Daniel Gustafsson Closes #7656
* opt-docs: verify man page sections + orderDaniel Stenberg2021-09-041-5/+68
| | | | | | | | | | | | | | | | | | | | In every libcurl option man page there are now 8 mandatory sections that must use the right name in the correct order and test 1173 verifies this. Only 14 man pages needed adjustments. The sections and the order is as follows: - NAME - SYNOPSIS - DESCRIPTION - PROTOCOLS - EXAMPLE - AVAILABILITY - RETURN VALUE - SEE ALSO Reviewed-by: Daniel Gustafsson Closes #7656
* opt-docs: make sure all man pages have examplesDaniel Stenberg2021-09-041-0/+22
| | | | | | | | | Extended manpage-syntax.pl (run by test 1173) to check that every man page for a libcurl option has an EXAMPLE section that is more than two lines. Then fixed all errors it found and added examples. Reviewed-by: Daniel Gustafsson Closes #7656
* connect: get local port + ip also when reusing connectionsDaniel Stenberg2021-09-022-1/+72
| | | | | | | | | | | | Regression. In d6a37c23a3c (7.75.0) we removed the duplicated storage (connection + easy handle), so this info needs be extracted again even for re-used connections. Add test 435 to verify Reported-by: Max Dymond Fixes #7660 Closes #7662
* tests: adjust the tftpd output to work with hyper modeDaniel Stenberg2021-09-0120-126/+123
| | | | | | | | | | By making them look less like http headers, the hyper mode "tweak" doesn't interfere. Enable test 2002 and 2003 in hyper builds (and 1280 which is unrelated but should be enabled). Closes #7658
* test365: verify response with chunked AND Content-Length headersDaniel Stenberg2021-08-312-1/+66
|
* http: ignore content-length if any transfer-encoding is usedDaniel Stenberg2021-08-317-57/+49
| | | | | Fixes #7643 Closes #7649
* http: disallow >3-digit response codesDaniel Stenberg2021-08-263-27/+28
| | | | | | | | | | Make the built-in HTTP parser behave similar to hyper and reject any HTTP response using more than 3 digits for the response code. Updated test 1432 accordingly. Enabled test 1432 in the hyper builds. Closes #7641
* test1280: CRLFify the response to please hyperDaniel Stenberg2021-08-261-5/+5
| | | | Closes #7639
* tests: enable test 1129 for hyper buildsDaniel Stenberg2021-08-261-1/+0
| | | | Closes #7638
* c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connectionDaniel Stenberg2021-08-231-1/+0
| | | | | | Enable test 1074 Closes #7617
* c-hyper: deal with Expect: 100-continue combined with POSTFIELDSDaniel Stenberg2021-08-231-2/+0
| | | | | | Enable test 1130 and 1131 Closes #7616
* tests: be explicit about using 'python3' instead of 'python'a13460542021-08-234-4/+4
| | | | | | | This fixes running tests in virtualenvs (or on distros) that no longer have a symlink from python to python2 or python3. Closes #7602
* DISABLED: enable 11 more tests for hyper buildsDaniel Stenberg2021-08-231-11/+0
| | | | Closes #7612
* setopt: enable CURLOPT_IGNORE_CONTENT_LENGTH for hyperDaniel Stenberg2021-08-231-1/+0
| | | | | | | | | | | Since this option is also used for FTP, it needs to work to set for applications even if hyper doesn't support it for HTTP. Verified by test 1137. Updated docs to specify that the option doesn't work for HTTP when using the hyper backend. Closes #7614
* test1138: remove trailing space to make work with hyperDaniel Stenberg2021-08-232-3/+2
| | | | Closes #7613
* man pages: remove trailing whitespacesDaniel Stenberg2021-08-212-1/+13
| | | | | | | | | Extended test 1173 (via the manpage-syntax.pl script) to detect and warn for them. Ref: #7602 Reported-by: a1346054 on github Closes #7604
* http_proxy: fix user-agent and custom headers for CONNECT with hyperDaniel Stenberg2021-08-201-1/+0
| | | | | | Enable test 287 Closes #7598
* c-hyper: initial support for "dumping" 1xx HTTP responsesDaniel Stenberg2021-08-201-4/+0
| | | | | | | | With the use hyper_request_on_informational() Enable test 155 and 158 Closes #7597
* tests/*server.pl: flush output before executing subprocessMarc Hoersken2021-08-186-3/+18
| | | | | | | | | | | | | | | | | | Also avoid shell processes staying around by using exec. This is necessary to avoid output data being buffering inside the process chain of Perl, Bash/Shell and our test server binaries. On non-Windows systems the exec will also make the subprocess replace the intermediate shell, but on Windows it will at least bind the processes together since there is no real fork or exec available. See: https://cygwin.com/cygwin-ug-net/highlights.html and: https://docs.microsoft.com/cpp/c-runtime-library/exec-wexec-functions Ref: https://github.com/curl/curl/pull/7530#issuecomment-900949010 Reviewed-by: Daniel Stenberg Reviewed-by: Jay Satiro Closes #7530
* tests/server/*.c: align handling of portfile argument and fileMarc Hoersken2021-08-176-25/+47
| | | | | | | | | | | | 1. Call the internal variable portname (like pidname) everywhere. 2. Have a variable wroteportfile (like wrotepidfile) everywhere. 3. Make sure the file is cleaned up on exit (like pidfile). 4. Add parameter --portfile to usage outputs everywhere. Reviewed-by: Daniel Stenberg Replaces #7523 Closes #7574
* misc: update incorrect copyright year rangesDaniel Stenberg2021-08-168-8/+8
| | | | Closes #7577
* c-hyper: initial step for 100-continue supportDaniel Stenberg2021-08-131-1/+0
| | | | | | Enabled test 154 Closes #7568
* http: consider cookies over localhost to be secureDaniel Stenberg2021-08-103-71/+132
| | | | | | | | | Updated test31. Added test 392 to verify secure cookies used for http://localhost Reviewed-by: Daniel Gustafsson Fixes #6733 Closes #7263
* test1565: fix windows build errorsJay Satiro2021-08-101-4/+7
| | | | | | | | | | | | | - Use our wait_ms() instead of sleep() since Windows doesn't have the latter. - Use a separate variable to keep track of whether the pthread_t thread id is valid. On Windows pthread_t is not an integer type. pthread offers no macro for invalid pthread_t thread id, so validity is kept track of separately. Closes https://github.com/curl/curl/pull/7527
* tool/tests: fix potential year 2038 issuesBin Lan2021-07-302-4/+4
| | | | | | | | | | The length of 'long' in a 32-bit system is 32 bits, which cannot be used to save timestamps after 2038. Most operating systems have extended time_t to 64 bits. Remove the castings to long. Closes #7466
* tests: make three tests pass until 2037Bernhard M. Wiedemann2021-07-303-6/+7
| | | | | | after 2038 something in test1915 fails on 32-bit OSes Closes #7512
* tests/*server.py: remove pidfile on server terminationMarc Hoersken2021-07-293-0/+9
| | | | | | | Avoid pidfile leaking/laying around after server already exited. Reviewed-by: Daniel Stenberg Closes #7506
* tests/servers: remove obsolete pid variableMarc Hoersken2021-07-253-12/+3
| | | | | | | Variable is not used since pidfile handling moved to util.[ch] Reviewed-by: Jay Satiro Closes #7482
* tests/servers: use our platform-aware pid for server verificationMarc Hoersken2021-07-255-12/+22
| | | | | | | | | | | The pid used for server verification is later stored as pid2 in the hash of running test servers and therefore used for shutdown. The pid used for shutdown must be the platform-aware (Win32) pid to avoid leaking test servers while running them using Cygwin/msys. Reviewed-by: Jay Satiro Closes #7481