Commit Graph

3246 Commits

Author SHA1 Message Date
Dan Fandrich ce6c691da1 test1398: Added test to Makefile.am 2014-06-15 12:28:43 +02:00
Daniel Stenberg e95ca7cec9 NTLM: set a fake entropy for debug builds with CURL_ENTROPY set
Curl_rand() will return a dummy and repatable random value for this
case. Makes it possible to write test cases that verify output.

Also, fake timestamp with CURL_FORCETIME set.

Only when built debug enabled of course.

Curl_ssl_random() was not used anymore so it has been
removed. Curl_rand() is enough.

create_digest_md5_message: generate base64 instead of hex string

curl_sasl: also fix memory leaks in some OOM situations
2014-06-11 23:15:48 +02:00
Steve Holme ceacbacd14 tests: Disabled NTLM tests for non-debug builds
Added required "debug" feature, missed in commit 1c9aaa0bac, as NTLMv2
calls Curl_rand() which can only be fixed to a specific entropy in
debug builds.
2014-06-11 21:24:59 +01:00
Steve Holme 51bb067a42 Curl_rand: Use a fake entropy for debug builds when CURL_ENTROPY set 2014-06-11 21:13:40 +01:00
Steve Holme e8c1bf8840 tests: Fixed up DIGEST-MD5 tests following commit eefeb73af4 2014-06-01 12:18:05 +01:00
Dan Fandrich 9597b0ebcb tests: Fix portability issue with the tftpd server and timeouts
gcc spit out warning: variable 'x' might be clobbered by 'longjmp' or
'vfork' messages for a few variables.  These automatic variables were
expected to be changed between a setjmp/longjmp and hold their values,
so are now marked volatile.
2014-05-29 09:39:39 +02:00
Daniel Stenberg 71ea31ae74 test1014: GSS-API is only in curl-config. not in curl
Follow-up to commit 121bcfee5d. curl-config --features now lists
GSS-API but it is not a listed feature in curl -V. This should probably
be synchronized.
2014-05-18 17:07:29 +02:00
Daniel Stenberg 313b274b9d test1134: verify CREDSPERREQUEST for HTTP
Verifies that the change in 68f0166a92 works as intended and that
different HTTP auth credentials to the same host still re-uses the
connection properly.
2014-05-18 16:55:03 +02:00
Daniel Stenberg 84bd19ffd4 timers: fix timer regression involving redirects / reconnects
In commit 0b3750b5c2 (released in 7.36.0) we fixed a timeout issue
but instead broke the timings.

To fix this, I introduce a new timestamp to use for the timeouts and
restored the previous timestamp and timestamp position so that the old
timer functionality is restored.

In addition to that, that change also broke connection timeouts for when
more than one connect was used (as it would then count the total time
from the first connect and not for the most recent one). Now
Curl_timeleft() has been modified so that it checks against different
start times depending on which timeout it checks.

Test 1303 is updated accordingly.

Bug: http://curl.haxx.se/mail/lib-2014-05/0147.html
Reported-by: Ryan Braud
2014-05-15 21:28:19 +02:00
Steve Holme 18e4cd1e20 tests: Fixed up DIGEST-MD5 tests following commit 8342b6e1dc 2014-05-11 16:20:52 +01:00
Daniel Stenberg 22ee67a1ca lib1506: make sure the transfers are not within the same ms
Just to make sure the test is properly repeatable.

Bug: http://curl.haxx.se/mail/lib-2014-05/0081.html
Reported-by: Henrik
2014-05-09 16:50:42 +02:00
Daniel Stenberg 9e4f6c5809 libtests: add a wait_ms() function
This allows a libcurl test to portably sleep for a given number of
milliseconds.
2014-05-09 16:50:42 +02:00
Dan Fandrich f0b2d27f7d test87: Get rid of extraneous square brackets in tag 2014-05-09 11:04:30 +02:00
Dan Fandrich e673f55c45 tests: Use standard libtest return codes when relevant 2014-05-05 15:30:05 +02:00
Dan Fandrich 40e6af893b test1513: Don't return an uninitialized variable on init failure 2014-05-05 15:29:23 +02:00
Daniel Stenberg 812da4190f mprintf: allow %.s with data not being zero terminated
If the precision is indeed shorter than the string, don't strlen() to
find the end because that's not how the precision operator works.

