aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-03-02mime: do not perform more than one read in a rowPatrick Monnerat
Input buffer filling may delay the data sending if data reads are slow. To overcome this problem, file and callback data reads do not accumulate in buffer anymore. All other data (memory data and mime framing) are considered as fast and still concatenated in buffer. As this may highly impact performance in terms of data overhead, an early end of part data check is added to spare a read call. When encoding a part's data, an encoder may require more bytes than made available by a single read. In this case, the above rule does not apply and reads are performed until the encoder is able to deliver some data. Tests 643, 644, 645, 650 and 654 have been adapted to the output data changes, with test data size reduced to avoid the boredom of long lists of 1-byte chunks in verification data. New test 664 checks mimepost using single-byte read callback with encoder. New test 665 checks the end of part data early detection. Fixes #4826 Reported-by: MrdUkk on github
2020-03-02mime: latch last read callback status.Patrick Monnerat
In case a read callback returns a status (pause, abort, eof, error) instead of a byte count, drain the bytes read so far but remember this status for further processing. Takes care of not losing data when pausing, and properly resume a paused mime structure when requested. New tests 670-673 check unpausing cases, with easy or multi interface and mime or form api. Fixes #4813 Reported-by: MrdUkk on github Closes #4833
2020-03-01unit1651: Fixed conversion compilation warningSteve Holme
371:17: warning: conversion to 'unsigned char' from 'int' may alter its value [-Wconversion] Closes #5008
2020-03-01ci/tests: Fix typo in previous commit 597cf2Marc Hoersken
2020-03-01ci/tests: Make sure that the AZURE_ACCESS_TOKEN is availableMarc Hoersken
For security reasons the access token is not available to PR builds. Therefore we should not try to use the DevOps API with an empty token.
2020-02-29runtests: fix output to command logJay Satiro
- Record only the command of the most recently ran test in the command log. This is a follow-up to 02988b7 from several weeks ago which fixed writing to the command log, however it saved all commands for all tests instead of just the most recently ran test as we would now expect. Fixes https://github.com/curl/curl/commit/02988b7#commitcomment-37546876 Closes https://github.com/curl/curl/pull/5001
2020-02-29ci/tests: Send test results to Azure DevOps for reportingMarc Hoersken
2020-02-27tests: fix Python 3 compatibility of smbserver.pyMarc Hoersken
2020-02-27runtests: restore the command logDaniel Stenberg
The log file with all command lines for the invoked command lines is now called logs/commands.log Fixes #4911 Closes #4989
2020-02-27http2: make pausing/unpausing set/clear local stream windowDaniel Stenberg
This reduces the HTTP/2 window size to 32 MB since libcurl might have to buffer up to this amount of data in memory and yet we don't want it set lower to potentially impact tranfer performance on high speed networks. Requires nghttp2 commit b3f85e2daa629 (https://github.com/nghttp2/nghttp2/pull/1444) to work properly, to end up in the next release after 1.40.0. Fixes #4939 Closes #4940
2020-02-27tests: Automatically deduce the tool name from the test case for unit testsSteve Holme
It is still possible to override the executable to run during the test, using the <tool> tag, but this patch removes the requirement that the tag must be present for unit tests. It also removes the possibility of human error when existing test cases are used as the basis for new tests, as recently witnessed in 81c37124. Reviewed-by: Daniel Stenberg Closes #4976
2020-02-27test1323: Added the missing 'unit test' feature requirement in the test caseSteve Holme
2020-02-26http: added 417 response treatmentDaniel Stenberg
When doing a request with a body + Expect: 100-continue and the server responds with a 417, the same request will be retried immediately without the Expect: header. Added test 357 to verify. Also added a control instruction to tell the sws test server to not read the request body if Expect: is present, which the new test 357 uses. Reported-by: bramus on github Fixes #4949 Closes #4964
2020-02-26smtp: Support the SMTPUTF8 extension for the EXPN commandSteve Holme
Simply notify the server we support the SMTPUTF8 extension if it does.
2020-02-26smtp: Support the SMTPUTF8 extension in the VRFY commandSteve Holme
2020-02-26smtp: Support the SMTPUTF8 extension in the RCPT TO commandSteve Holme
Note: The RCPT TO command isn't required to advertise to the server that it contains UTF-8 characters, instead the server is told that a mail may contain UTF-8 in any envelope command via the MAIL command.
2020-02-26smtp: Support the SMTPUTF8 extension in the MAIL commandSteve Holme
Support the SMTPUTF8 extension when sending mailbox information in the MAIL command (FROM and AUTH parameters). Non-ASCII domain names will be ACE encoded, if IDN is supported, whilst non-ASCII characters in the local address part are passed to the server. Reported-by: ygthien on github Fixes #4828
2020-02-26smtp: Support UTF-8 based host names in the VRFY commandSteve Holme
2020-02-26smtp: Support UTF-8 based host names in the RCPT TO commandSteve Holme
2020-02-26smtp: Support UTF-8 based host names in the MAIL commandSteve Holme
Non-ASCII host names will be ACE encoded if IDN is supported.
2020-02-25smtp: Added UTF-8 mailbox tests to verify existing behaviourSteve Holme
2020-02-24ftpserver: Updated VRFY_smtp() so the response isn't necessary in the test caseSteve Holme
2020-02-24ftpserver: Corrected the e-mail address regex in MAIL_smtp() and RCTP_smtp()Steve Holme
The dot character between the host and the tld was not being escaped, which meant it specified a match of 'any' character rather than an explicit dot separator. Additionally removed the dot character from the host name as it allowed the following to be specified as a valid address in our test cases: <bad@example......com> Both are typos from 98f7ca7 and 8880f84 :( I can't remember whether my intention was to allow sub-domains to be specified in the host or not with these additional dots, but by placing it outside of the host means it can only be specified once per domain and by placing a + after the new grouping support for sub-domains is kept. Closes #4912
2020-02-24hmac: Added a unit test for the HMAC hash generationSteve Holme
Closes #4973
2020-02-23tests: Added a unit test for MD4 digest generationSteve Holme
Closes #4970
2020-02-23test1610: Fixed the link to the unit testSteve Holme
Typo from 81c37124.
2020-02-23md5/sha256: Updated the functions to allow non-string data to be hashedSteve Holme
2020-02-22tests: Added a unit test for SHA256 digest generationSteve Holme
Follow up to 2b5b37c. Closes #4968
2020-02-18altsvc: make saving the cache an atomic operationDaniel Stenberg
... by writing the file to temp name then rename to the final when done. Assisted-by: Jay Satiro Fixes #4936 Closes #4942
2020-02-09altsvc: keep a copy of the file name to survive handle resetDaniel Stenberg
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
2020-02-07digest: Do not quote algorithm in HTTP authorisationPierre-Yves Bigourdan
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
2020-02-07ftp: remove superfluous checking for crlf in user or pwdDaniel Stenberg
... 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
2020-02-02cleanup: fix typos and wording in docs and commentsPedro Monreal
Closes #4869 Reviewed-by: Emil Engler and Daniel Gustafsson
2020-01-28urlapi: guess scheme correct even with credentials givenDaniel Stenberg
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
2020-01-28global_init: move the IPv6 works status bool to multi handleDaniel Stenberg
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
2020-01-24llist: removed unused Curl_llist_move()Daniel Stenberg
(and the corresponding unit test) Closes #4842
2020-01-21smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev
Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
2020-01-21curl: Let -D merge headers in one file againEmil Engler
Closes #4762 Fixes #4753
2020-01-20HTTP: increase EXPECT_100_THRESHOLD to 1Mb加藤郁之
Mentioned: https://curl.haxx.se/mail/lib-2020-01/0050.html Closes #4814
2020-01-13curl: make #0 not output the full URLDaniel Stenberg
It was not intended nor documented! Added test 1176 to verify. Reported-by: vshmuk on hackerone Closes #4812
2020-01-11ngtcp2: Add an error code for QUIC connection errorsEmil Engler
- 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
2020-01-11multi: Change curl_multi_wait/poll to error on negative timeoutJay Satiro
- 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
2020-01-09test1167: verify global symbols in public headers are curl prefixedDaniel Stenberg
... using the new badsymbols.pl perl script Fixes #4793 Closes #4794
2020-01-09libtest/mk-lib1521: adapt to new public header layoutDaniel Stenberg
2020-01-09runtests: make random seed fixed for a monthDaniel Stenberg
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
2020-01-06TrackMemory tests: always remove CR before LFMarcel Raad
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
2020-01-06curl -w: handle a blank input file correctlyDaniel Stenberg
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
2020-01-04curl: properly free mimepost dataDaniel Stenberg
... as it could otherwise leak memory when a transfer failed. Added test 1293 to verify. Reported-by: Brian Carpenter Fixes #4781 Closes #4782
2020-01-03tests: Fix bounce requests with truncated writesMarc Aldorasi
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
2019-12-31tests: Change NTLM tests to require SSLJay Satiro
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