summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Added a unit test for MD4 digest generationSteve Holme2020-02-234-2/+89
| | | | Closes #4970
* test1610: Fixed the link to the unit testSteve Holme2020-02-231-1/+1
| | | | Typo from 81c37124.
* md5/sha256: Updated the functions to allow non-string data to be hashedSteve Holme2020-02-232-11/+13
|
* tests: Added a unit test for SHA256 digest generationSteve Holme2020-02-224-2/+116
| | | | | | Follow up to 2b5b37c. Closes #4968
* altsvc: make saving the cache an atomic operationDaniel Stenberg2020-02-181-2/+2
| | | | | | | | ... by writing the file to temp name then rename to the final when done. Assisted-by: Jay Satiro Fixes #4936 Closes #4942
* altsvc: keep a copy of the file name to survive handle resetDaniel Stenberg2020-02-094-1/+124
| | | | | | | | | | | | The alt-svc cache survives a call to curl_easy_reset fine, but the file name to use for saving the cache was cleared. Now the alt-svc cache has a copy of the file name to survive handle resets. Added test 1908 to verify. Reported-by: Craig Andrews Fixes #4898 Closes #4902
* digest: Do not quote algorithm in HTTP authorisationPierre-Yves Bigourdan2020-02-0714-14/+14
| | | | | | | | | | RFC 7616 section 3.4 (The Authorization Header Field) states that "For historical reasons, a sender MUST NOT generate the quoted string syntax for the following parameters: algorithm, qop, and nc". This removes the quoting for the algorithm parameter. Reviewed-by: Steve Holme Closes #4890
* ftp: remove superfluous checking for crlf in user or pwdDaniel Stenberg2020-02-072-2/+38
| | | | | | | | | ... as this is already done much earlier in the URL parser. Also add test case 894 that verifies that pop3 with an encodedd CR in the user name is rejected. Closes #4887
* cleanup: fix typos and wording in docs and commentsPedro Monreal2020-02-023-6/+6
| | | | | Closes #4869 Reviewed-by: Emil Engler and Daniel Gustafsson
* urlapi: guess scheme correct even with credentials givenDaniel Stenberg2020-01-281-1/+9
| | | | | | | | | In the "scheme-less" parsing case, we need to strip off credentials first before we guess scheme based on the host name! Assisted-by: Jay Satiro Fixes #4856 Closes #4857
* global_init: move the IPv6 works status bool to multi handleDaniel Stenberg2020-01-281-2/+0
| | | | | | | | | Previously it was stored in a global state which contributed to curl_global_init's thread unsafety. This boolean is now instead figured out in curl_multi_init() and stored in the multi handle. Less effective, but thread safe. Closes #4851
* llist: removed unused Curl_llist_move()Daniel Stenberg2020-01-241-51/+1
| | | | | | (and the corresponding unit test) Closes #4842
* smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev2020-01-217-1/+320
| | | | | | | | Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
* curl: Let -D merge headers in one file againEmil Engler2020-01-215-0/+20
| | | | | Closes #4762 Fixes #4753
* HTTP: increase EXPECT_100_THRESHOLD to 1Mb加藤郁之2020-01-207-12/+9
| | | | | | Mentioned: https://curl.haxx.se/mail/lib-2020-01/0050.html Closes #4814
* 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