I also added a unit test for curl_msnprintf to make sure this works and
that the fix doesn't a few other basic use cases. I found a POSIX
compliance problem that I marked TODO in the unit test, and I figure we
need to add more tests in the future.

Reported-by: Török Edwin
2014-05-04 23:39:52 +02:00
Dan Fandrich c303107345 test585: Fixed NULL pointer dereference in fopen 2014-05-01 11:00:30 +02:00
Steve Holme 78ca3c6830 copyright: Updated following recent edits 2014-04-28 23:20:52 +01:00
Dan Fandrich a917f30c6b runtests.pl: Improved the check for a crash during torture tests 2014-04-29 00:06:32 +02:00
Dan Fandrich ef1322df67 Added a few more const where possible 2014-04-29 00:05:19 +02:00
Dan Fandrich 970ce28c12 unit1395: Fixed null pointer dereference on torture test 2014-04-28 17:14:46 +02:00
Daniel Stenberg 2e57c7e0fc test325: verify --proto-redir https=>http 2014-04-23 22:36:01 +02:00
Dan Fandrich c1d6158789 tests: Fixed torture test for tests 1526 & 1527 2014-04-22 22:43:57 +02:00
Marc Hoersken 42c04eb1d1 sockfilt.c: clean up threaded approach and add documentation 2014-04-22 17:22:42 +02:00
Marc Hoersken 6fd97fca88 sockfilt.c: zero initialize variable 2014-04-22 17:22:42 +02:00
Marc Hoersken 6a03f6368f sockfilt.c: fixed getting stuck waiting for MinGW stdin pipe 2014-04-22 17:22:41 +02:00
Marc Hoersken 8ce852a279 sockfilt.c: properly handle disk files, pipes and character input 2014-04-20 22:15:36 +02:00
Marc Hoersken fe1c0176c1 sockfilt.c: ignore non-key-events and continue waiting for input 2014-04-20 18:26:24 +02:00
Marc Hoersken eb01947e1d sockfilt.c: free memory in case of memory allocation errors 2014-04-20 18:22:28 +02:00
Steve Holme 4c8c3da6e2 test810: Updated to use new IMAP URL query string functionality 2014-04-18 16:51:50 +01:00
Steve Holme 5cdb61abb2 tests: Disabled DIGEST-MD5 tests when running with SSPI enabled 2014-04-06 16:32:59 +01:00
Daniel Stenberg 74851340bd PROXYHEADER: send these headers in "normal" proxy requests too
Updated the docs to clarify and the code accordingly, with test 1528 to
verify:

When CURLHEADER_SEPARATE is set and libcurl is asked to send a request
to a proxy but it isn't CONNECT, then _both_ header lists
(CURLOPT_HTTPHEADER and CURLOPT_PROXYHEADER) will be used since the
single request is then made for both the proxy and the server.
2014-04-04 17:03:43 +02:00
Daniel Stenberg d3d27551e7 test1428: verify --proxy-header 2014-04-04 17:03:43 +02:00
Daniel Stenberg ef6be35bae CURLOPT_HEADEROPT: added
Modified the logic so that CURLOPT_HEADEROPT now controls if PROXYHEADER
is actually used or not.
2014-04-04 17:03:43 +02:00
Daniel Stenberg ac887eedbc CURLOPT_PROXYHEADER: set headers for proxy-only
Includes docs and new test cases: 1525, 1526 and 1527

Co-written-by: Vijay Panghal
2014-04-04 17:03:43 +02:00
Daniel Stenberg 42937f87e6 HTTP: don't send Content-Length: 0 _and_ Expect: 100-continue
Without request body there's no point in asking for 100-continue.

