Commit Graph

3531 Commits

Author SHA1 Message Date
Marc Hoersken 6a76d3eb53 secureserver.pl: update Windows detection and fix path conversion 2014-12-19 17:17:26 +01:00
Marc Hoersken 3b7bf29385 secureserver.pl: make OpenSSL CApath and cert absolute path values
Recent stunnel versions (5.08) seem to have trouble with relative
paths on Windows. This turns the relative paths into absolute ones.
2014-12-19 17:16:19 +01:00
Dan Fandrich f768be0a25 sws.c: Fixed 'rc' may be used uninitialized warning 2014-12-10 00:06:10 +01:00
Dan Fandrich 41f1f6e830 cookies: Improved OOM handling in cookies
This fixes the test 506 torture test. The internal cookie API really
ought to be improved to separate cookie parsing errors (which may be
ignored) with OOM errors (which should be fatal).
2014-12-09 23:58:30 +01:00
Steve Holme f5e9c636e8 sws.c: Fixed compilation warning
sws.c:2191 warning: 'rc' may be used uninitialized in this function
2014-12-06 22:18:42 +00:00
Stefan Bühler 557ca620e4 fix gdb libtool invocation path 2014-12-04 14:38:15 -08:00
Peter Wu 970c22f970 libcurl: add UNIX domain sockets support
The ability to do HTTP requests over a UNIX domain socket has been
requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a
discussion happened, no patch seems to get through. I decided to give it
a go since I need to test a nginx HTTP server which listens on a UNIX
domain socket.

One patch [3] seems to make it possible to use the
CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket.
Another person wrote a Go program which can do HTTP over a UNIX socket
for Docker[4] which uses a special URL scheme (though the name contains
cURL, it has no relation to the cURL library).

This patch considers support for UNIX domain sockets at the same level
as HTTP proxies / IPv6, it acts as an intermediate socket provider and
not as a separate protocol. Since this feature affects network
operations, a new feature flag was added ("unix-sockets") with a
corresponding CURL_VERSION_UNIX_SOCKETS macro.

A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This
option enables UNIX domain sockets support for all requests on the
handle (replacing IP sockets and skipping proxies).

