summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* http: strip default port from URL sent to proxyDaniel Stenberg2021-03-231-1/+1
| | | | | | | | | | To make sure the Host: header and the URL provide the same authority portion when sent to the proxy, strip the default port number from the URL if one was provided. Reported-by: Michael Brown Fixes #6769 Closes #6778
* ftpserver: only load the preprocessed test fileDaniel Stenberg2021-03-191-12/+6
| | | | | | We always preprocess and tests are no longer sensible to load "raw" Closes #6738
* tests: use %TESTNUMBER instead of fixed numberDaniel Stenberg2021-03-191292-4389/+4386
| | | | | | | This makes the tests easier to copy and relocate to other test numbers without having to update content. Closes #6738
* http: make 416 not fail with resume + CURLOPT_FAILONERRRORDaniel Stenberg2021-03-174-21/+102
| | | | | | | | | | | | | When asked to resume a download, libcurl will convert that to HTTP logic and if then the entire file is already transferred it will result in a 416 response from the HTTP server. With CURLOPT_FAILONERRROR set in that scenario, it should *not* lead to an error return. Updated test 1156, added test 1273 Reported-by: Jonathan Watt Fixes #6740 Closes #6753
* gen.pl: quote "bare" minuses in the nroff curl.1Daniel Stenberg2021-03-141-5/+13
| | | | | | Reported-by: Alejandro Colomar Fixes #6698 Closes #6722
* test220/314: adjust to run with HyperDaniel Stenberg2021-03-112-0/+16
|
* test306: make it not run with HyperDaniel Stenberg2021-03-111-0/+1
| | | | ... as it tests HTTP/0.9 which Hyper doesn't support.
* test304: header CRLF cleanup to work with HyperDaniel Stenberg2021-03-111-1/+1
|
* FTP: allow SIZE to fail when doing (resumed) uploadDaniel Stenberg2021-03-112-1/+52
| | | | | | | | | Added test 362 to verify. Reported-by: Jordan Brown Regression since 7ea2e1d0c5a7f (7.73.0) Fixes #6715 Closes #6725
* configure: provide Largefile feature for curl-configDaniel Stenberg2021-03-111-2/+2
| | | | | | ... as cmake now does it correctly, and make test1014 check for it Closes #6702
* lib1536: check ptr against NULL before dereferencing itkokke2021-03-101-1/+1
| | | | Closes #6710
* lib1537: check ptr against NULL before dereferencing itkokke2021-03-101-1/+1
| | | | | Fixes #6707 Closes #6708
* runtests.pl: kill processes locking test log filesMarc Hoersken2021-03-012-7/+55
| | | | | | | | | | | | | | Introduce a new runtests.pl command option: -rm For now only required and implemented for Windows. Ignore stunnel logs due to long running processes. Requires Sysinternals handle[64].exe to be on PATH. Reviewed-by: Jay Satiro Ref: #6058 Closes #6179
* pathhelp.pm: fix use of pwd -L in Msys environmentMarc Hoersken2021-03-011-3/+25
| | | | | | | | | While Msys2 has a pwd binary which supports -L, Msys1 only has a shell built-in with that feature. Reviewed-by: Jay Satiro Part of #6179
* tool_help: Increase space between option and descriptionJay Satiro2021-02-283-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Increase the minimum number of spaces between the option and the description from 1 to 2. Before: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ After: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ Closes https://github.com/curl/curl/pull/6674
* cookies: Support multiple -b parametersDaniel Gustafsson2021-02-252-4/+8
| | | | | | | | | | Previously only a single -b cookie parameter was supported with the last one winning. This adds support for supplying multiple -b params to have them serialized semicolon separated. Both cookiefiles and cookies can be entered multiple times. Closes #6649 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* test1188: Check for --fail HTTP statusJay Satiro2021-02-201-6/+15
| | | | | | | | | | | | | | | - Change the test to check for curl error on HTTP 404 Not Found. test1188 tests "--write-out with %{onerror} and %{urlnum} to stderr". Prior to this change it did that by specifying a non-existent host which would cause an error. ISPs may hijack DNS and resolve non-existent hosts so the test would not work if that was the case. Ref: https://en.wikipedia.org/wiki/DNS_hijacking#Manipulation_by_ISPs Ref: https://github.com/curl/curl/issues/6621 Ref: https://github.com/curl/curl/pull/6623 Closes https://github.com/curl/curl/pull/6637
* http: add support to read and store the referrer headerViktor Szakats2021-02-192-2/+5
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* test1188: change error from connect to resolve errorDaniel Stenberg2021-02-181-2/+2
| | | | | | | | | | | | Using the %NOLISTENPORT to trigger a connection failure is somewhat "risky" (since it isn't guaranteed to not be listened to) and caused occasional CI problems. This fix changes the infused error to be a more reliable one but still verifies the --write-out functionality properly - which is the purpose of this test. Reported-by: Jay Satiro Fixes #6621 Closes #6623
* http: use credentials from transfer, not connectionDaniel Stenberg2021-02-133-4/+61
| | | | | | | | | | | | | | | | | | | HTTP auth "accidentally" worked before this cleanup since the code would always overwrite the connection credentials with the credentials from the most recent transfer and since HTTP auth is typically done first thing, this has not been an issue. It was still wrong and subject to possible race conditions or future breakage if the sequence of functions would change. The data.set.str[] strings MUST remain unmodified exactly as set by the user, and the credentials to use internally are instead set/updated in state.aptr.* Added test 675 to verify different credentials used in two requests done over a reused HTTP connection, which previously behaved wrongly. Fixes #6542 Closes #6545
* test433: clear some home dir env variablesDaniel Stenberg2021-02-121-0/+2
| | | | | | | | | | Follow-up to bd6b54ba1f55b5 ... so that XDG_CONFIG_HOME is the only home dir variable set and thus used correctly in the test! Fixes #6599 Closes #6600
* urldata: don't touch data->set.httpversion at run-timeDaniel Stenberg2021-02-122-1/+58
| | | | | | | | | Rename it to 'httpwant' and make a cloned field in the state struct as well for run-time updates. Also: refuse non-supported HTTP versions. Verified with test 129. Closes #6585
* tests: disable .curlrc in more environmentsViktor Szakats2021-02-111-0/+2
| | | | | | | | | by also setting CURL_HOME and XDG_CONFIG_HOME envvars to the local directory. Reviewed-by: Daniel Stenberg Fixes #6595 Closes #6596
* curl: add --fail-with-bodyDaniel Stenberg2021-02-115-3/+128
| | | | | | | | Prevent both --fail and --fail-with-body on the same command line. Verify with test 349, 360 and 361. Closes #6449
* tests: Fix tests failing due to change in curl --helpJay Satiro2021-02-102-2/+2
| | | | | | | Follow-up to parent 3183217 which added add missing <mode> argument to --create-file-mode <mode>. Ref: https://github.com/curl/curl/issues/6590
* server: remove redundant conditionMarcel Raad2021-02-102-2/+0
| | | | | | `end` is always non-null here. Closes https://github.com/curl/curl/pull/6576
* mqttd: remove unused variableMarcel Raad2021-02-101-2/+0
| | | | Closes https://github.com/curl/curl/pull/6576
* tests: reduce variable scopesMarcel Raad2021-02-102-7/+4
| | | | Closes https://github.com/curl/curl/pull/6576
* ftp: add 'list_only' to the transfer state structDaniel Stenberg2021-02-092-1/+74
| | | | | | | | | and rename it from 'ftp_list_only' since it is also used for SSH and POP3. The state is updated internally for 'type=D' FTP URLs. Added test case 1570 to verify. Closes #6578
* ftp: add 'prefer_ascii' to the transfer state structDaniel Stenberg2021-02-094-2/+124
| | | | | | | | | | | ... and make sure the code never updates 'set.prefer_ascii' as it breaks handle reuse which should use the setting as the user specified it. Added test 1569 to verify: it first makes an FTP transfer with ';type=A' and then another without type on the same handle and the second should then use binary. Previously, curl failed this. Closes #6578
* lib: use int type for more port variablesJay Satiro2021-02-092-2/+2
| | | | | | | This is a follow-up to 764c6bd. Prior to that change port variables were usually type long. Closes https://github.com/curl/curl/pull/6553
* tool_writeout: refactor write-out and write-out jsonJay Satiro2021-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | - Deduplicate the logic used by write-out and write-out json. Rather than have separate writeLong, writeString, etc, logic for each of write-out and write-out json instead have respective shared functions that can output either format and a 'use_json' parameter to indicate whether it is json that is output. This will make it easier to maintain. Rather than have to go through two sets of logic now we only have to go through one. - Support write-out %{errormsg} and %{exitcode} in json. - Clarify in the doc that %{exitcode} is the exit code of the transfer. Prior to this change it just said "The numerical exitcode" which implies it's the exit code of the tool, and it's not necessarily that. Closes https://github.com/curl/curl/pull/6544
* file: Support unicode urls on windowsStephan Szabo2021-02-094-1/+52
| | | | Closes https://github.com/curl/curl/pull/6501
* tests/server: Bump MAX_TAG_LEN to 200Fabian Keil2021-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for tests containing HTML inside of <data> sections. For <img> tags it's not uncommon to be longer than the previous limit of 79 bytes. An example of a previously problem-causing tag is: <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31"> which is needed for a Privoxy test for the banners-by-size filter. Previously it caused server failures like: 12:29:05.786961 ====> Client connect 12:29:05.787116 accept_connection 3 returned 4 12:29:05.787194 accept_connection 3 returned 0 12:29:05.787285 Read 119 bytes 12:29:05.787345 Process 119 bytes request 12:29:05.787407 Got request: GET /banners-by-size/9 HTTP/1.1 12:29:05.787464 Requested test number 9 part 0 12:29:05.787686 getpart() failed with error: -2 12:29:05.787744 - request found to be complete (9) 12:29:05.787912 getpart() failed with error: -2 12:29:05.788048 Wrote request (119 bytes) input to log/server.input 12:29:05.788157 Send response test9 section <data> 12:29:05.788443 getpart() failed with error: -2 12:29:05.788498 instructed to close connection after server-reply 12:29:05.788550 ====> Client disconnect 0 12:29:05.871448 exit_signal_handler: 15 12:29:05.871714 signalled to die 12:29:05.872040 ========> IPv4 sws (port 21108 pid: 51758) exits with signal (15)
* tests/badsymbols.pl: when opening '$incdir' fails include it in the error ↵Fabian Keil2021-02-091-1/+1
| | | | message
* runtests.1: document -o, -P, -L, and -EFabian Keil2021-02-091-1/+22
|
* runtests.pl: add %TESTNUMBER variable to make copying tests more convenientFabian Keil2021-02-094-5/+56
|
* runtests.pl: add an -o option to change internal variablesFabian Keil2021-02-091-0/+10
| | | | | | | | | runtests.pl has lots of internal variables one might want to change in certain situations, but adding a dedicated option for every single one of them isn't practical. Usage: ./runtests.pl -o TESTDIR=$privoxy_curl_test_dir -o HOSTIP=10.0.0.1 ...
* runtests.pl: cleanupsFabian Keil2021-02-091-27/+36
| | | | | | | | | | - show the summarized test result in the last line of the report - do not use $_ after mapping it to a named variable Doing that makes the code harder to follow. - log the restraints sorted by the number of their occurrences - fix language when logging restraints that only occured once - let runhttpserver() use $TESTDIR instead of $srcdir ... so it works if a non-default $TESTDIR is being used.
* runtests.pl: add an -E option to specify an exclude fileFabian Keil2021-02-094-1/+90
| | | | | | | | | | | | | | | | | | | | | It can contain additional restraints for test numbers, keywords and tools. The idea is to let third parties like the Privoxy project distribute an exclude file with their tarballs that specifies which curl tests are not expected to work when using Privoxy as a proxy, without having to fork the whole curl test suite. The syntax could be changed to be extendable and maybe more closely reflect the "curl test" syntax. Currently it's a bunch of lines like these: test:$TESTNUMBER:Reason why this test with number $TESTNUMBER should be skipped keyword:$KEYWORD:Reason why tests whose keywords contain the $KEYWORD should be skipped tool:$TOOL:Reason why tests with tools that contain $TOOL should be skipped To specify multiple $TESTNUMBERs, $KEYWORDs and $TOOLs on a single line, split them with commas.
* runtests.pl: add -L parameter to require additional perl librariesFabian Keil2021-02-093-1/+42
| | | | | | | | | | This is useful to change the behaviour of the script without having to modify the file itself, for example to use a custom compareparts() function that ignores header differences that are expected to occur when an external proxy is being used. Such differences are proxy-specific and thus the modifications should be maintained together with the proxy.
* runtests.pl: add a -P option to specify an external proxyFabian Keil2021-02-091-0/+35
| | | | | | | | | | | | ... that should be used when executing the tests. The assumption is that the proxy is an HTTP proxy. This option should be used together with -L to provide a customized compareparts() version that knows which proxy-specific header differences should be ignored. This option doesn't work for all test types yet.
* tests: fixup several testsFabian Keil2021-02-09430-779/+787
| | | | | | | | | | | | | | missing CRs and modified %hostip lib556/test556: use a real HTTP version to make test reuse more convenient make sure the weekday in Date headers matches the date test61: replace stray "^M" (5e 4d) at the end of a cookie with a '^M' (0d) Gets the test working with external proxies like Privoxy again. Closes #6463
* ftp: avoid SIZE when asking for a TYPE A fileDaniel Stenberg2021-02-048-62/+5
| | | | | | | | | | | ... as we ignore it anyway because servers don't report the correct size and proftpd even blatantly returns a 550. Updates a set of tests accordingly. Reported-by: awesomenode on github Fixes #6564 Closes #6565
* copyright: fix year ranges in need of updatesDaniel Stenberg2021-02-034-4/+4
|
* http: improve AWS HTTP v4 Signature authDmitry Wagin2021-01-3010-8/+409
| | | | | | | | | | | | | | | | | | - Add support services without region and service prefixes in the URL endpoint (ex. Min.IO, GCP, Yandex Cloud, Mail.Ru Cloud Solutions, etc) by providing region and service parameters via aws-sigv4 option. - Add [:region[:service]] suffix to aws-sigv4 option; - Fix memory allocation errors. - Refactor memory management. - Use Curl_http_method instead() STRING_CUSTOMREQUEST. - Refactor canonical headers generating. - Remove repeated sha256_to_hex() usage. - Add some docs fixes. - Add some codestyle fixes. - Add overloaded strndup() for debug - curl_dbg_strndup(). - Update tests. Closes #6524
* copyright: fix missing year (range) updatesDaniel Stenberg2021-01-291-1/+1
|
* tool_writeout: make %{errormsg} blank for no errorsDaniel Stenberg2021-01-281-1/+1
| | | | Closes #6539
* test410: fix for windowsJay Satiro2021-01-251-1/+4
| | | | | | | | | | - Pass the very long request header via file instead of command line. Prior to this change the 49k very long request header string was passed via command line and on Windows that is too long so it was truncated and the test would fail (specifically msys CI). Closes https://github.com/curl/curl/pull/6516
* hostip: remove conn->data from resolver functionsDaniel Stenberg2021-01-221-1/+1
| | | | | | | This also moves the 'async' struct from the connectdata struct into the Curl_easy struct, which seems like a better home for it. Closes #6497