Bug: http://curl.haxx.se/bug/view.cgi?id=1349
Reported-by: JimS
2014-04-04 15:46:35 +02:00
Dan Fandrich c57166b575 tests: unified use of some keywords 2014-04-03 11:49:49 +02:00
Dan Fandrich ff35e74bcd tests: added some missing closing tags 2014-04-03 11:49:48 +02:00
Daniel Stenberg d73d633885 runtests: insist on a <keywords> section
Since all present tests now have <keywords> listed, this script will now
refuse to run a given test case if no such section is provided.
Hopefully this will help us make sure new test cases get keywords added
at start.
2014-04-03 11:33:41 +02:00
Daniel Stenberg 1432b22e62 tests: add keywords to the last 7 tests lacking them 2014-04-03 11:06:24 +02:00
Steve Holme b201d9adb8 tests: Added SMTP with credientials test when not supported by server 2014-04-01 07:19:29 +01:00
Steve Holme dd07e79023 tests: Added SMTP with credentials test for RFC-821 based server
Added SMTP (RFC-821 only) based test case as a reference for the fix
provided by commit fe260b75e7.
2014-03-31 20:55:58 +01:00
Paul Marks 0bc4938eec curl: stop interpreting IPv6 literals as glob patterns.
This makes it possible to fetch from an IPv6 literal without specifying
the -g option.  Globbing remains available elsehwere in the URL.

For example:
  curl http://[::1]/file[1-3].txt

This creates no ambiguity, because there is no overlap between the
syntax of valid globs and valid IPv6 literals.  Globs contain hyphens
and at most 1 colon, while IPv6 literals have no hyphens, and at least 2
colons.

The peek_ipv6() parser simply whitelists a set of characters and counts
colons, because the real validation happens later on.  The character set
includes A-Z, in case someone decides to implement support for scopes
like [fe80::1%25eth0] in the future.

