summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* curl: make #0 not output the full URLDaniel Stenberg2020-01-132-1/+69
| | | | | | | | | | It was not intended nor documented! Added test 1176 to verify. Reported-by: vshmuk on hackerone Closes #4812
* ngtcp2: Add an error code for QUIC connection errorsEmil Engler2020-01-111-1/+2
| | | | | | | | | | - Add new error code CURLE_QUIC_CONNECT_ERROR for QUIC connection errors. Prior to this change CURLE_FAILED_INIT was used, but that was not correct. Closes https://github.com/curl/curl/pull/4754
* multi: Change curl_multi_wait/poll to error on negative timeoutJay Satiro2020-01-111-1/+2
| | | | | | | | | | | | | | - Add new error CURLM_BAD_FUNCTION_ARGUMENT and return that error when curl_multi_wait/poll is passed timeout param < 0. Prior to this change passing a negative value to curl_multi_wait/poll such as -1 could cause the function to wait forever. Reported-by: hamstergene@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4763 Closes https://github.com/curl/curl/pull/4765
* test1167: verify global symbols in public headers are curl prefixedDaniel Stenberg2020-01-094-3/+160
| | | | | | | ... using the new badsymbols.pl perl script Fixes #4793 Closes #4794
* libtest/mk-lib1521: adapt to new public header layoutDaniel Stenberg2020-01-091-23/+24
|
* runtests: make random seed fixed for a monthDaniel Stenberg2020-01-092-10/+39
| | | | | | | | | | | | | | | | | When using randomized features of runtests (-R and --shallow) it is useful to have a fixed random seed to make sure for example extra commits in a branch or a rebase won't change the seed that would make repeated runs work differently. As it is also useful to change seed sometimes, the default seed is now determined based on the current month (and first line curl -V output). When the month changes, so will the random seed. The specific seed is also shown in the standard test suite top header and it can be set explictly with the new --seed=[num] option so that the exact order of a previous run can be achieved. Closes #4734
* TrackMemory tests: always remove CR before LFMarcel Raad2020-01-062-0/+2
| | | | | | | | It was removed for output containing ' =' via `s/ =.*//`. With classic MinGW, this made lines with `free()` end with CRLF, but lines with e.g. `malloc()` end with only LF. The tests expect LF only. Closes https://github.com/curl/curl/pull/4788
* curl -w: handle a blank input file correctlyDaniel Stenberg2020-01-062-1/+49
| | | | | | | | | | Previously it would end up with an uninitialized memory buffer that would lead to a crash or junk getting output. Added test 1271 to verify. Reported-by: Brian Carpenter Closes #4786
* curl: properly free mimepost dataDaniel Stenberg2020-01-042-2/+69
| | | | | | | | | | ... as it could otherwise leak memory when a transfer failed. Added test 1293 to verify. Reported-by: Brian Carpenter Fixes #4781 Closes #4782
* tests: Fix bounce requests with truncated writesMarc Aldorasi2020-01-031-0/+2
| | | | | | | | Prior to this change the swsbounce check in service_connection could fail because prevtestno and prevpartno were not set, which would cause the wrong response data to be sent to some tests and cause them to fail. Ref: https://github.com/curl/curl/pull/4717#issuecomment-570240785
* tests: Change NTLM tests to require SSLJay Satiro2019-12-3148-0/+48
| | | | | | | | | | | | | | | | | | Prior to this change tests that required NTLM feature did not require SSL feature. There are pending changes to cmake builds that will allow enabling NTLM in non-SSL builds in Windows. In that case the NTLM auth strings created are different from what is expected by the NTLM tests and they fail: "The issue with NTLM is that previous non-SSL builds would not enable NTLM and so the NTLM tests would be skipped." Assisted-by: marc-groundctl@users.noreply.github.com Ref: https://github.com/curl/curl/pull/4717#issuecomment-566218729 Closes https://github.com/curl/curl/pull/4768
* sws: search for "Testno:" header uncondtionally if no testnoDaniel Stenberg2019-12-192-18/+25
| | | | | | | | | Even if the initial request line wasn't found. With the fix to 1455, the test number is now detected correctly. (Problem found when running tests in random order.) Closes #4744
* tests: set LC_ALL in more testsDaniel Stenberg2019-12-193-3/+3
| | | | | | Follow-up to 23208e330ac0c21 Closes #4743
* test165: set LC_ALL=en_US.UTF-8 tooDaniel Stenberg2019-12-191-1/+1
| | | | | | | | | On my current Debian Unstable with libidn2 2.2.0, I get an error if LC_ALL is set to blank. Then curl errors out with: curl: (3) Failed to convert www.åäö.se to ACE; could not convert string to UTF-8 Closes #4738
* test1456: remove the use of a fixed local portDaniel Stenberg2019-12-191-2/+8
| | | | | | | | | Fixup the test to instead not compare the port number. It sometimes caused problems like this: "curl: (45) bind failed with errno 98: Address already in use" Closes #4733
* test1270: a basic -w redirect_url testDaniel Stenberg2019-12-182-1/+70
| | | | Closes #4728
* tests: make sure checksrc runs on header files tooDaniel Stenberg2019-12-164-5/+5
|
* lib1591: free memory properly on OOM, in the trailers callbackDaniel Stenberg2019-12-151-4/+17
| | | | | | Detected by torture tests. Closes #4720
* runtests: --repeat=[num] to repeat testsDaniel Stenberg2019-12-152-0/+19
| | | | Closes #4715
* tests: use DoH feature for DoH testsMarcel Raad2019-12-133-1/+2
| | | | | | | Previously, http/2 was used instead. Assisted-by: Jay Satiro Closes https://github.com/curl/curl/pull/4692
* tests: fix build with `CURL_DISABLE_DOH`Marcel Raad2019-12-132-2/+14
| | | | Closes https://github.com/curl/curl/pull/4692
* unit1620: fix bad free in OOMDaniel Stenberg2019-12-131-0/+2
| | | | Closes #4709
* unit1609: fix mem-leak in OOMDaniel Stenberg2019-12-131-9/+20
| | | | Closes #4709
* unit1607: fix mem-leak in OOMDaniel Stenberg2019-12-131-12/+18
| | | | Closes #4709
* lib1559: fix mem-leak in OOMDaniel Stenberg2019-12-131-8/+4
| | | | Closes #4709
* lib1557: fix mem-leak in OOMDaniel Stenberg2019-12-131-3/+3
| | | | Closes #4709
* runtests: introduce --shallow to reduce huge torture testsDaniel Stenberg2019-12-112-4/+41
| | | | | | | | | | | | When set, shallow mode limits runtests -t to make no more than NUM fails per test case. If more are found, it will randomly discard entries until the number is right. The random seed can also be set. This is particularly useful when running MANY tests as then most torture failures will already fail the same functions over and over and make the total operation painfully tedious. Closes #4699
* tests: make it possible to set executable extensionsMarc Hoersken2019-12-094-17/+36
| | | | | | | | | | | | | | | | | This enables the use of Windows Subsystem for Linux (WSL) to run the testsuite against Windows binaries while using Linux servers. This commit introduces the following environment variables: - CURL_TEST_EXE_EXT: set the executable extension for all components - CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only - CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only Later testcurl.pl could be adjusted to make use of those variables. - CURL_TEST_EXE_EXT_SRV: set it for the test servers only (This is one of several commits to support use of WSL for the tests.) Closes https://github.com/curl/curl/pull/3899
* tests: fix permissions of ssh keys in WSLMarc Hoersken2019-12-091-0/+3
| | | | | | | | | Keys created on Windows Subsystem for Linux (WSL) require it for some reason. (This is one of several commits to support use of WSL for the tests.) Ref: https://github.com/curl/curl/pull/3899
* tests: use \r\n for log messages in WSLMarc Hoersken2019-12-091-1/+9
| | | | | | | | Bash in Windows Subsystem for Linux (WSL) requires it for some reason. (This is one of several commits to support use of WSL for the tests.) Ref: https://github.com/curl/curl/pull/3899
* conncache: fix multi-thread use of shared connection cacheDaniel Stenberg2019-12-091-0/+6
| | | | | | | | | It could accidentally let the connection get used by more than one thread, leading to double-free and more. Reported-by: Christopher Reid Fixes #4544 Closes #4557
* etag: allow both --etag-compare and --etag-save in same cmdlineDaniel Stenberg2019-12-052-1/+62
| | | | | Fixes #4669 Closes #4678
* test342: make it return a 304 as the tag matchesDaniel Stenberg2019-12-051-3/+2
|
* curl_setup: disable IPv6 resolver without `getaddrinfo`Marcel Raad2019-12-031-3/+3
| | | | | | | | | | Also, use `CURLRES_IPV6` only for actual DNS resolution, not for IPv6 address support. This makes it possible to connect to IPv6 literals by setting `ENABLE_IPV6` even without `getaddrinfo` support. It also fixes the CMake build when using the synchronous resolver without `getaddrinfo` support. Closes https://github.com/curl/curl/pull/4662
* build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro2019-12-014-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
* curl: two new command line options for etagsMaros Priputen2019-11-284-2/+180
| | | | | | | | --etag-compare and --etag-save Suggested-by: Paul Hoffman Fixes #4277 Closes #4543
* dist: add error-codes.plMarcel Raad2019-11-261-1/+1
| | | | | | | Follow-up to commit 74f441c6d31. This should fix test 1175 when run via the daily source tarballs. Closes https://github.com/curl/curl/pull/4638
* multi: add curl_multi_wakeup()Gergely Nagy2019-11-259-3/+485
| | | | | | | | | | | | This commit adds curl_multi_wakeup() which was previously in the TODO list under the curl_multi_unblock name. On some platforms and with some configurations this feature might not be available or can fail, in these cases a new error code (CURLM_WAKEUP_FAILURE) is returned from curl_multi_wakeup(). Fixes #4418 Closes #4608
* test1175: verify symbols-in-versions and libcurl-errors.3 in syncDaniel Stenberg2019-11-223-1/+106
| | | | Closes #4628
* include: make CURLE_HTTP3 use a new error codeDaniel Stenberg2019-11-211-2/+3
| | | | | | | | | To avoid potential issues with error code reuse. Reported-by: Christoph M. Becker Assisted-by: Dan Fandrich Fixes #4601 Closes #4627
* doh: improced both encoding and decodingNiall2019-11-161-27/+91
| | | | | | | | | | | Improved estimation of expected_len and updated related comments; increased strictness of QNAME-encoding, adding error detection for empty labels and names longer than the overall limit; avoided treating DNAME as unexpected; updated unit test 1655 with more thorough set of proofs and tests Closes #4598
* curl: fix -T globbingDaniel Stenberg2019-11-144-0/+223
| | | | | | | | | | | | Regression from e59371a4936f8 (7.67.0) Added test 490, 491 and 492 to verify the functionality. Reported-by: Kamil Dudka Reported-by: Anderson Sasaki Fixes #4588 Closes #4591
* quiche: reject headers in the wrong orderDaniel Stenberg2019-11-121-1/+1
| | | | | | | | Pseudo header MUST come before regular headers or cause an error. Reported-by: Cynthia Coan Fixes #4571 Closes #4584
* CURL-DISABLE: initial docs for the CURL_DISABLE_* definesDaniel Stenberg2019-11-121-0/+37
| | | | | | | | | | The disable-scan script used in test 1165 is extended to also verify that the docs cover all used defines and all defines offered by configure. Reported-by: SLDiggie on github Fixes #4545 Closes #4587
* test1558: use double slash after file:Marcel Raad2019-11-101-5/+1
| | | | | | | Classic MinGW / MSYS 1 doesn't support `MSYS2_ARG_CONV_EXCL`, so this test unnecessarily failed when using `file:/` instead of `file:///`. Closes https://github.com/curl/curl/pull/4554
* strerror: Fix an error looking up some Windows error stringsJay Satiro2019-11-091-1/+2
| | | | | | | | | | | | | | | | | | - Use FORMAT_MESSAGE_IGNORE_INSERTS to ignore format specifiers in Windows error strings. Since we are not in control of the error code we don't know what information may be needed by the error string's format specifiers. Prior to this change Windows API error strings which contain specifiers (think specifiers like similar to printf specifiers) would not be shown. The FormatMessage Windows API call which turns a Windows error code into a string could fail and set error ERROR_INVALID_PARAMETER if that error string contained a format specifier. FormatMessage expects a va_list for the specifiers, unless inserts are ignored in which case no substitution is attempted. Ref: https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
* test1560: require IPv6 for IPv6 aware URL parsingDaniel Stenberg2019-11-081-0/+1
| | | | | | | | | The URL parser function can't reject a bad IPv6 address properly when curl was built without IPv6 support. Reported-by: Marcel Raad Fixes #4556 Closes #4572
* certs/Server-localhost-lastSAN-sv: regenerate with sha256Marcel Raad2019-11-028-189/+191
| | | | | | | | All other certificates were regenerated in commit ba782baac30, but this one was missed. Fixes test3001 on modern systems. Closes https://github.com/curl/curl/pull/4551
* copyrights: update all copyright notices to 2019 on files changed this yearVilhelm Prytz2019-11-0212-12/+12
| | | | Closes #4547
* url: make Curl_close() NULLify the pointer tooDaniel Stenberg2019-10-301-2/+2
| | | | | | | This is the common pattern used in the code and by a unified approach we avoid mistakes. Closes #4534