A new configure option (--enable-unix-sockets) and CMake option
(ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I
deliberately did not mark this feature as advanced, this is a
feature/component that should easily be available.

 [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html
 [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/
 [2]: http://sourceforge.net/p/curl/feature-requests/53/
 [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html
 [4]: https://github.com/Soulou/curl-unix-socket

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Peter Wu 479abdd32e tests: add two HTTP over UNIX socket tests
test1435: a simple test that checks whether a HTTP request can be
performed over the UNIX socket. The hostname/port are interpreted
by sws and should be ignored by cURL.

test1436: test for the ability to do two requests to the same host,
interleaved with one to a different hostname.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Peter Wu f1cc2a2c0c tests: add HTTP UNIX socket server testing support
The variable `$ipvnum` can now contain "unix" besides the integers 4
and 6 since the variable. Functions which receive this parameter
have their `$port` parameter renamed to `$port_or_path` to support a
path to the UNIX domain socket (as a "port" is only meaningful for TCP).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Peter Wu 99fb36797a sws: try to remove socket and retry bind
If sws is killed it might leave a stale socket file on the filesystem
which would cause an EADDRINUSE error. After this patch, it is checked
whether the socket is really stale and if so, the socket file gets
removed and another bind is executed.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:18 +01:00
Peter Wu e9c7a86220 sws: add UNIX domain socket support
This extends sws with a --unix-socket option which causes the port to
be ignored (as the server now listens on the path specified by
--unix-socket). This feature will be available in the following patch
that enables checking for UNIX domain socket support.

Proxy support (CONNECT) is not considered nor tested. It does not make
sense anyway, first connecting through a TCP proxy, then let that TCP
proxy connect to a UNIX socket.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:18 +01:00
Peter Wu fb7d7e0022 sws: restrict TCP_NODELAY to IP sockets
TCP_NODELAY does not make sense for Unix sockets, so enable it only if
the socket is using IP.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:18 +01:00
Steve Holme d784000a14 sws.c: Fixed compilation warning when IPv6 is disabled
sws.c:69: warning: comma at end of enumerator list
2014-12-03 00:01:49 +00:00
Peter Wu cf6c5c222d sws: move away from IPv4/IPv4-only assumption
Instead of depending the socket domain type on use_ipv6, specify the
domain type (AF_INET / AF_INET6) as variable. An enum is used here with
switch to avoid compiler warnings in connect_to, complaining that rc
is possibly undefined (which is not possible as socket_domain is
always set).

Besides abstracting the socket type, make the debugging messages be
independent on IP (introduce location_str which points to "port XXXXX").
Rename "ipv_inuse" to "socket_type" and tighten the scope (main).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-30 23:21:14 +01:00
Bill Nagel b359badd49 curl tool: Enable support for the SMB protocol
This patch enables SMB/CIFS support in the curl command-line tool.
2014-11-30 21:32:44 +00:00
Steve Holme 733686e430 tests: Disable test 1013 until SMB is fully added 2014-11-29 21:36:20 +00:00
Peter Wu 86981ac9f5 runtests.pl: fix startup of IPv6 servers
Commit curl-7_23_1-143-g8218064 changed the parameter of
responsive_http_server to accept types other than IPv6 (converting
from a boolean to a string), but only considered the lower-case "ipv6"
and not the "IPv6" variant. This caused all servers to start in IPv4
mode instead.

This patch converts the remaining cases to "ipv6". While not strictly
necessary for the run*server variants, these got also converted for
consistency and to prevent future errors.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-28 23:49:10 +01:00
Peter Wu bb6047cd64 runtests.pl: fix warning message, remove duplicate value
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-28 23:49:10 +01:00
Steve Holme c5399c827d tests: Added SMTP with --crlf test case 2014-11-26 23:58:42 +00:00
Daniel Stenberg 9cfa822fea testcurl: bump the version of this script! 2014-11-25 11:22:09 +01:00
Daniel Stenberg c1e8744177 testcurl: skip reading the setup file if given enough cmdline info
This makes it much easier to run multiple tests in the same directory,
just altering the command lines used.
2014-11-25 10:36:47 +01:00
Travis Burtrum be1a505189 SSL: Add PEM format support for public key pinning 2014-11-24 19:30:09 +01:00
Steve Holme 85070e46cc runtests.pl: Re-aligned feature support comments 2014-11-22 23:17:59 +00:00
Steve Holme 9ce5e89fcc runtests.pl: Use Kerberos and SPNEGO as proxies for the crypto feature
In addition to NTLM, use Kerberos and SPNEGO as proxies to the crypto
feature.

...and converted tab characters, from commit 4b4e8a5853, to spaces.
2014-11-22 17:14:11 +00:00
Steve Holme 2e2f981bcc runtests.pl: Added support for SPNEGO 2014-11-22 13:52:57 +00:00
Steve Holme 8cc7e74a8f runtests.pl: Added Kerberos detection 2014-11-22 12:26:59 +00:00
Steve Holme 5b437c7637 runtests.pl: Added GSS-API detection 2014-11-22 12:12:42 +00:00
Steve Holme 84d752d1ad FILEFORMAT: Added SSPI, GSS-API and Kerberos to the features list 2014-11-21 18:44:58 +00:00
Steve Holme 10cbc33a4c FILEFORMAT: Added test requires feature not present information
Such as !SSPI as we do for the NTLM and Digest tests.
2014-11-21 18:42:40 +00:00
Daniel Stenberg 4c3cfc7558 test1801: first real http2 test case 2014-11-20 23:33:34 +01:00
Daniel Stenberg ac5eb7fdfb sws: initial tiny steps toward http2 support 2014-11-20 23:33:34 +01:00
Daniel Stenberg 52655b4c90 FILEFORMAT: mention the new upgrade support 2014-11-20 23:33:34 +01:00
Daniel Stenberg 07e0957e1f test1800: first plain-text http2 test case
Verifies the upgrade request, but gets a plain 1.1 response
2014-11-20 23:33:34 +01:00
Peter Wu 8bdecd3617 test22: expand a backtick command
This is the only user of the backtick operator in the command. As the
commands will soon not be executed by a shell anymore (but by perl),
replace the command with its output.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-13 23:06:44 +01:00
Peter Wu dd469eec40 symbol-scan.pl: do not require autotools
Makes test1119 pass when building with cmake.

configurehelp.pm is generated by configure (autotools). As cmake does
not provide a separate variable for the C preprocessor, default to cpp.
Before commit ef24ecde68 ("symbol-scan:
use configure script knowledge about how to run the C preprocessor"),
this tool would also use 'cpp'.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:09:44 +01:00
Peter Wu 17d27805f9 cmake: add ENABLE_THREADED_RESOLVER, rename ARES
Fix detection of the AsynchDNS feature which not just depends on
pthreads support, but also on whether USE_POSIX_THREADS is set or not.
Caught by test 1014.

This patch adds a new ENABLE_THREADED_RESOLVER option (corresponding to
--enable-threaded-resolver of autotools) which also needs a check for
HAVE_PTHREAD_H.

For symmetry with autotools, CURL_USE_ARES is renamed to ENABLE_ARES
(--enable-ares). Checks that test for the availability actually use
USE_ARES instead as that is the result of whether a-res is available or
not (in practice this does not matter as CARES is marked as required
package, but nevertheless it is better to write the intent).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:09:25 +01:00
Peter Wu 767aaf587c cmake: build libhostname for test suite
Used by some test cases via LD_PRELOAD in order to fake the host name.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:08:46 +01:00
Peter Wu 7bdfdd09e4 tests: fix libhostname visibility
I noticed that a patched cmake build would pass tests with a fake local
hostname, but the autotools build skips them:

    got unexpected host name back, LD_PRELOAD failed

It turns out that -fvisibility=hidden hides the symbol, and since the
tests are not part of libcurl, it fails too. Just remove the LIBCURL
guard.

Broken since cURL 7.30 (commit 83a42ee20e,
"curl.h: stricter CURL_EXTERN linkage decorations logic").

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:06:48 +01:00
Peter Wu a5ad43afe8 tests: fix memleak in server/resolve.c
This makes LeakSanitizer happy.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:06:48 +01:00
Dan Fandrich e2828af607 test552: Don't run HTTP digest tests for SSPI based builds
Technical difficulties prevented this from going into the
previous commit.
2014-11-06 22:31:07 +01:00
Steve Holme b5c496f109 tests: Don't run HTTP digest tests for SSPI based builds
Added !SSPI to the features list of the HTTP digest tests, as SSPI
based builds now use the Windows SSPI messaging API rather than the
internal functions, and we can't control the random numbers that get
used as part of the digest.
2014-11-06 20:36:08 +00:00
Daniel Stenberg d997c8b2f6 lib544.c: use duphandle for test 545
To verify that curl_easy_duphandle() works fine on a handle that has
gotten data stored with *_COPYPOSTFIELDS.
2014-11-05 08:05:14 +01:00
Daniel Stenberg 445aab4b73 tests: add new feature 'SSLpinning'
... and make test 2034 and 2035 require it, and have it set when built
with OpenSSL or GnuTLS.
2014-11-04 23:02:09 +01:00
Daniel Stenberg 9bc2582c31 resume: consider a resume from [content-length] to be OK
Basically since servers often then don't respond well to this and
instead send the full contents and then libcurl would instead error out
with the assumption that the server doesn't support resume. As the data
is then already transfered, this is now considered fine.

Test case 1434 added to verify this. Test case 1042 slightly modified.

Reported-by: hugo
Bug: http://curl.haxx.se/bug/view.cgi?id=1443
2014-11-01 23:09:24 +01:00
Daniel Stenberg 95765567d0 HTTP: return larger than 3 digit response codes too
HTTP 1.1 is clearly specified to only allow three digit response codes,
and libcurl used sscanf("%3d") for that purpose. This made libcurl
support smaller numbers but not larger. It does now, but we will not
make any specific promises nor document this further since it is going
outside of what HTTP is.

Bug: http://curl.haxx.se/bug/view.cgi?id=1441
Reported-by: Balaji
2014-10-27 16:28:10 +01:00
Dan Fandrich 382cee0a77 Added the "flaky" keyword to a number of tests
Each shows evidence of flakiness on at least one platform on
the autobuilds. Users can use this keyword to skip these tests
if desired.
2014-10-26 13:50:38 +01:00
Daniel Stenberg d938d5e6f8 test545: make it not use a trailing zero
CURLOPT_COPYPOSTFIELDS with a given CURLOPT_POSTFIELDSIZE does not
require a trailing zero of the data and by making sure this test doesn't
use one we know it works (combined with valgrind).
2014-10-16 23:40:49 +02:00
Patrick Monnerat 265b9a2e49 vtls: remove QsoSSL 2014-10-13 16:33:47 +02:00
Peter Wu 476499c75c tests: move TESTCASES to Makefile.inc, add show for cmake
This change allows runtests.pl to be run from the CMake builddir:

    export srcdir=/tmp/curl/tests;
    perl -I$srcdir $srcdir/runtests.pl -l

In order to make this possible, all test cases have been moved from
Makefile.am to Makefile.inc.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-13 11:50:21 +02:00
Peter Wu 87a3a924ce tests/http_pipe.py: Python 3 support
The 2to3 tool converted socketserver (which I manually fixed up with an
import fallback) and the print(e) line. The xrange option was converted
to range, but it seems better to use the '*' operator here for
simplicity.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-10-10 16:58:20 +02:00
Daniel Stenberg bf7023d165 test2036: verify -O with no slash at all in the URL
Similar to test 76 but that test's URL has a slash just no file name
part.
2014-10-09 16:50:26 +02:00
Jakub Zakrzewski a3154295c5 Cmake: Got rid of setup_curl_dependencies
There is no need for such function. Include_directories propagate by
themselves and having a function with one simple link statement makes
little sense.
2014-10-09 13:48:30 +02:00
Travis Burtrum 93e450793c SSL: implement public key pinning
Option --pinnedpubkey takes a path to a public key in DER format and
only connect if it matches (currently only implemented with OpenSSL).

Provides CURLOPT_PINNEDPUBLICKEY for curl_easy_setopt().

Extract a public RSA key from a website like so:
openssl s_client -connect google.com:443 2>&1 < /dev/null | \
sed -n '/-----BEGIN/,/-----END/p' | openssl x509 -noout -pubkey \
| openssl rsa -pubin -outform DER > google.com.der
2014-10-07 14:44:19 +02:00
Dan Fandrich 46d71e7fd2 test506: Fixed a couple of memory leaks in test 2014-09-26 06:57:52 +02:00
Yousuke Kimoto b10a838a7a CURLOPT_COOKIELIST: Added "RELOAD" command 2014-09-25 16:28:17 +02:00
Daniel Stenberg a76825a5ef cookies: reject incoming cookies set for TLDs
Test 61 was modified to verify this.

CVE-2014-3620

Reported-by: Tim Ruehsen
URL: http://curl.haxx.se/docs/adv_20140910B.html
2014-09-10 07:32:36 +02:00
Tim Ruehsen 8a75dbeb23 cookies: only use full host matches for hosts used as IP address
By not detecting and rejecting domain names for partial literal IP
addresses properly when parsing received HTTP cookies, libcurl can be
fooled to both send cookies to wrong sites and to allow arbitrary sites
to set cookies for others.

CVE-2014-3613

Bug: http://curl.haxx.se/docs/adv_20140910A.html
2014-09-10 07:32:36 +02:00
Brandon Casey 6beb0eeea1 Ensure progress.size_dl/progress.size_ul are always >= 0
Historically the default "unknown" value for progress.size_dl and
progress.size_ul has been zero, since these values are initialized
implicitly by the calloc that allocates the curl handle that these
variables are a part of.  Users of curl that install progress
callbacks may expect these values to always be >= 0.

Currently it is possible for progress.size_dl and progress.size_ul
to by set to a value of -1, if Curl_pgrsSetDownloadSize() or
Curl_pgrsSetUploadSize() are passed a "size" of -1 (which a few
places currently do, and a following patch will add more).  So
lets update Curl_pgrsSetDownloadSize() and Curl_pgrsSetUploadSize()
so they make sure that these variables always contain a value that
is >= 0.

Updates test579 and test599.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
2014-09-07 23:23:12 +02:00
Steve Holme 8acbb074f8 tests: Added test1420 to the makefile 2014-09-07 12:13:34 +01:00
Steve Holme be83356e5e test1420: Removed unnecessary CURLOPT setting 2014-09-07 12:09:29 +01:00
Steve Holme 797d56cbd8 tests: Added more "Clear Text" authentication keywords 2014-09-07 11:37:10 +01:00
Steve Holme 9ee502ac6b tests: Updated "based on" text due to email test renumbering 2014-09-07 11:19:10 +01:00
Steve Holme ed285ae5c9 tests: For consistency added --libcurl to test name 2014-09-07 11:19:08 +01:00
Steve Holme 436a841354 tests: Added --libcurl for IMAP test case 2014-09-07 11:19:05 +01:00
Daniel Stenberg 0187c9e11d http: fix the Content-Range: parser
... to handle "*/[total]". Also, removed the strange hack that made
CURLOPT_FAILONERROR on a 416 response after a *RESUME_FROM return
CURLE_OK.

Reported-by: Dimitrios Siganos
Bug: http://curl.haxx.se/mail/lib-2014-06/0221.html
2014-08-15 10:02:47 +02:00
Fabian Keil 40e13829af runtests.pl: Pad test case numbers with up to three zeroes
Test case numbers with four digits have been available for a
while now.
2014-08-07 10:17:25 +02:00
Fabian Keil 6543f6e36c tests: Fix a couple of incomplete response lines 2014-07-26 23:12:53 +02:00
Fabian Keil 2fab0d45a9 runtests.pl: Remove filteroff() which hasn't been used since 2001 2014-07-26 23:02:50 +02:00
Fabian Keil dc7a598126 runtests.pl: Don't expect $TESTDIR/DISABLED to exist
If a non-standard $TESTDIR is used the file may not be necessary.

Previously a "missing" file resulted in the warning:
readline() on closed filehandle D at ./runtests.pl line 4940.
2014-07-26 23:01:31 +02:00
Fabian Keil 5828e886e6 getpart.pm: Fix a comment typo 2014-07-26 23:01:22 +02:00
Daniel Stenberg e1b13eba75 Curl_base64url_encode: unit-tested in 1302 2014-07-25 08:38:16 +02:00
Daniel Stenberg 4e11bd156e test1013.pl: GSS-Negotiate doesn't exist as a feature anymore 2014-07-24 23:46:11 +02:00
Sergey Nikulov 64010d603c libtest: fixed duplicated line in Makefile
Bug: https://github.com/bagder/curl/pull/105
2014-07-24 15:19:46 +02:00
Daniel Stenberg a8206adcad test1013.pl: remove SPNEGO/GSS-API tweaks
No longer necessary after Michael Osipov's rework
2014-07-23 00:01:39 +02:00
Dan Fandrich 6ffc113ceb testcurl.pl: log the value of --runtestopts in the test header 2014-07-17 00:00:23 +02:00
Daniel Stenberg 4cb2521595 test506: verify aa68848451
After the fixed cookie lock deadlock, this test now passes and it
detects double-locking and double-unlocking of mutexes.
2014-07-16 00:09:58 +02:00
Dan Fandrich 4da6e0c966 test320: strip off the actual negotiated cipher width
It's irrelevant to the test, and will change depending on which SSL
library is being used by libcurl.
2014-07-15 01:01:39 +02:00
Dan Fandrich 816979e3b8 tests: added globbing keyword to URL globbing tests 2014-07-12 01:52:07 +02:00
Dan Fandrich 45c93dad1d Fixed some "statement not reached" warnings 2014-07-12 01:45:26 +02:00
Dan Fandrich 447c31ce9d gnutls: explicitly added SRP to the priority string
This seems to have become necessary for SRP support to work starting
with GnuTLS ver. 2.99.0. Since support for SRP was added to GnuTLS
before the function that takes this priority string, there should be no
issue with backward compatibility.
2014-07-12 00:11:44 +02:00
Dan Fandrich d582c272a6 tests: adjust for capitalization differences in newer gnutls-serv 2014-07-11 23:47:48 +02:00
Dan Fandrich 4dc3a57718 test320/1/2/4: fix the port number substitution variables
These tests have been broken since commit 1958fe57 in Oct. 2011
2014-07-11 23:47:33 +02:00
Dan Fandrich d033fc8323 tests: document more test identifiers and variables 2014-07-11 23:33:55 +02:00
Dan Fandrich a6d666e1a6 tests: Use CURLOPT_READDATA instead of the obsolete CURLOPT_INFILE 2014-06-18 01:17:23 +02:00
Dan Fandrich 34d02aff71 sasl: Added back qop argument mistakenly removed in e95ca7ce
This caused segfaults on tests 823 869 907.
2014-06-15 14:11:35 +02:00
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
Marc Hoersken 8e62f7a650 secureserver: FIPS option is only supported since stunnel 5.00 2014-02-09 13:39:43 +01:00
Daniel Stenberg 6b9a3c1865 test96: updated according to recent changes 2014-02-08 23:20:10 +01:00
Daniel Stenberg 1f148c103c runtests: allow <strippart> to remove lines
For verify file, if the strippart condition removes the line completely
it is now removed from the array.
2014-02-08 23:19:10 +01:00
Steve Holme 132f5edfbd tool_getparam: Added support for parsing of specific URL options 2014-02-08 11:18:25 +00:00
Dan Fandrich 2d8623e85d secureserver: Disable FIPS mode for stunnel
It's unnecessary for curl testing, and it can otherwise cause
stunnel to fail to start if OpenSSL doesn't support FIPS mode.
2014-02-08 11:51:28 +01:00
Dan Fandrich e2dae8a7c2 runtests: Disable valgrind when debugging
This was already mostly being done, except that analysis after the
test still assumed that the valgrind log files would be available. An
alternative way to handle the valgrind + gdb combination could be to
enable one of the valgrind debugger hooks.
2014-02-07 22:43:34 +01:00
Steve Holme 6c492f34e5 lib1515.c: Fixed various compilation warnings
lib1515.c:38:26 warning: unused parameter 'curl'
lib1515.c:38:81 warning: unused parameter 'ptr'
lib1515.c:38:5 warning: no previous prototype for 'debug_callback'
lib1515.c:46:5 warning: no previous prototype for 'do_one_request'
lib1515.c:120:3  warning: ISO C90 forbids mixed declarations and code

As well as some code policing such as white space and braces.
2014-02-07 15:15:17 +00:00
Daniel Stenberg 9597f7dfbc formpost: use semicolon in multipart/mixed
Not comma, which is an inconsistency and a mistake probably inherited
from the examples section of RFC1867.

This bug has been present since the day curl started to support
multipart formposts, back in the 90s.

Reported-by: Rob Davies
Bug: http://curl.haxx.se/bug/view.cgi?id=1333
2014-02-07 09:43:36 +01:00
Dan Fandrich 7969a77735 tests: Document use of the MEMDEBUG_LOG_SYNC macro 2014-02-06 23:56:47 +01:00
Romulo A. Ceccon 8d1377282e tests: add test for bug #1327 (dns cache timeout)
Fix for bug #1303 (030a2b8cb) was not complete.
libcurl still pruned DNS entries added manually
after detecting a dead connection. This test
checks such behavior.
2014-02-06 23:03:34 +01:00
Romulo A. Ceccon 1505e4612b tests: add test for bug #1303 (dns cache timeout)
Test-case 1515 reproduces bug #1303, where libcurl
would incorrectly prune DNS entries added via
CURLOPT_RESOLVE after the DNS_CACHE_TIMEOUT had
expired.
2014-02-06 23:03:34 +01:00
Daniel Stenberg 5204b45ff9 runtests: add suppression generator help
Leave the valgrind --gen-suppressions option in there, commented, to
make it easier for next update.
2014-02-05 23:48:44 +01:00
Daniel Stenberg 225ec4312f valgrind: updated suppressions file
The call stack was modified in 2dc7ad23 so the supressions didn't work
anymore.
2014-02-05 23:46:31 +01:00
Daniel Stenberg 18b540f9d1 runtests: detect 'ares' better
... caused false detections of the threaded resolver otherwise
2014-02-05 23:36:16 +01:00
Dan Fandrich 2f89a61cc0 tests: Moved some comments so the test data files parse as XML 2014-02-03 00:23:34 +01:00
Steve Holme ffb8a21d85 tests: Fixed test172 cookie expiry
The test contains a cookie jar file where one of the cookies has an
expiry date of 1391252187 -- Sat, 1 Feb 2014 10:56:27 GMT which has
now expired. Updated to Wed, 14 Oct 2037 16:36:33 GMT as per test
179.

Reported-by: Adam Sampson
Bug: http://curl.haxx.se/bug/view.cgi?id=1330
2014-02-02 11:01:10 +00:00
Marc Hoersken e5acae0052 test 500: workaround low timer resolution on Windows
Since the timer resolution is lower, there are actually cases that
the compared values are equal. Therefore we check for previous
timestamps being greater than the current one instead.
2014-02-01 14:04:47 +01:00
Marc Hoersken efc112079c test suite: stop conversion of valid output to CRLF on Windows
Since the output isn't actually being written in text-mode and it
was rather used as a workaround, disable text-mode for these tests.
2014-02-01 13:49:58 +01:00
Marc Hoersken 2c49f2e3db HTTP tests: use CRLF as header seperator according to RFC 2616 2014-02-01 13:47:00 +01:00
Marc Hoersken 9f42205dcc FTP tests: enable text-mode for more datacheck sections 2014-02-01 13:43:19 +01:00
Marc Hoersken 4ea2d5579b FTP tests: enable text-mode for data and datacheck sections 2014-01-31 20:05:21 +01:00
Marc Hoersken 9f132f9f39 runtests.pl: added support for text-mode within datacheck section 2014-01-31 20:05:17 +01:00
Marc Hoersken ca9ab24ed5 ftpserver.pl: directory LISTings use [CR][LF] for ASCII transfer
According to section 2.2 of RFC959 the End-of-Line is defined as:
 The end-of-line sequence defines the separation of printing
 lines.  The sequence is Carriage Return, followed by Line Feed.

Verified by sniffing traffic between a Windows FTP client (FileZilla)
and Unix-hosted FTP server (ProFTPD).
2014-01-31 20:05:14 +01:00
Marc Hoersken 480ca49ecb runtests.pl: reverse line-ending conversion on Windows
It makes more sense to convert the expected output to [CR][LF] on
Windows than to force the actual, probably correct, output to [LF].

This way it is actually possible to see if curl outputs the correct
line-ending excepted by a text-aware test case.
2014-01-31 20:05:09 +01:00
Dan Fandrich be9cc620b5 tests: make the authorization retry tests pass the torture tests 2014-01-30 23:18:20 +01:00
Steve Holme 784f225266 tests: Missed updating a type-3 message in commit 1c9aaa0bac 2014-01-30 20:51:34 +00:00
Steve Holme 1c9aaa0bac tests: Updated NTLM tests for NTLMv2 type-3 message 2014-01-30 19:14:04 +00:00
Dan Fandrich 9873fd5317 tests: make a few lib15?? tests pass the OOM torture tests 2014-01-29 00:40:33 +01:00
Dan Fandrich d735d3e803 lib1900: make the test pass the OOM torture tests 2014-01-29 00:19:34 +01:00
Dan Fandrich f00899d73e unit1304: make the test pass the OOM torture tests 2014-01-28 23:47:20 +01:00
Dan Fandrich 00b1e52823 unit1396: make the test pass the OOM torture tests 2014-01-28 23:27:22 +01:00
Marc Hoersken 23a04863aa testsuite: visualize line-endings in output comparison diffs 2014-01-26 10:00:14 +01:00
Marc Hoersken 33f9c05082 sockfilt.c: follow up cleanup commit on 49b63cf3 2014-01-26 09:44:16 +01:00
Marc Hoersken 00787f94b2 http-pipe tests: use text as output data mode to support Windows 2014-01-26 09:19:32 +01:00
Marc Hoersken 49b63cf30d sockfilt.c: fixed and simplified Windows select function
Since the previous complex select function with initial support for
non-socket file descriptors, did not actually work correctly for
Console handles, this change simplifies the whole procedure by using
an internal waiting thread for the stdin console handle.

The previous implementation made it continuously trigger for the stdin
handle if it was being redirected to a parent process instead of
an actual Console input window.

This approach supports actual Console input handles as well as
anonymous Pipe handles which are used during input redirection.

It depends on the fact that ReadFile supports trying to read zero bytes
which makes it wait for the handle to become ready for reading.
2014-01-26 00:58:30 +01:00
Marc Hoersken f55f8d4c18 http_pipe.py: replaced epoll with select to support Windows
Removed Unix-specific functionality in order to support Windows:
- select.epoll replaced with select.select
- SocketServer.ForkingMixIn replaced with SocketServer.ForkingMixIn
- socket.MSG_DONTWAIT replaced with socket.setblocking(False)

Even though epoll has a better performance and improved socket handling
than select, this change should not affect the actual test case.
2014-01-25 20:52:42 +01:00
Dan Fandrich 88b074df3f tests: Added missing HTTP proxy keywords 2014-01-25 16:55:05 +01:00
Dan Fandrich f5860fd5fc tests: added missing <features> http to a number of tests 2014-01-25 12:47:04 +01:00
Dan Fandrich e17446b097 tests: Added a keyword for tests depending on internal info logs 2014-01-24 23:39:05 +01:00
Dan Fandrich 0d959c64b2 runtests: Don't log command every torture iteration in verbose 2014-01-24 23:35:44 +01:00
Dan Fandrich 606e67c812 tests: Added missing http feature to tests 509 & 1513 2014-01-24 23:14:00 +01:00
Dan Fandrich e6130c0310 test1514: Used the macros for host and port number 2014-01-24 08:16:17 +01:00
Dan Fandrich 6c014e4283 test1514: Got rid of a non-const initializer C99ism 2014-01-22 01:49:55 +01:00
Cédric Deltheil 6217cf6ba3 test1514: added - no more negative Content-Length (HTTP POST)
This covers changes from commit afd288b2.
2014-01-20 12:52:07 +01:00
Daniel Stenberg d4296f6f06 test1417: verify chunked-encoding transfer without CR
As was introduced in 8f6b4be8af04
2014-01-17 08:37:44 +01:00
Daniel Stenberg 3f5546b2be test1416: verify the chunked size overflow detection 2014-01-17 08:37:44 +01:00
Dan Fandrich 821094ba72 Fixed some XML syntax issues in the test data
Also, make the ftp server return a canned response that doesn't
cause XML verification problems.  Although the test file format
isn't technically XML, it's still handy to be able to use XML
tools to verify and manipulate them.
2014-01-17 00:32:02 +01:00
Marc Hoersken 2d15958711 secureserver.pl: follow up fix for 87ade5f
Since /dev/stdout is not always emulated on Windows,
just skip the output option on Windows.

MinGW/msys support /dev/stdout only from a new login shell.
2014-01-13 21:43:41 +01:00
Marc Hoersken 87ade5f0eb secureserver.pl: added full support for tstunnel on Windows
tstunnel on Windows does not support the pid option and is unable
to write to an output log that is already being used as a redirection
target for stdout. Therefore it does now output all log data to stdout
by default and secureserver.pl creates a fake pidfile on Windows.
2014-01-13 00:09:46 +01:00
Daniel Stenberg 31075a8897 runtests: disable memory tracking with threaded resolver
The built-in memory debug system doesn't work with multi-threaded use so
instead of causing annoying false positives, disable the memory tracking
if the threaded resolver is used.
2014-01-08 13:20:29 +01:00
Steve Holme 3bc349b53b runtests.pl: Updated copyright year after edit from d718abd968 2014-01-05 11:32:48 +00:00
Marc Hoersken d718abd968 runtests.pl: check for tstunnel command on Windows
The Windows console version of stunnel is called "tstunnel", while
running "stunnel" on Windows spawns a new console window which
cannot be handled by the testsuite.
2014-01-05 02:22:09 +01:00
Marc Hoersken 190bb785d8 testcurl.pl: always show the last 5 commits even with --nogitpull 2014-01-05 00:09:20 +01:00
Daniel Stenberg 5c0eae136b ftp tests: provide LIST responses in the test file itself
Previously LIST always returned a fixed hardcoded list that the ftp
server code knew about, mostly since the server didn't get any test case
number in the LIST scenario. Starting now, doing a CWD to a directory
named test-[number] will make the test server remember that number and
consider it a test case so that a subsequent LIST command will send the
<data> section of that test case back.

It allows LIST tests to be made more similar to how all other tests
work.

Test 100 was updated to provide its own directory listing.
2014-01-04 23:39:30 +01:00
Steve Holme 84a9f092dc Updated copyright year for recent changes 2014-01-04 17:41:10 +00:00
Marc Hoersken 4fc8d83f5f secureserver.pl: support for stunnel-path with nun-alphanum chars
This is desired to support stunnel installations on Windows.
2014-01-04 17:49:54 +01:00
Daniel Stenberg 404794e97a test1513: fix spelling 2014-01-03 21:01:55 +01:00
Daniel Stenberg 62da1e7458 test1513: added - verify early progress callback return fail
Verify the change brought in commit 8e11731653061. It makes sure that
returning a failure from the progress callback even very early results
in the correct return code.
2014-01-03 14:09:59 +01:00
Marc Hoersken d28b70d152 unittests: do not include curl_memory.h
memdebug.h already contains all required definitions and including
curl_memory.h causes errors like the following:

tests/unit/unit1394.c:119: undefined reference to `Curl_cfree'
tests/unit/unit1394.c:120: undefined reference to `Curl_cfree'
2014-01-03 12:30:23 +01:00
Steve Holme 60bd22620a mprintf: Replaced internal usage of FORMAT_OFF_T and FORMAT_OFF_TU
Following commit 0aafd77fa4, replaced the internal usage of
FORMAT_OFF_T and FORMAT_OFF_TU with the external versions that we
expect API programmers to use.

This negates the need for separate definitions which were subtly
different under different platforms/compilers.
2013-12-31 11:10:42 +00:00
Steve Holme 01aaad7442 tests: Disabled NTLM tests when running with SSPI enabled 2013-12-28 20:37:00 +00:00
Steve Holme 5107d66b2e runtests.pl: Fixed slightly incorrect regex in commit 28dd47d4d4 2013-12-28 16:32:07 +00:00
Steve Holme 28dd47d4d4 runtests.pl: Optimised feature present checking code
...to exclude not present features.
2013-12-28 12:35:51 +00:00
Steve Holme 147b2a546e runtests.pl: Added the ability to run tests when a feature is not present 2013-12-28 11:18:54 +00:00
Steve Holme 95b5036a59 ftpserver.pl: Fixed compilation error
Unmatched right curly bracket at line 758, at end of line
2013-12-27 20:14:06 +00:00
Steve Holme 263616202b ftpserver.pl: Reworked SMTP verified server detection
Following the addition of informational commands to the SMTP protocol,
the test server is no longer required to return the verified server
information in responses that curl only outputs in verbose mode.

Instead, a similar detection mechanism to that used by FTP, IMAP and
POP3 can now be used.
2013-12-27 18:15:04 +00:00
Steve Holme 6f2d5f0562 pop3: Fixed APOP being determined by CAPA response rather than by timestamp
This commit replaces that of 9f260b5d66 because according to RFC-2449,
section 6, there is no APOP capability "...even though APOP is an
optional command in [POP3].  Clients discover server support of APOP by
the presence in the greeting banner of an initial challenge enclosed in
angle brackets."
2013-12-24 16:34:55 +00:00
Steve Holme 82bf8edff3 tests: Removed APOP timestamp from default server greeting 2013-12-24 15:07:32 +00:00
Steve Holme cd492a3ba8 test936: Corrected login details from commit 7246255416 2013-12-23 12:25:42 +00:00
Steve Holme 50aac1a37d ftpserver.pl: Updated custom full text REPLY regex
SASL downgrade tests: 833, 835, 879, 881, 935 and 937 would fail as
they contained a minus sign in their authentication mechanism and this
would be missed by the custom reply parser.
2013-12-23 12:24:06 +00:00
Steve Holme 574db1a6fd tests: Corrected syntax error from commit 7246255416 2013-12-23 09:25:50 +00:00
Steve Holme 7246255416 tests: Added SMTP SASL downgrade tests 2013-12-23 07:17:53 +00:00
Steve Holme f763d1b1bb tests: Added POP3 SASL downgrade tests 2013-12-23 07:17:41 +00:00
Steve Holme 48cd1292e2 tests: Added IMAP SASL downgrade tests 2013-12-23 07:17:31 +00:00
Steve Holme 3db1f3dd81 ftpserver.pl: Fixed runtime warning from commit 7da9c95bcf
Use of uninitialized value $FTPARG in concatenation (.) or string at
line 3255.
2013-12-22 21:59:13 +00:00
Steve Holme 7da9c95bcf ftpserver.pl: Added the ability to send custom full text replies 2013-12-22 19:36:07 +00:00
Steve Holme 95ae389e17 ftpserver.pl: Added the ability to specify custom full text replies 2013-12-22 17:16:46 +00:00
Steve Holme 91735102ac ftpserver.pl: Renamed commandreply variable from customreply 2013-12-22 16:09:33 +00:00
Steve Holme 248967e300 tests: Added SASL cancellation keywords
Added SASL CANCELLATION keywords to differentiate these tests from the
upcoming SASL downgrade tests.
2013-12-22 13:06:59 +00:00
Steve Holme 48043f87b6 imap/pop3/smtp: Added support for SASL authentication downgrades
Added support for downgrading the SASL authentication mechanism when the
decoding of CRAM-MD5, DIGEST-MD5 and NTLM messages fails. This enhances
the previously added support for graceful cancellation by allowing the
client to retry a lesser SASL mechanism such as LOGIN or PLAIN, or even
APOP / clear text (in the case of POP3 and IMAP) when supported by the
server.
2013-12-18 20:45:17 +00:00
Daniel Stenberg 169fedbdce login options: remove the ;[options] support from CURLOPT_USERPWD
To avoid the regression when users pass in passwords containing semi-
colons, we now drop the ability to set the login options with the same
options. Support for login options in CURLOPT_USERPWD was added in
7.31.0.

Test case 83 was modified to verify that colons and semi-colons can be
used as part of the password when using -u (CURLOPT_USERPWD).

Bug: http://curl.haxx.se/bug/view.cgi?id=1311
Reported-by: Petr Bahula
Assisted-by: Steve Holme
Signed-off-by: Daniel Stenberg <daniel@haxx.se>
2013-12-14 22:40:37 +01:00
Steve Holme c92c30edbd base64: Extended validation to look for invalid characters
Extended the basic validation in commit e17c1b25bc to return a
failure when invalid base64 characters are included.
2013-12-01 11:12:23 +00:00
Steve Holme 35e476a3f6 tests: Re-ordered test arguments to match other IMAP tests 2013-11-24 17:59:17 +00:00
Steve Holme 0434a19431 tests: Corrected login "username" authentication responses 2013-11-24 16:25:44 +00:00
Steve Holme 2ff0c6f5f3 tests: Added error code explanation comments 2013-11-24 12:35:45 +00:00
Steve Holme 8a94aedbd6 tests: Removed expected QUIT response from graceful cancellation tests
A failure during authentication, which is performed as part of the
CONNECT phrase (for IMAP, POP3 and SMTP) is considered by the multi-
interface as being closed prematurely (aka a dead connection). As such
these protocols cannot issue the relevant QUIT or LOGOUT command.

Temporarily fixed the test cases until we can fix this properly.
2013-11-24 11:03:40 +00:00
Steve Holme 95877cf8ae tests: Added SMTP graceful authentication cancellation tests 2013-11-24 10:37:41 +00:00
Steve Holme d3325ae40a tests: Added POP3 graceful authentication cancellation tests 2013-11-24 10:37:30 +00:00
Steve Holme 23fabf8dea ftpserver.pl: Reworked fix from commit 7a36b2abc0 2013-11-23 22:14:34 +00:00
Steve Holme 7a36b2abc0 ftpserver.pl: Fixed unknown IMAP command "*" 2013-11-23 19:19:12 +00:00
Steve Holme e1c255f388 ftpserver.pl: Fixed servercmd REPLY with * detection 2013-11-23 16:28:28 +00:00
Steve Holme 6d3c832a30 tests: Added IMAP graceful authentication cancellation tests 2013-11-23 15:03:18 +00:00
Steve Holme 7935478397 tests: Moved CR LF in URL tests to their respective protocol groups 2013-11-23 14:49:50 +00:00
Steve Holme 2165298fe6 tests: Added SMTP NOOP and RSET tests 2013-11-17 12:52:42 +00:00
Steve Holme e885dc85a1 test928: Corrected typo in expected data from commit df58084695 2013-11-17 12:49:10 +00:00
Steve Holme df58084695 tests: Added SMTP HELP test 2013-11-17 10:11:27 +00:00
Steve Holme b56d7cda74 tests: Added SMTP EXPN command test 2013-11-17 00:20:58 +00:00
Steve Holme 8896b56488 test926: Corrected unknown user reply from commit 0d735c29f9
The error code should not be sent as data as it isn't passed onto the
client as body data, so cannot be compared in the test suite against
expected data.
2013-11-16 20:33:08 +00:00
Steve Holme 0d735c29f9 tests: Corrected missing data reply sections from 3d50e91aee 2013-11-16 17:19:26 +00:00
Steve Holme 3d50e91aee tests: Added SMTP VRFY command tests 2013-11-16 12:20:22 +00:00
Steve Holme 0cbfe5a7d5 ftpserver.pl: Added support for new SMTP commands 2013-11-16 11:17:23 +00:00
Steve Holme ed4ce23c23 lib1507.c: Added missing set of CURLOPT_UPLOAD option
Although this option should have already been set, the SMTP module can
now download information from and send instructional commands to, an
SMTP server, requiring the option to be set in order to perform a mail
transfer.
2013-11-15 21:01:10 +00:00
Steve Holme 55250d2d02 test825: Corrected typo from commit b29217d0d6 2013-11-13 17:31:42 +00:00
Steve Holme bde901ad89 test922: Corrected title to match other OAuth 2.0 tests 2013-11-13 09:17:50 +00:00
Steve Holme 79c77f7c31 tests: Added IMAP OAuth 2.0 authentication with initial response test 2013-11-13 09:14:30 +00:00
Steve Holme 986c249f2f tests: Added IMAP NTLM authentication with initial response test 2013-11-13 09:14:10 +00:00
Steve Holme 3b8c3eb911 tests: Added IMAP login authentication with initial response test 2013-11-13 09:12:59 +00:00
Steve Holme b29217d0d6 tests: Added IMAP plain authentication with initial response test 2013-11-13 09:12:32 +00:00
Steve Holme 534f90f9bf test873: Use proper padding in NTLM responses 2013-11-13 09:12:11 +00:00
Steve Holme 2ea9a125a6 tests: Added POP3 OAuth 2.0 authentication with initial response test 2013-11-13 00:29:05 +00:00
Steve Holme 58a00d6d9f tests: Added POP3 NTLM authentication with initial response test 2013-11-13 00:24:06 +00:00
Steve Holme 57a27528e6 tests: Added POP3 login authentication with initial response test 2013-11-13 00:11:19 +00:00
Steve Holme 632c1edd06 tests: Added POP3 plain authentication with initial response test 2013-11-13 00:07:02 +00:00
Steve Holme c19cfb79db runtests.pl: Added SSPI detection 2013-11-12 12:48:28 +00:00
Steve Holme 5f34a10445 tests: Updated CRAM-MD5 tests to use test user details 2013-11-12 09:46:30 +00:00