Signed-off-by: Paul Marks <pmarks@google.com>
2014-03-30 23:45:29 +02:00
Steve Holme 4043d7b67b test938: Updated to use file input for upload
As the second URL won't be passed input from stdin.
2014-03-30 22:40:34 +01:00
Steve Holme 7dd494c6e7 test836: Fixed incorrect username in expected output 2014-03-30 22:40:21 +01:00
Daniel Stenberg fbb6e0478b DISABLED: 836, 882 and 938 hang 2014-03-30 23:36:57 +02:00
Daniel Stenberg c1f7da1570 runtests: check protocol before data
When the protocol part fails, the data usually does too but the protocol
part is often more fundamental and often provide the clues you need to
fix the test case.
2014-03-30 23:16:21 +02:00
Steve Holme acefed139f ftpserver.pl: Extended the full text reply regular expression
Extended the regex to include other valid characters such as those used
in the reply text of Test 836.
2014-03-30 22:00:04 +01:00
Daniel Stenberg 8fdb87d0df keywords: sort case insensitive 2014-03-30 17:09:11 +02:00
Daniel Stenberg c38b573ff5 tests: remove trailing CRs from keywords 2014-03-30 17:05:22 +02:00
Daniel Stenberg c09f6c72e9 keywords: sort keywords alphabetically 2014-03-30 17:04:56 +02:00
Daniel Stenberg 7dbed6a2f5 keywords: don't use STDERR for good info 2014-03-30 17:00:32 +02:00
Steve Holme afbcfc4f46 tests: Added email unit tests to verify login credential connection re-use 2014-03-30 15:13:31 +01:00
Steve Holme b3e55bf989 tests: Corrected "APOP" authentication keyword 2014-03-30 12:00:33 +01:00
Steve Holme 6876b35ad6 tests: Replaced email authentication keywords with SASL based keywords
As the email protocols implement SASL authentication rather than IMAP,
POP3 and SMTP specific authentication, updated the authentication
keywords to reflect this.
2014-03-30 11:56:42 +01:00
Steve Holme 82bcc7c615 tests: Added "Clear Text" authentication keyword 2014-03-30 11:34:23 +01:00
Steve Holme dfa481a7c5 tests: Added "SASL" authentication keyword 2014-03-30 11:31:38 +01:00
Steve Holme 54ef196db8 ftpserver.pl: Removed some unused variables 2014-03-30 10:37:45 +01:00
Steve Holme 5b773658a8 ftpserver.pl: Reworked some variable names to be more meaningful 2014-03-30 00:12:38 +00:00
Steve Holme f559611aa1 ftpserver.pl: Corrected some indentation in senddata() 2014-03-29 23:17:16 +00:00
Daniel Stenberg 713402982f lib1513: fix callback proto to silence warning 2014-03-29 23:14:42 +01:00
Steve Holme 2baf38f7c3 ftpserver.pl: Added fallback to <data> support when using multiple URLs
Added support for falling back to <data> when <data1>, <data2>, etc...
don't exist in the <reply> section of a unit test.
2014-03-29 20:50:27 +00:00
Steve Holme 8293691b88 ftpserver.pl: Updated email based get reply data code to use new method 2014-03-29 17:30:19 +00:00
Steve Holme fdb13d885a ftpserver.pl: Fixed syntax error from commit 3a29ee41 2014-03-29 12:32:03 +00:00
Steve Holme 8541f2d39d ftpserver.pl: Updated argument code in STATUS_imap() to be more meaningful 2014-03-29 11:15:19 +00:00
Steve Holme 3a29ee41ef ftpserver.pl: Introduced common method for getting a test's reply data 2014-03-29 10:29:17 +00:00
Dan Fandrich 7cb763cf57 test1397: Fixed compilation with some SSL backends
The test is only valid when one of four SSL backends is in use,
and must otherwise return success.
2014-03-26 22:08:53 +01:00
Dan Fandrich f82e0edc17 test815/816: Use authentication for both URLs
The improved connection reuse logic would otherwise create a new
connection for each one, which isn't supported by the test
server, nor expected by the test.
2014-03-26 22:06:26 +01:00
Richard J. Moore 4d06b27921 test1397: unit test for certificate name wildcard handling 2014-03-25 23:01:37 +01:00
Daniel Stenberg 2fc31dcf74 runtests.pl: verify specified test cases
To better allow arguments like "1 to 9999" without flooding the terminal
with error messages, the given test cases range is now checked and only
test numbers with existing files are actually run.
2014-03-19 23:28:28 +01:00
Dan Fandrich 4c599b9d2d tests: made the SASL modes separate keywords 2014-03-15 11:13:13 +01:00
Dan Fandrich c03243576a tests: added missing HTTP NTLM auth keywords
Also, removed an unneeded strippart
2014-03-15 10:54:49 +01:00
Dan Fandrich 02bba0ce7d tests: disable valgrind on the remaining scp/sftp tests 2014-03-15 10:41:40 +01:00
Dan Fandrich e8aff0c588 valgrind.supp: added another test 165 suppression
This one seems to come and go as the optimizer decides how best
to inline some functions.
2014-03-15 10:41:40 +01:00
Dan Fandrich 61591eee68 test640/1: add tests for --head with sftp and scp
This option is currently rather useless with these protocols
when no quote command is given, but it is valid.
2014-03-14 23:38:00 +01:00
Steve Holme 219d19a401 test96: Updated accordly for recent changes 2014-02-28 09:45:38 +00:00
Steve Holme 07d7603b45 tool: Reworked argument parsing to use --next/-:
Follow up to commit 1a9b58fcb2 to replace the : command line option
with --next and -:.
2014-02-26 20:53:23 +00:00
Dan Fandrich 3228deff40 valgrind.supp: tweaked a test 165 suppression
A recent change seems to have slightly changed the call stack
produced by the gcc optimizer.
2014-02-26 08:25:47 +01:00
Marc Hoersken b5486adc9b stunnel: regenerated self-signed test certificate with SHA1 hash
The previous test certificate contained a MD5 hash which is not
supported using TLSv1.2 with Schannel on Windows 7 or newer.

See the update to this blog post on IEInternals / MSDN:
http://blogs.msdn.com/b/ieinternals/archive/2011/03/25/
misbehaving-https-servers-impair-tls-1.1-and-tls-1.2.aspx

"Update: If the server negotiates a TLS1.2 connection with a
Windows 7 or 8 schannel.dll-using client application, and it
provides a certificate chain which uses the (weak) MD5 hash
algorithm, the client will abort the connection (TCP/IP FIN)
upon receipt of the certificate."
2014-02-22 16:49:09 +01:00
Steve Holme 873178a657 lib1515.c: Fixed #include path in commit 647f83e809 2014-02-19 20:36:36 +00:00
Maks Naumov 647f83e809 test1515: fix compilation with msvc
... or any other systems lacking a native snprintf
2014-02-19 13:50:17 +01:00
Dan Fandrich 4b4e8a5853 tests: Made the crypto test feature usable
This feature specifies the availability of cryptographic
authentication, which can be disabled at compile-time
2014-02-17 09:50:46 +01:00
Daniel Stenberg d765099813 ConnectionExists: re-use connections better
When allowing NTLM, the re-use connection logic was too focused on
finding an existing NTLM connection to use and didn't properly allow
re-use of other ones. This made the logic not re-use perfectly re-usable
connections.

