summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* include: curl/system.h is a run-time version of curlbuild.hbagder/include-runtimeDaniel Stenberg2017-03-314-2/+137
| | | | | | | | | | | | | | | | | | | system.h is aimed to replace curlbuild.h at a later point in time when we feel confident system.h works sufficiently well. curl/system.h is currently used in parallel with curl/curlbuild.h curl/system.h determines a data sizes, data types and include file status based on available preprocessor defines instead of getting generated at build-time. This, in order to avoid relying on a build-time generated file that makes it complicated to do 32 and 64 bit bields from the same installed set of headers. Test 1541 verifies that system.h comes to the same conclusion that curlbuild.h offers. At a future point when we feel confident system.h is works fairly well, we remove curlbuild.h.
* pause: handle mixed types of data when pausedDaniel Stenberg2017-03-284-0/+191
| | | | | | | | | | | | When receiving chunked encoded data with trailers, and the write callback returns PAUSE, there might be both body and header to store to resend on unpause. Previously libcurl returned error for that case. Added test case 1540 to verify. Reported-by: Stephen Toub Fixes #1354 Closes #1357
* http: Fix proxy connection reuse with basic-authIsaac Boukris2017-03-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using basic-auth, connections and proxy connections can be re-used with different Authorization headers since it does not authenticate the connection (like NTLM does). For instance, the below command should re-use the proxy connection, but it currently doesn't: curl -v -U alice:a -x http://localhost:8181 http://localhost/ --next -U bob:b -x http://localhost:8181 http://localhost/ This is a regression since refactoring of ConnectionExists() as part of: cb4e2be7c6d42ca0780f8e0a747cecf9ba45f151 Fix the above by removing the username and password compare when re-using proxy connection at proxy_info_matches(). However, this fix brings back another bug would make curl to re-print the old proxy-authorization header of previous proxy basic-auth connection because it wasn't cleared. For instance, in the below command the second request should fail if the proxy requires authentication, but would succeed after the above fix (and before aforementioned commit): curl -v -U alice:a -x http://localhost:8181 http://localhost/ --next -x http://localhost:8181 http://localhost/ Fix this by clearing conn->allocptr.proxyuserpwd after use unconditionally, same as we do for conn->allocptr.userpwd. Also fix test 540 to not expect digest auth header to be resent when connection is reused. Signed-off-by: Isaac Boukris <iboukris@gmail.com> Closes https://github.com/curl/curl/pull/1350
* spelling fixesklemens2017-03-2633-41/+41
| | | | Closes #1356
* curl: check for end of input in writeout backslash handlingDaniel Stenberg2017-03-252-1/+36
| | | | | | Reported-by: Brian Carpenter Added test 1442 to verify
* tests/README: make "Run" section foolproofMarcel Raad2017-03-241-4/+4
| | | | | | curl must be built before building the tests. Closes https://github.com/curl/curl/pull/1352
* tests/README: mention nroff for --manual testsAnders Roxell2017-03-231-0/+1
| | | | | | Signed-off-by: Anders Roxell <anders.roxell@gmail.com> Closes #1342
* make: introduce 'test-nonflaky' targetDaniel Stenberg2017-03-221-1/+7
| | | | | Running this in the root build dir will invoke the test suite to only run tests not marked as 'flaky'.
* test2033: flakyDaniel Stenberg2017-03-221-0/+1
|
* runtests.pl: fixed display of the Gopher IPv6 port numberDan Fandrich2017-03-201-1/+1
|
* tests: fixed the documented test server port numbersDan Fandrich2017-03-201-8/+14
|
* test714/5: added HTTP as a required featureDan Fandrich2017-03-202-0/+6
| | | | | These tests use an HTTP proxy so require that curl be built with HTTP support.
* tests: strip more options from non-HTTP --libcurl testsDan Fandrich2017-03-203-18/+9
| | | | | | The CURLOPT_USERAGENT and CURLOPT_MAXREDIRS options are only set if HTTP support is available, so ignore them in tests where HTTP is not guaranteed.
* build: removed redundant DEPENDENCIES from makefilesDan Fandrich2017-03-142-4/+0
|
* test1440/1: depend on well-defined file: behaviourDan Fandrich2017-03-122-2/+10
| | | | | | | Depend on the known behaviour of URLs for nonexistent files rather than the undefined behaviour of URLs for directories (which fails on Windows). The test isn't about file: URLs at all, so the URL used doesn't really matter.
* tests: clear the SSL_CERT_FILE variable on --libcurl testsDan Fandrich2017-03-129-2/+29
| | | | | Otherwise, the contents will end up in the output and fail the verification.
* test1287: added verbose logs keywordDan Fandrich2017-03-121-0/+1
|
* tool_writeout: fixed a buffer read overrun on --write-outDan Fandrich2017-03-123-1/+63
| | | | | | | | | If a % ended the statement, the string's trailing NUL would be skipped and memory past the end of the buffer would be accessed and potentially displayed as part of the --write-out output. Added tests 1440 and 1441 to check for this kind of condition. Reported-by: Brian Carpenter
* url: add option CURLOPT_SUPPRESS_CONNECT_HEADERSDesmond O. Chang2017-03-122-0/+97
| | | | | | | | | | | | | | - Add new option CURLOPT_SUPPRESS_CONNECT_HEADERS to allow suppressing proxy CONNECT response headers from the user callback functions CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION. - Add new tool option --suppress-connect-headers to expose CURLOPT_SUPPRESS_CONNECT_HEADERS and allow suppressing proxy CONNECT response headers from --dump-header and --include. Assisted-by: Jay Satiro Assisted-by: CarloCannas@users.noreply.github.com Closes https://github.com/curl/curl/pull/783
* http_proxy: Ignore TE and CL in CONNECT 2xx responsesJay Satiro2017-03-112-1/+91
| | | | | | | | | | | | | | | | A client MUST ignore any Content-Length or Transfer-Encoding header fields received in a successful response to CONNECT. "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 Prior to this change such a case would cause an error. In some ways this bug appears to be a regression since c50b878. Prior to that libcurl may have appeared to function correctly in such cases by acting on those headers instead of causing an error. But that behavior was also incorrect. Bug: https://github.com/curl/curl/issues/1317 Reported-by: mkzero@users.noreply.github.com
* tests: fix the authretry testsMichael Kaufmann2017-03-111-5/+0
| | | | | | | Do not call curl_easy_reset() between the requests, because the auth state must be preserved for these tests. Follow-up to 0afbcfd
* tests: disabled 1903 nowDaniel Stenberg2017-03-091-0/+2
| | | | | | | | | Test 1903 is doing HTTP pipelining, and that is a timing and ordering sensitive operation and this fails far too often on the Travis CI leading to people more or less ignoring test failures there. Not good. The end of pipelning is probably coming sooner rather than later anyway...
* test1260: added http as a required featureDan Fandrich2017-03-081-0/+3
|
* gitignore: Ignore man page dist filesSteve Brokenshire2017-03-071-0/+1
| | | | Ignore man page dist files generated by scripts/updatemanpages.pl
* Makefile.am: Remove distribution man pages when running 'make clean'Steve Brokenshire2017-03-071-1/+2
|
* test1260: removed errant XML tagDan Fandrich2017-03-061-1/+0
|
* URL: return error on malformed URLs with junk after port numberDaniel Stenberg2017-03-062-0/+35
| | | | | | | | | | | | | | | | | ... because it causes confusion with users. Example URLs: "http://[127.0.0.1]:11211:80" which a lot of languages' URL parsers will parse and claim uses port number 80, while libcurl would use port number 11211. "http://user@example.com:80@localhost" which by the WHATWG URL spec will be treated to contain user name 'user@example.com' but according to RFC3986 is user name 'user' for the host 'example.com' and then port 80 is followed by "@localhost" Both these formats are now rejected, and verified so in test 1260. Reported-by: Orange Tsai
* tests: fixed a typo in some commentsDan Fandrich2017-03-043-3/+3
|
* tests: enable HTTP/2 tests to run with non-default port numbersDan Fandrich2017-02-272-1/+10
|
* test1139: allow for the possibility that the man page is not rebuiltDan Fandrich2017-02-261-1/+2
| | | | | | | This is likely to be the case when building from a tar ball release package which includes a prebuilt man page. In that case, test the packaged man page instead. This only makes a difference when building out-of-tree (in-tree, the location in both cases is identical).
* tests: use consistent environment variables for setting charsetDan Fandrich2017-02-255-12/+28
| | | | | | | | | | | | | | | | | | The character set in POSIX is set by the locale defined by (in decreasing order of precedence) the LC_ALL, LC_CTYPE and LANG environment variables (CHARSET was used by libidn but not libidn2). LC_ALL is cleared to ensure that LC_CTYPE takes effect, but LC_ALL is not used to set the locale to ensure that other parts of the locale aren't overridden. Since there doesn't seem to be a cross-platform way of specifying a UTF-8 locale, and not all systems may support UTF-8, a <precheck> is used to skip the test if UTF-8 can't be verified to be available. Test 1035 was also converted to UTF-8 for consistency, as the actual character set used there is irrelevant to the test. This patch uses a different UTF-8 locale than the last attempt, namely en_US.UTF-8. This one has been verified on 7 different Linux and BSD distributions and is more complete and usable than the locale UTF-8 (on at least some systems).
* test557: explicitly use the C locale so the numeric output is as expectedDan Fandrich2017-02-251-0/+4
|
* Revert "tests: use consistent environment variables for setting charset"Daniel Stenberg2017-02-245-28/+7
| | | | | | | This reverts commit ecd1d020abdae3c3ce3643ddab3106501e62e7c0. That commit caused test failures on my Debian Linux machine for all changed test cases. We need to reconsider how that should get done.
* tests: use consistent environment variables for setting charsetDan Fandrich2017-02-235-7/+28
| | | | | | | | | | | | | Character set in POSIX is set by the locale defined (in decreasing order of precedence) by the LC_ALL, LC_CTYPE and LANG environment variables (I believe CHARSET is only historic). LC_ALL is cleared to ensure that LC_CTYPE takes effect, but LC_ALL is not used to set the locale to ensure that other parts of the locale aren't overriden, if set. Since there doesn't seem to be a cross-platform way of specifying a UTF-8 locale, and not all systems may support UTF-8, a <precheck> is used (where relevant) to skip the test if UTF-8 isn't in use. Test 1035 was also converted to UTF-8 for consistency, as the actual character set used there is irrelevant to the test.
* tests: Set CHARSET & LANG to UTF-8 in 1035, 2046 and 2047İsmail Dönmez2017-02-233-1/+4
| | | | | Closes #1283 Fixes #1277
* digest_sspi: Fix nonce-count generation in HTTP digestMax Khon2017-02-202-1/+111
| | | | | | | | | | | | | - on the first invocation: keep security context returned by InitializeSecurityContext() - on subsequent invocations: use MakeSignature() instead of InitializeSecurityContext() to generate HTTP digest response Bug: https://github.com/curl/curl/issues/870 Reported-by: Andreas Roth Closes https://github.com/curl/curl/pull/1251
* tests: removed the obsolete name parameterDan Fandrich2017-02-1816-16/+16
|
* proxy: fix hostname resolution and IDN conversionMichael Kaufmann2017-02-186-3/+261
| | | | | | | | | | | Properly resolve, convert and log the proxy host names. Support the "--connect-to" feature for SOCKS proxies and for passive FTP data transfers. Follow-up to cb4e2be Reported-by: Jay Satiro Fixes https://github.com/curl/curl/issues/1248
* http: fix missing 'Content-Length: 0' while negotiating authIsaac Boukris2017-02-173-1/+187
| | | | | | | | | | | | | | | | - While negotiating auth during PUT/POST if a user-specified Content-Length header is set send 'Content-Length: 0'. This is what we do already in HTTPREQ_POST_FORM and what we did in the HTTPREQ_POST case (regression since afd288b). Prior to this change no Content-Length header would be sent in such a case. Bug: https://curl.haxx.se/mail/lib-2017-02/0006.html Reported-by: Dominik Hölzl Closes https://github.com/curl/curl/pull/1242
* tool_urlglob: Allow a glob range with the same start and stopJay Satiro2017-02-152-1/+58
| | | | | | | | | For example allow ranges like [1-1] and [a-a] etc. Regression since 5ca96cb. Bug: https://github.com/curl/curl/issues/1238 Reported-by: R. Dennis Steed
* URL: only accept ";options" in SMTP/POP3/IMAP URL schemesDaniel Stenberg2017-02-102-1/+48
| | | | Fixes #1252
* test1139: Added the --manual keyword since the manual is requiredDan Fandrich2017-02-071-0/+1
|
* test552: Fix typosDaniel Gustafsson2017-02-072-1/+1
| | | | Closes https://github.com/curl/curl/pull/1245
* cmdline-opts: Fixed build and test in out of source tree buildsDan Fandrich2017-02-062-3/+4
|
* cookies: do not assume a valid domain has a dotDaniel Stenberg2017-01-272-2/+56
| | | | | | | | | | | This repairs cookies for localhost. Non-PSL builds will now only accept "localhost" without dots, while PSL builds okeys everything not listed as PSL. Added test 1258 to verify. This was a regression brought in a76825a5efa6b4
* sws: use SOCKERRNO, not errnoDaniel Stenberg2017-01-191-1/+1
| | | | Reported-by: Gisle Vanem
* http2: disable server push if not requestedAlessandro Ghedini2017-01-152-2/+2
| | | | Ref: https://github.com/curl/curl/pull/1160
* url: --noproxy option overrides NO_PROXY environment variableERAMOTO Masaya2017-01-137-0/+320
| | | | | | | | | Under condition using http_proxy env var, noproxy list was the combination of --noproxy option and NO_PROXY env var previously. Since this commit, --noproxy option overrides NO_PROXY environment variable even if use http_proxy env var. Closes #1140
* url: Fix NO_PROXY env var to work properly with --proxy option.ERAMOTO Masaya2017-01-135-1/+209
| | | | | | | | | | | The combination of --noproxy option and http_proxy env var works well both for proxied hosts and non-proxied hosts. However, when combining NO_PROXY env var with --proxy option, non-proxied hosts are not reachable while proxied host is OK. This patch allows us to access non-proxied hosts even if using NO_PROXY env var with --proxy option.
* url: Fix parsing for when 'file' is the default protocolJay Satiro2017-01-124-2/+87
| | | | | | | | | | | | | | | | | | | | | | | | Follow-up to 3463408. Prior to 3463408 file:// hostnames were silently stripped. Prior to this commit it did not work when a schemeless url was used with file as the default protocol. Ref: https://curl.haxx.se/mail/lib-2016-11/0081.html Closes https://github.com/curl/curl/pull/1124 Also fix for drive letters: - Support --proto-default file c:/foo/bar.txt - Support file://c:/foo/bar.txt - Fail when a file:// drive letter is detected and not MSDOS/Windows. Bug: https://github.com/curl/curl/issues/1187 Reported-by: Anatol Belski Assisted-by: Anatol Belski