Added test case 1418 and 1419 to verify.

Regression brought in 8ae35102c (curl 7.35.0)

Reported-by: Jeff King
Bug: http://thread.gmane.org/gmane.comp.version-control.git/242213
2014-02-16 14:30:02 +01:00
Marc Hoersken 013e9a11ff sockfilt.c: add undefs which are required after 6239146e 2014-02-16 11:52:48 +01:00
Dan Fandrich 89070d0e68 valgrind: added another test 165 suppression
This one is needed with the gcc options -fstack-protector-all -O2
That brings the number of suppressions for test 165 to four, and I
suspect I could find another two missing without trying very hard. I'm
beginning to think suppressions isn't the best way to handle these
kinds of cases.
2014-02-15 09:27:21 +01:00
Marc Hoersken 779afe3bbf testsuite: more Windows line-endings fixes 2014-02-15 09:19:27 +01:00
Marc Hoersken f3ce1af9fc test1114: fix line-endings checks on Windows after 75f00de 2014-02-15 09:14:36 +01:00
Marc Hoersken 3c2c1f9876 test1113: fix line-endings checks on Windows after 75f00de5 2014-02-15 09:12:59 +01:00
Marc Hoersken 8451623b45 lib1515.c: Added support for Windows using the Sleep function 2014-02-14 22:17:54 +01:00
Marc Hoersken 0a568867c0 HTTP tests: use CRLF as header seperator according to RFC 2616
Updates the test suite to handle binary-mode header output.
2014-02-14 20:12:28 +01:00
Marc Hoersken 89c29aa70f HTTP tests: use CRLF as header seperator according to RFC 2616
Changes LF to CRLF and disables automatic output conversion.
2014-02-14 20:12:27 +01:00
Marc Hoersken 75f00de55c testsuite: use binary output mode for custom curl test tools
Do not try to convert line-endings to CRLF on Windows by setting stdout
to binary mode, just like the curl tool does if --ascii is not specified.

This should prevent corrupted stdout line-ending output like CRCRLF.

In order to make the previously naive text-aware tests work with
binary mode on Windows, text-mode is disabled for them if it is not
actually part of the test case and line-endings are corrected.
2014-02-14 20:12:27 +01:00
Marc Hoersken 69745aaa45 testsuite: changed HTTP and RTSP header line-endings to CRLF
According to RFC 2616 and RFC 2326 individual protocol elements, like
headers and except the actual content, are terminated by using CRLF.

Therefore the test data files for these protocols need to contain
mixed line-endings if the actual protocol elements use CRLF while
the file uses LF.
2014-02-14 20:12:26 +01:00
Dan Fandrich 25600bdf75 valgrind: added suppression on optimized code
gcc 4.7.2 with -O2 will optimize Curl_connect by inlining some
functions two levels deep, which makes the valgrind suppression
fail to match. The underlying reason for these idna suppressions is
a gcc strlen optimization when compiling libidn; compiling it with
-fno-builtin-strlen makes this suppression unnecessary.
2014-02-14 08:48:23 +01:00
Dan Fandrich 82a4d537c3 tests: Disabled broken test 1316
See http://curl.haxx.se/mail/lib-2014-02/0004.html for a
discussion on the problem.
2014-02-11 21:31:46 +01:00
Dan Fandrich 3a0d1bebba secureserver: Only set stunnel FIPS option when available
It seems the fips config option causes an error if FIPS mode was
not enabled at stunnel compile-time.  FIPS support was disabled
by default in stunnel 5.00, so this is probably really only needed
on versions between 4.32 and 5.00.
2014-02-10 21:56:20 +01:00
Steve Holme daa182afa6 tests: Added test for IMAP LSUB command 2014-02-09 21:21:10 +00:00
Steve Holme 230e872dbd tests: Removed test 807 as it has been superseded by tests 815 and 816 2014-02-09 21:07:02 +00:00
Steve Holme 5a997d97fd tests: Updated the titles of tests 815 and 816 2014-02-09 21:00:17 +00:00
Steve Holme ea3828e0c7 tests: Re-enabled IMAP tests that require URL specific option support 2014-02-09 14:49:38 +00:00