Commit Graph

2790 Commits

Author SHA1 Message Date
Daniel Stenberg c75ece4442 cookies: change the URL in the cookie jar file header 2012-07-03 11:27:45 +02:00
Neil Bowers 33e19f881e testcurl.pl: fix missing semicolon 2012-07-02 23:25:30 +02:00
Yang Tse b3ebfc2b74 testcurl.pl: allow non in-tree c-ares enabled autobuild 2012-07-02 20:21:48 +02:00
Yang Tse 069b280f63 configure.ac: verify that libmetalink is new enough
Enabling test2017 to test2022.
2012-07-02 16:42:54 +02:00
Yang Tse febd598597 test2017 to test2022: more metalink tests
With this commit, checks done in previous test2017 are now done in test2018.

Whole range test2017 to test2022 DISABLED until configure is capable of
requiring a new-enough metalink library.

Don't try these without mentioned check in place!
2012-06-29 16:09:55 +02:00
Yang Tse 7747136421 test2005 to test2016: improve failure detection 2012-06-29 15:44:50 +02:00
Yang Tse dd707b746f lib582.c: fix conversion warning 2012-06-28 17:14:41 +02:00
Tatsuhiro Tsujikawa bf4580d5fd Metalink: message updates
Print "parsing (...) OK" only when no warnings are generated.  If
no file is found in Metalink, treat it FAILED.

If no digest is provided, print WARNING in parse_metalink().
Also print validating FAILED after download.

These changes make tests 2012 to 2016 pass.
2012-06-28 00:26:16 +02:00
Yang Tse 6c09ffaf46 tests: add five more Metalink test cases 2012-06-27 13:16:01 +02:00
Yang Tse 5ce9e7a0b7 tests: update Metalink message format 2012-06-27 13:16:00 +02:00
Ghennadi Procopciuc 861e1ba604 test: Added test HTTP receive cookies over IPv6 2012-06-24 22:59:15 +02:00
Yang Tse 7731c34d79 tests: add another Metalink test case 2012-06-22 20:14:30 +02:00
Tatsuhiro Tsujikawa 14dc361433 tests: Enable test2010 and fixed hash value 2012-06-22 19:06:10 +02:00
Yang Tse b193ba8a02 tests: add six Metalink test cases 2012-06-21 18:32:31 +02:00
Yang Tse 53423673ca test 2005: add verification of hash checking outcome 2012-06-21 18:32:31 +02:00
Yang Tse 2f738c7f40 getpart.pm: remove misleading comment 2012-06-21 18:32:30 +02:00
Tatsuhiro Tsujikawa 7292486ec3 tests: Added Metalink test case # 2005 2012-06-21 04:16:53 +02:00
Tatsuhiro Tsujikawa a3e3f8ffa0 runtests.pl: make it support metalink feature 2012-06-20 20:15:42 +02:00
Yang Tse 07086c9487 getpart.pm: make test definition section/part parser more robust
Test definition section parts which needed to include xml-lingo as contents
of that part required that the xml-blurb was written as a single line. Now the
xml-data inside the part can be written multiline making it more readable.

Tested with <client><file> part which is written to disk before <command> runs.
2012-06-20 20:14:53 +02:00
Guenter Knauf 16c725dbc7 Fixed typo. 2012-06-15 02:25:09 +02:00
Yang Tse 63e9685470 tests: fix test definitions # 1355, 1363, 1385 and 1393
-i without HTTP protocol shall not include headers in the output
2012-06-11 13:56:40 +02:00
Yang Tse a884ffe430 Fixes allowing 26 more test cases in 1334 to 1393 range to succeed 2012-06-09 05:49:49 +02:00
Yang Tse c29d1f4e3a tests: fix test definitions # 1370 and 1371
-J without -O shall not honor C-D filename
2012-06-09 05:49:48 +02:00
Daniel Stenberg 2e48139fbf lib554.c: use curl_formadd() properly
The length/size options take longs so make sure to pass on such types.

Reported by: Neil Bowers
Bug: http://curl.haxx.se/mail/lib-2012-06/0001.html
2012-06-07 23:10:40 +02:00
Yang Tse 7352ac408b Fixes allowing HTTP test cases 1338, 1339, 1368 and 1369 to succeed 2012-06-07 21:57:53 +02:00
Yang Tse c41d959ee6 tests 1364 to 1393: several -o filename -J -i -D combinations for HTTP and FTP 2012-06-07 17:45:37 +02:00
Yang Tse 430791616b tests 1348 to 1363: test definition polishing
Verify that the "Saved to filename 'blabla'" message is only displayed when
the 'blabla' filename being used _actually_ has been specified by the server
in the Content-Disposition header.

Use relative path for unintended file creation postcheck.
2012-06-07 15:29:46 +02:00
Yang Tse 37550c16f9 Disable non-HTTP header related tests
These now detect incompleate header data and fail
2012-06-06 13:04:18 +02:00
Yang Tse b1f2a680bd tests 1348 to 1363: compleate header data part of test definition 2012-06-06 12:59:52 +02:00
Yang Tse 2b56e4c1bb tests 1334 to 1363 revisited.
Add a postcheck section to verify unintended file creation.

Remove needless <file> checks in verify section. Renumbering where appropriate.
2012-06-05 20:20:40 +02:00
Yang Tse 62f374b19e tests: adjust file part behavior in test verify section.
When a <file> part is now specified with no contents at all, this
will actually verify that the specified file has no contents at all.
Previously file contents would be ignored.
2012-06-05 20:20:39 +02:00
Yang Tse c5b66836a5 tests 1348 to 1363: add a comma in test description 2012-06-05 13:16:35 +02:00
Daniel Stenberg 0c460e80ed pop3 tests: CAPA instead of AUTH
After Steve's commit e336bc7c42 test 1319 and 1407 need to check
for CAPA instead of AUTH.
2012-06-04 22:34:06 +02:00
Yang Tse 04a6f0a1a4 tests 1356 to 1363: several -O -J -i -D combinations with FTP protocol
Currently 1356 to 1362 succeed but a write failure is logged in traceNNNN.

Currently 1363 fails, so disabled for now.
2012-06-04 20:59:45 +02:00
Steve Holme 1fc89eb87f tests: Updated pop3 tests for change in auth mechanism detection 2012-06-04 19:41:56 +01:00
Yang Tse 3bfff57e1f tests 1348 to 1355: several -O -J -i -D combinations with FTP protocol
Currently 1348 to 1354 succeed but a write failure is logged in traceNNNN.

Currently 1355 fails, so disabled for now.
2012-06-04 19:40:04 +02:00
Yang Tse 628e62a966 tests 1346 to 1347: several -O -J -i -D combinations with HTTP protocol 2012-06-04 18:56:28 +02:00
Yang Tse 379efd62aa tests 1334 to 1345: several -O -J -i -D combinations with HTTP protocol 2012-06-01 05:48:26 +02:00
Yang Tse 00dd45720e tests: support test definitions with up to 5 file checks in <verify> section
This is done introducing tags <file1> to <file4> besides existing <file> one,
as well as corresponding <stripfile1> to <stripfile4> ones, that can be used
in the <verify> section in the same way as the non-numbered ones.
2012-06-01 05:37:00 +02:00
Yang Tse b420f60a06 pop3 test server: allow pop3 test server verification to succeed again
Introduce SUPPORTCAPA and SUPPORTAUTH config commands to allow further
pop3 test server expansion for tests that require CAPA or AUTH support,
although this will need some extra work to make it fully functional.
2012-05-30 17:39:14 +02:00
Daniel Stenberg a03100c357 test1013.pl: filter out Metalink
Since it isn't a feature supported by curl-config we can't compare that
with the --version output
2012-05-27 23:43:23 +02:00
Steve Holme c267c53017 pop3: Added support for SASL based authentication mechanism detection
Added support for detecting the supported SASL authentication mechanisms
via the AUTH command. There are two ways of detecting them, either by
using the AUTH command, that will return -ERR if not supported or by
using the CAPA command which will return SASL and the list of mechanisms
if supported, not include SASL if SASL authentication is not supported
or -ERR if the CAPA command is not supported. As such it seems simpler
to use the AUTH command and fallback to normal clear text authentication
if the the command is not supported.

Additionally updated the test cases to return -ERR when the AUTH command
is encountered. Additional test cases will be added when support for the
individual authentication mechanisms is added.
2012-05-27 19:09:38 +01:00
Tatsuhiro Tsujikawa b061fed981 Made -D option work with -O and -J.
To achieve this, first new structure HeaderData is defined to hold
necessary data to perform header-related work.  Then tool_header_cb now
receives HeaderData pointer as userdata.  All header-related work
(currently, dumping header and Content-Disposition inspection) are done
in this callback function.  HeaderData.outs->config is used to determine
whether each work is done.

Unit tests were also updated because after this change, curl code always
sets CURLOPT_HEADERFUNCTION and CURLOPT_HEADERDATA.

Tested with -O -J -D, -O -J -i and -O -J -D -i and all worked fine.
2012-05-25 23:06:08 +02:00
Daniel Stenberg 560cd62272 HTTP: empty chunked POST ended up in two zero size chunks
When doing a chunked-encoded POST with -d (CURLOPT_POSTFIELDS) and the
size of the POST was zero length, it made libcurl first send a zero
chunk and then the terminating one. This could confuse a receiver and it
should rather just send the terminating chunk as it does with this fix.

Test case 1333 is added to verify.

Bug: http://curl.haxx.se/mail/archive-2012-04/0060.html
Reported by: Arnaud Compan
2012-04-20 22:25:31 +02:00
Yang Tse ce8a321dd0 Some explicit conversion to 'long' of curl_easy_setopt() third argument
Explicit conversion to 'long' of curl_easy_setopt() third argument for options
CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH given that this is how its bitmasks are
docummented to be used.
2012-04-18 21:03:20 +02:00
Yang Tse 3833765ba5 build adjustments: commit 9e24b9c7 follow-up 2012-04-17 13:29:12 +02:00
Kamil Dudka 4c385cf896 tests/valgrind.pm: suppress memleaks of NSS_InitContext()
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=745224
2012-04-16 20:11:47 +02:00
Yang Tse 48d13b44c6 headers: require GCC 2.7 or newer in order to allow attribute GCC'isms usage
Usage in other code paths already protected and requiring even newer versions.
2012-04-14 15:12:30 +02:00
Yang Tse 4d2c3f0a4d testcurl.pl: build example programs for Android cross-compiles 2012-04-13 19:33:45 +02:00
Yang Tse 1c3a99b52c testcurl.pl: build example programs for MinGW cross-compiles 2012-04-12 21:21:10 +02:00
Yang Tse 8ed40acac6 testcurl.pl: log more environment vars that modify configure and build behavior 2012-04-12 17:11:17 +02:00
Yang Tse 38ae6ec1a2 configure: NATIVE_WINDOWS no longer defined in config files 2012-04-12 13:08:48 +02:00
Yang Tse 9e24b9c7af build adjustments: CURL_HIDDEN_SYMBOLS no longer defined in config files
configure script now provides conditional definitions for Makefile.am
that result in CURL_HIDDEN_SYMBOLS being defined by resulting makefiles
when appropriate.

Additionally, configure script option for symbol hiding control is now
named --enable-symbol-hiding --disable-symbol-hiding. While still valid,
old option name --enable-hidden-symbols --disable-hidden-symbols will
be deprecated in some future release.
2012-04-11 19:33:54 +02:00
Yang Tse a144bb8b76 build adjustments: functionally revert commits 4d3fb91f and bbfe1182
Undefining CURL_HIDDEN_SYMBOLS in source files isn't the proper fix.
2012-04-11 19:28:40 +02:00
Yang Tse 4d3fb91fb4 test servers: build adjustment
Undefine CURL_HIDDEN_SYMBOLS libcurl private preprocessor macro that might
leak from lib/setup.h into source files where this should not be defined.
2012-04-10 17:32:06 +02:00
Yang Tse bbfe118209 libtests: build adjustment
Undefine CURL_HIDDEN_SYMBOLS libcurl private preprocessor macro that might
leak from lib/setup.h into source files where this should not be defined.
2012-04-10 17:29:37 +02:00
Yang Tse 21423497ef configure: Windows cross-compilation fixes
BUILDING_LIBCURL and CURL_STATICLIB are no longer defined in curl_config.h,
configure will generate appropriate conditionals so that mentioned symbols
get defined and used in Makefiles at compilation time
2012-04-09 21:24:16 +02:00
Daniel Stenberg 1dd69921d3 test: added test 1332 that tests --post303 2012-04-05 23:37:16 +02:00
Daniel Stenberg a0b3535735 test1331: cookies on a 407 response
Verify that cookies are sent back even after a 407 response has been
received
2012-04-05 23:22:15 +02:00
Yang Tse e7661d198f lib599.c: fix compiler warning 2012-04-04 17:24:29 +02:00
Daniel Stenberg 13c7b91133 runtests: yassl and polarssl are not openssl
Don't set the "has_openssl" variable if yassl or polarssl is found as
they will simply not work as 100% drop-in replacements for some of the
stuff the "OpenSSL" feature is used for.

I spotted this problem when doing test runs with PolarSSL builds.
2012-04-04 00:07:26 +02:00
Daniel Stenberg c44d45db86 HTTP: reset expected DL/UL sizes on redirects
With FOLLOWLOCATION enabled. When a 3xx page is downloaded and the
download size was known (like with a Content-Length header), but the
subsequent URL (transfered after the 3xx page) was chunked encoded, then
the previous "known download size" would linger and cause the progress
meter to get incorrect information, ie the former value would remain
being sent in. This could easily result in downloads that were WAY
larger than "expected" and would cause >100% outputs with the curl
command line tool.

Test case 599 was created and it was used to repeat the bug and then
verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3510057
Reported by: Michael Wallner
2012-04-01 00:07:24 +02:00
Yang Tse 459435dca1 test #1405: support HTTP disabled builds 2012-03-26 23:54:27 +02:00
Steve Holme 3fdb7808ef test #809: Updated error code to match recent pop3 changes 2012-03-26 21:08:16 +01:00
Yang Tse 456d8db35e tests #1316 #1319 #1320 #1321: add missing keywords 2012-03-23 18:31:29 +01:00
Yang Tse e952a7e710 test #598: add missing keywords 2012-03-23 18:15:34 +01:00
Yang Tse b8b2cf612b tests #1400 #1401: add missing keywords 2012-03-22 18:32:19 +01:00
Yang Tse d2e5222ebc test #598: add to Makefile.am 2012-03-22 04:59:16 +01:00
Yang Tse 3aab542e77 test #598: OOM handling fixes 2012-03-22 04:58:38 +01:00
Yang Tse 3c80309c27 fix several compiler warnings 2012-03-22 04:54:04 +01:00
Daniel Stenberg 805788e043 SWS: refuse to serve CONNECT unless running as proxy 2012-03-22 00:12:37 +01:00
Yang Tse c6825b7a6b fix several compiler warnings 2012-03-20 18:28:24 +01:00
Yang Tse e6a89cb6c4 tests 140X: fix --libcurl generated source file reading mode for MSYS builds 2012-03-18 05:56:07 +01:00
Daniel Stenberg 1a7bba1975 test: --libcurl fixes
The line endings broke when I saved the three recent patches (my fault,
not Colin's) to 'git am' them.

Adjusted the stripping of the test program for comparing to also exclude
the SSH key file name as that will differ and use a local path name.
2012-02-23 23:16:58 +01:00
Colin Hogben 21130dab4f Add helper script convsrctest.pl to manipulate --libcurl tests.
The intention is to take the output of curl's --libcurl option,
as exercised in test 14xx, and generate a corresponding test15xx
in which the generated code is compiled and run.  This will verify
that the generated code behaves equivalently to the original
invocation of the curl command.

The script is not yet integrated into the configure / makefile
machinery.
2012-02-23 22:33:06 +01:00
Colin Hogben c3cae332c5 Add tests for curl's --libcurl output.
These tests check the output of the --libcurl option of curl,
including the improved option handling added in a related patch.
2012-02-23 22:33:02 +01:00
Daniel Stenberg 77a21ff623 pop3 test server: send terminating ".CRLF" only
With commit 035ef06bda applied, the test pop3 server needs to send
".\r\n" as the body terminating sequence and there needs to be a final
CRLF in the actual body in the test data file.
2012-02-21 22:24:44 +01:00
Daniel Stenberg ecc93caaeb parse_proxy: bail out on zero-length proxy names!
The proxy parser function strips off trailing slashes off the proxy name
which could lead to a mistaken zero length proxy name which would be
treated as no proxy at all by subsequent functions!

This is now detected and an error is returned. Verified by the new test
1329.

Reported by: Chandrakant Bagul
Bug: http://curl.haxx.se/mail/lib-2012-02/0000.html
2012-02-10 16:26:20 +01:00
Daniel Stenberg ea055407fa curl_easy_reset: reset the referer string
When CURLOPT_REFERER has been used, curl_easy_reset() did not properly
clear it.

Verified with the new test 598

Bug: http://curl.haxx.se/bug/view.cgi?id=3481551
Reported by: Michael Day
2012-02-07 23:07:43 +01:00
Daniel Stenberg 65103efe49 curl tool: don't abort glob-loop due to failures
We want to continue to the next URL to try even on failures returned
from libcurl. This makes -f with ranges still get subsequent URLs even
if occasional ones return error. This was a regression as it used to
work and broke in the 7.23.0 release.

Added test case 1328 to verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3481223
Reported by: Juan Barreto
2012-02-06 16:52:17 +01:00
Yang Tse e277d3b52b test harness: update stunnel.pem Diffie-Hellman parameters from 512 to 1024 bit 2012-01-25 11:50:44 +01:00
Daniel Stenberg c11c30a8c8 tests: test CRLF in URLs
Related to the security vulnerability: CVE-2012-0036

Bug: http://curl.haxx.se/docs/adv_20120124.html
2012-01-24 08:54:26 +01:00
Yang Tse a7e8f4aabc testtrace.c: fix compiler warning 2012-01-19 22:54:57 +01:00
Colin Hogben 5d70a61b94 Add two tests for telnet: URLs
Add simple telnet tests which (ab)use the http server.
The second test checks for an input file handling bug.
2012-01-18 22:20:33 +01:00
Yang Tse 24526d0c0f tests: enable time tracing on tests 500, 573 and 585 2012-01-17 21:33:17 +01:00
Yang Tse a752850acc tests: testtrace.[ch] provides debug callback for libtest usage
Allows tests from the libtest subdir to generate log traces
similar to those of curl with --tracetime and --trace-ascii
options but with output going to stderr.
2012-01-17 21:32:05 +01:00
Yang Tse 2b9fafd622 sws.c: fix proxy mode secondary connection monitoring condition 2012-01-17 12:28:28 +01:00
Yang Tse b15024be4d sws.c: improve proxy mode torture testing support - followup to 18c6c8a5 2012-01-16 19:01:35 +01:00
Yang Tse 18c6c8a5e7 sws.c: improve proxy mode torture testing support - followup to c731fc58 2012-01-16 12:30:03 +01:00
Yang Tse c731fc58ea sws.c: improve proxy mode torture testing support - followup to d4bf87dc 2012-01-15 20:13:32 +01:00
Daniel Stenberg f1092b387e test: verify HTTP response code 308
This newly speced HTTP status code already works as intended in the new
spec:
http://greenbytes.de/tech/webdav/draft-reschke-http-status-308-02.html

Test 1325 is added to verify that the method is kept after the redirect
2012-01-14 16:34:59 +01:00
Yang Tse d4bf87dc0e sws.c: improve proxy mode torture testing support 2012-01-13 05:13:48 +01:00
Yang Tse 123c92c904 sws.c: replace sleep() usage with wait_ms() 2012-01-09 22:50:47 +01:00
gsengun d28411c3cc FTP: CURLE_PARTIAL_FILE should not cause control connection to be closed
Test 161 updated accordingly
2012-01-09 22:50:20 +01:00
Yang Tse 2705af6267 sws.c: some compiler warning fixes 2012-01-08 19:28:46 +01:00
Yang Tse dd69a3e868 sws.c: 812fa73057 follow-up 2012-01-06 01:52:45 +01:00
Yang Tse 812fa73057 sws.c: some IPv6 proxy mode peparatory adjustments 2012-01-05 20:52:48 +01:00
Yang Tse 8ef7a5706e test1320 test1321: avoid User-Agent comparison 2012-01-04 19:34:52 +01:00
Yang Tse c358bab809 httpserver.pl: reorder sws command line options
make 'pidfile' and 'logfile' options appear first on command line in order
to ensure that processing of other options which write to logfile do this
to intended file and not the default one.
2012-01-04 19:28:22 +01:00
Yang Tse 4bc6c1a026 sws.c: fix proxy mode segfault 2012-01-04 19:14:19 +01:00
Daniel Stenberg 2f4a487a68 tests: test IMAP, POP3 and SMTP over HTTP proxy tunnel 2012-01-03 16:12:58 +01:00
Daniel Stenberg 82180643f4 test proxy supports CONNECT
There's a new 'http-proxy' server for tests that runs on a separate port
and lets clients do HTTP CONNECT to other ports on the same host to
allow us to test HTTP "tunneling" properly.

Test cases now have a <proxy> section in <verify> to check that the
proxy protocol part matches correctly.

Test case 80, 83, 95, 275, 503 and 1078 have been converted. Test 1316
was added.
2012-01-03 15:01:22 +01:00
Yang Tse 63e2718f8d runtests.pl: on test failure, don't show trace log files of other tests 2012-01-02 13:40:12 +01:00
Daniel Stenberg 08107111ac runtests: put trace outputs in log/trace[num] for all tests 2012-01-01 19:48:24 +01:00
Daniel Stenberg 207cf15032 changed case: use new host name for subsequent HTTP requests
When a HTTP connection is re-used for a subsequent request without
proxy, it would always re-use the Host: header of the first request. As
host names are case insensitive it would make curl send another host
name case that what the particular request used.

Now it will instead always use the most recent host name to always use
the desired casing.

Added test case 1318 to verify.

Bug: http://curl.haxx.se/mail/lib-2011-12/0314.html
Reported by: Alex Vinnik
2011-12-31 10:45:28 +01:00
Dan Fandrich 9e3f8c4850 runtests.pl: Use logmsg more consistently 2011-12-31 00:49:34 -08:00
Yang Tse ed0364343d removed trailing whitespace 2011-12-30 03:36:18 +01:00
Yang Tse 5c0ad9581d ftpserver.pl: arbitrary application data splitting among TCP packets [II]
Take in account that 'pingpong' server commands may arrive splitted among
several sockfilt 'DATA' PDU's.
2011-12-29 23:40:06 +01:00
Yang Tse e99128a5c9 ftpserver.pl: arbitrary application data splitting among TCP packets [I]
Initial step in order to allow our pingpong server to better support arbitrary
application data splitting among TCP packets. This first commit only addresses
reasembly of data that sockfilter processes reads from soockets and pingpong
server later reads from sockfilters stdout.
2011-12-28 23:04:23 +01:00
Yang Tse 33c2e1cafc testcurl.pl: 82c344a3 follow-up 2011-12-27 13:23:47 +01:00
Yang Tse 84f736981c testcurl.pl: log ACLOCAL_FLAGS 2011-12-26 17:09:44 +01:00
Yang Tse 82c344a347 testcurl.pl: third party m4 warnings filtering adjustment
Make testcurl.pl ignore messages pertaining to third party m4 files we don't
care nor use on a file basis policy while retaining all other warnings.

This closes temporary commit e71e226f
2011-12-26 17:01:04 +01:00
Daniel Stenberg 3e4181f88e new test: verify --resolve
Test 1317 verifies --resolve (leaked memory)

Bug: http://curl.haxx.se/bug/view.cgi?id=3463121
Reported by: "tw84452852"
2011-12-23 14:46:20 +01:00
Yang Tse e71e226f6b testcurl.pl: temporary change
Allow autobuilds to run a couple of days without filtering out aclocal
underquoted definition warnings.
2011-12-23 11:13:39 +01:00
Dan Fandrich ba238e3a18 runtests.pl: Fixed perl warning when using the -l option 2011-12-20 18:31:53 -08:00
Gokhan Sengun c834213ad5 FTP: perform active connections non-blocking
1- Two new error codes are introduced.

CURLE_FTP_ACCEPT_FAILED to be set whenever ACCEPTing fails because of
FTP server connected.

CURLE_FTP_ACCEPT_TIMEOUT to be set whenever ACCEPTing timeouts.

Neither of these errors are considered fatal and control connection
remains OK because it could just be a firewall blocking server to
connect to the client.

2- One new setopt option was introduced.

CURLOPT_ACCEPTTIMEOUT_MS

It sets the maximum amount of time FTP client is going to wait for a
server to connect. Internal default accept timeout is 60 seconds.
2011-12-20 20:30:02 +01:00
Daniel Stenberg e9040f2954 lib500: verify timers relative each other
As commit ce896875f8 fixed a timer that accidentally had been moved in
code and then returned a bad timer, the lib500.c code (used in test 500
and some others) now verifies 5 timers against each other to verify that
they have the correct relative values. We cannot compare against
absolute values as the timings will vary a lot.
2011-12-20 15:41:43 +01:00
Daniel Stenberg 7b8590d1f5 curl -F: fix multiple file upload with custom type
Test case 1315 was added to verify this functionality. When passing in
multiple files to a single -F, the parser would get all confused if one
of the specified files had a custom type= assigned.

Reported by: Colin Hogben
2011-12-16 11:43:25 +01:00
Colin Hogben 9b185aac43 New test for multiple file upload
test 1315 checks correct behaviour when uploading multiple files.
Buggy behaviour has been seen where only two attachments are sent.
2011-12-16 11:39:53 +01:00
Colin Hogben 7111ca6f5f Correct substitution var names
Two variable names were wrong in the documentation.
2011-12-15 17:27:51 +01:00
Gokhan Sengun 2b24dd870e multi interface: fix block when CONNECT_ONLY option is used 2011-12-07 15:37:05 +01:00
Daniel Stenberg d5b5f64bce FTP: close callback fix
Keep track of which sockets that are the result of accept() calls and
refuse to call the closesocket callback for those sockets. Test case 596
now verifies that the open socket callback is called the same number of
times as the closed socket callback for active FTP connections.

Bug: http://curl.haxx.se/mail/lib-2011-12/0018.html
Reported by: Gokhan Sengun
2011-12-05 12:34:27 +01:00
Daniel Stenberg 088ba97a24 FTP: call opensocket callback properly
When the new socket is created for an active connection, it is now done
using the open socket callback.

Test case 596 was modified to run fine, although it hides the fact that
the close callback is still called too many times, as it also gets
called for closing sockets that were created with accept().
2011-12-05 11:42:10 +01:00
Daniel Stenberg 5971d401d4 test: verify the opensocket callback for FTP
test 595: for passive FTP
test 596: for active FTP
2011-12-04 23:10:12 +01:00
Daniel Stenberg 83350c9cc4 test 815: verify POP3 dot-first-on-line unescaping 2011-12-01 10:20:42 +01:00
Daniel Stenberg af64666434 POP3: detect when LIST returns no mails
By making sure the function can detect an "end of body" sequence
immediately on the first line, test 811 is now enabled.
2011-11-29 13:43:46 +01:00
Daniel Stenberg 2d72489f0f ftpserver: output CRLF in logs
Previously the log function would just filter out all CR and LF
occurances from the log to make it more readable. This had the downside
that it made it very hard to see CR LFs when they actually matters.

Now, they're instead converted to "[CR]" and "[LR]" in the log to become
apparent to readers.
2011-11-29 13:43:12 +01:00
Daniel Stenberg dda815b776 POP3: fix end of body detection
Curl_pop3_write() now has a state machine that scans for the end of a
POP3 body so that the CR LF '.' CR LF sequence can come in everything
from one up to five subsequent packets.

Test case 810 is modified to use SLOWDOWN which makes the server pause
between each single byte and thus makes the POP3 body get sent to curl
basically one byte at a time.
2011-11-29 00:25:21 +01:00
Daniel Stenberg 8d3efb6be0 test: added POP3 test with dot-prefixed line
Test 815 is disabled for now since libcurl currently doesn't unescape
such lines the way it should. See mail:

http://curl.haxx.se/mail/lib-2011-11/0324.html
2011-11-28 23:34:16 +01:00
Daniel Stenberg 71ce2470dc test 1211: FTP test to repeat bug #3429299
"Active FTP hangs if server does not open data connection"

The server first sends a 150 and then when libcurl waits for the data
transfer, the server sends a 425.
2011-11-25 23:15:58 +01:00
Daniel Stenberg ac54d27d4b FTP tests 1206 - 1209: don't expect QUIT
The protocol parts for these tests do not include QUIT simply because
the error is CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout
error without specificly saying for which connection it concerns, and
for timeouts libcurl marks the control channel as "invalid". As this
test case times out for the data connection it could still use the
control channel.
2011-11-25 22:49:49 +01:00
Yang Tse 97d7a9260e tvdiff_secs(): sub-zero time difference adjustment
Skip a floating point addition operation when integral part of time difference
is zero. This avoids potential floating point addition rounding problems while
preserving decimal part value.
2011-11-25 13:51:55 +01:00
Jonas Schnelli 2c905fd1f8 query-part: ignore the URI part for given protocols
By setting PROTOPT_NOURLQUERY in the protocol handler struct, the
protocol will get the "query part" of the URL cut off before the data is
handled by the protocol-specific code. This makes libcurl adhere to
RFC3986 section 2.2.

Test 1220 is added to verify a file:// URL with query-part.
2011-11-24 23:31:19 +01:00
Yang Tse c482e946f7 lib573.c: fix double data type variable comparison with zero 2011-11-24 18:18:42 +01:00
Daniel Stenberg c532604b13 -J -O: use -O name if no Content-Disposition header comes!
A regression between 7.22.0 and 7.23.0 -- downloading a file with the
flags -O and -J results in the content being written to stdout if and
only if there was no Content-Disposition header in the http response. If
there is a C-D header with a filename attribute, the output is correctly
written.

Reported by: Dave Reisner
Bug: http://curl.haxx.se/mail/archive-2011-11/0030.html
2011-11-20 23:35:49 +01:00
Jonas Schnelli c0db5ff678 test: SFTP quote commands with * prefix
Related to the f64812ca63 commit
2011-11-18 20:30:46 +01:00
Jonas Schnelli f64812ca63 SFTP: support '*' prefix for quote operations
prefixing a command with '*' means it is allowed to fail without
aborting the chain actions
2011-11-18 16:04:52 +01:00
Alejandro Alvarez Ayllon 97b73fec7a libtest build: add the missing lib586 2011-11-17 23:33:42 +01:00
Yang Tse 082e8a3b03 Active mode FTP test cases with server not establishing data connection
591 -> FTP multi PORT and 425 on upload
592 -> FTP multi PORT and 421 on upload
593 -> FTP multi PORT upload, no data conn and no transient neg. reply
594 -> FTP multi PORT upload, no data conn and no positive prelim. reply

1206 -> FTP PORT and 425 on download
1207 -> FTP PORT and 421 on download
1208 -> FTP PORT download, no data conn and no transient negative reply
1209 -> FTP PORT download, no data conn and no positive preliminary reply
2011-11-11 19:46:44 +01:00
Daniel Stenberg 2c09d21fdf test 590: verify the bug fix in 4851dafcf1
This test is created to verify Rene Bernhardt's patch which makes sure
libcurl properly _not_ deals with Negotiate if not asked to even if the
proxy says it can serve it.
2011-11-06 17:28:28 +01:00
Yang Tse 3f5e267b9d FTP test server: NODATACONN commands follow-up
Make NODATACONN425 and NODATACONN421 return a 150 positive preliminary reply
before 425 or 421.

New NODATACONN150 returns 150 without further positive nor negative reply

Now NODATACONN doesn't reply anything at all.
2011-11-02 13:38:31 +01:00
Yang Tse af425efe83 FTP test server: NODATACONN commands follow-up
Make NODATACONN custom commands apply to both active and passive FTP,
and ensure 425 and 421 are not returned unless data channel usage is
attempted.
2011-11-01 14:11:36 +01:00
Yang Tse 8bfc3a800a FTP test server: NODATACONN commands commit c761fcb0 follow-up
Adjustments that make NODATACONN custom commands fully usable.
2011-10-31 07:29:13 +01:00
Yang Tse 0b315c1cf1 FTP test server: fix server unresponsiveness
Some torture tests left FTP test server in an unresponsive state, resulting
in torture tests that actually completed following unexpected code paths.

Changes in this commit solely address this issue and some adjustments for
ftpserver.pl logging relative to data channel establishment and tear down.
Pending NODATACONN relative adjustments reserved for a further commit.
2011-10-30 17:12:20 +01:00
Yang Tse e2928e1555 runtests.pl: running server checks - commit 4464583a follow-up
Ensure verification takes place with no server commands file.
Ignore verbose setting for running server precheck.
Tweak unresponsive server message, to allow detection by haxx.se scripts.
2011-10-30 16:45:14 +01:00
Yang Tse bae4e3f035 runtests.pl: running server checks - commit 3676ec96 follow-up
Fix called sub when checking TFTP server, and adjust message.
2011-10-28 15:59:36 +02:00
Yang Tse 3676ec9680 runtests.pl: running server checks - commit 4464583a follow-up
Extended server checks to others in addition to pingpong when torture testing.
2011-10-28 00:05:16 +02:00
Yang Tse 8ccf7bf8d7 lib589.c: add CURLOPT_READDATA missing stuff 2011-10-27 22:00:23 +02:00
Yang Tse c761fcb055 ftpserver.pl: three new custom FTP server commands to disable data channel
NODATACONN421: applies only to active FTP mode, instructs server to not
establish data connection back to client and reply with FTP 421.

NODATACONN425: applies only to active FTP mode, instructs server to not
establish data connection back to client and reply with FTP 425.

NODATACONN: applies to both active and passive FTP modes, instructs server
to not establish nor accept a data channel and fool client into believing
that the data channel connection is possible.

Some polishing probably required.
2011-10-27 21:59:00 +02:00
Yang Tse 692f344118 test 589: active FTP upload using multi timeout and EPRT disabled server 2011-10-26 18:57:14 +02:00
Yang Tse 51e5a2bf3f multi tests: OOM handling fixes - commit 629d2e34 follow-up 2011-10-26 18:57:14 +02:00
Yang Tse 4464583a6e runtests.pl: running server checks
When running torture tests, verify before each test case that required
pingpong servers which are supposed to be alive are actually responsive.
If found not responsive then restart them.
2011-10-25 23:19:36 +02:00
Daniel Stenberg 22502c9550 dist: add test 587
I created test 587 in commit 840eff44f2 but forgot to add the file to
the tarball. Added now.
2011-10-24 23:09:59 +02:00
Daniel Stenberg 39c6d18d9c test 588: verify active FTP with multi interface without EPRT
This is using the verbatim 525 test code but it disables EPRT in the
server and this should work just as well anyway.
2011-10-24 23:08:16 +02:00
Daniel Stenberg f4405d30e0 FTP server: allow EPRT by default
EPRT is now supported by default by the server. To disable it, use the
generic REPLY instruction in the <servercmd> tag. Test 116 now has it
disabled. All other existing active FTP port tests strip out the port
commands from the logs already so the change of the server isn't that
noticable.
2011-10-24 23:07:53 +02:00
Yang Tse 134e87c53b ftpserver.pl: ensure integral number usage for passive mode string 2011-10-24 20:45:12 +02:00
Daniel Stenberg 515f11e79b large headers: have curl accept >16K headers
As commit 5850cc4808 clarifies, libcurl can deliver header lines that
are longer than CURL_MAX_WRITE_SIZE, only body data is limited to that
size. The curl tool has check (when built debug-enabled) that made the
wrong checks and this new test 1205 verifies that larger headers work.
2011-10-24 17:28:41 +02:00
Dan Fandrich d67b75c9f9 Added some missing test case XML tags and keywords 2011-10-21 13:33:40 -07:00
Yang Tse 9d0d1ada05 runtests.pl: fix printing of multivalued error codes 2011-10-21 16:52:15 +02:00
Yang Tse 629d2e3450 multi tests: OOM handling fixes
Additionally, improved error checking and logging.
2011-10-21 16:52:14 +02:00
Daniel Stenberg ff0a295cdb Curl_http_input_auth: handle multiple auths in WWW-Authenticate
The fix is pretty much the one Nick Zitzmann provided, just edited to do
the right indent levels and with test case 1204 added to verify the fix.

Bug: http://curl.haxx.se/mail/lib-2011-10/0190.html
Reported by: Nick Zitzmann
2011-10-20 13:12:02 +02:00
Dan Fandrich cf0f6729e7 Silenced a compiler warning about an unused variable 2011-10-19 21:18:52 -07:00
Daniel Stenberg 840eff44f2 formdata: ack read callback abort
When doing a multipart formpost with a read callback, and that callback
returns CURL_READFUNC_ABORT, that return code must be properly
propagated back and handled accordingly. Previously it would be handled
as a zero byte read which would cause a hang!

Added test case 587 to verify. It uses the lib554.c source code with a
small ifdef.

Reported by: Anton Bychkov
Bug: http://curl.haxx.se/mail/lib-2011-10/0097.html
2011-10-16 01:09:56 +02:00
Yang Tse fd10c047df sws.c: HTTP and GOPHER test server-side connection closing adjustment
When, for a given test, server is instructed to close connection after
server reply we now wait a very small amount of time (50ms) before doing
so. This is done to allow client to, at least partially, read server
reply before getting an ECONNRESET.

The above is required to make test cases 1070, 1200, 1201 and 1202 pass
with Cygwin 1.5.X on W2K.

GOPHER test server closes connection after _every_ server-reply, as such,
at some point it could require a bigger time or using shutdown() before
a server-side initiated disconnection.
2011-10-14 17:33:05 +02:00
Yang Tse a84b8a3922 lib540.c: OOM handling fixes making test 540 pass torture testing 2011-10-10 12:27:17 +02:00
Yang Tse 17f48fe879 libcurl: some OOM handling fixes 2011-10-07 20:50:57 +02:00
Yang Tse 1958fe5745 test harness: non-stunnel https server integration overhaul 2011-10-06 20:26:42 +02:00
Alejandro Alvarez 5793bc370c SSL session sharing support added
With locking, plus test, plus documentation
2011-09-28 23:06:34 +02:00
Daniel Stenberg bd158607ca tests/README: extended and reformatted 2011-09-27 22:14:24 +02:00
Daniel Stenberg e9cf4cb791 test 814: smtp without --mail-from
Verifies the fix from commit 322f3d5af7
2011-09-21 22:32:27 +02:00
Daniel Stenberg 81b41095ef Curl_follow: handle redirects to "//hostname/path" 2011-09-20 11:16:40 +02:00
warp kawada aff70e2e95 Curl_add_custom_headers: support headers with no data
A custom HTTP header ending in a semicolon instead of a colon
will be treated as a header to be added without any data
portion.
2011-09-13 16:17:21 -07:00
Yang Tse 0413e24891 runtests.pl: replace TAB with spaces 2011-09-10 01:23:21 +02:00
Yang Tse be8e68494c test harness: revert needless commit 0a5bbb2ac1
https, ftps and ssh servers allowed start up time back to previous values
2011-09-10 01:14:52 +02:00
Yang Tse 28d09cb0f5 lib582.c: fix segfault triggered when torture testing test case 582 2011-09-08 01:22:47 +02:00
Yang Tse 6539047694 test case 583: ensure that test failures don't go unnoticed - follow-up 2011-09-06 19:59:42 +02:00
Yang Tse 774ad4e31d test suite: libtest header inclusion cleanup - follow-up
Adjust tests/libtest/Makefile.inc and remove a couple of unused headers from
tests/libtest/lib583.c
2011-09-06 18:11:11 +02:00
Yang Tse f764da8afb test case 583: ensure that test failures don't go unnoticed 2011-09-06 17:56:39 +02:00
Yang Tse c8ba8740b9 test suite: libtest header inclusion cleanup
Added missing memoryTracking to test cases 560 and 583. If this triggers
leak detection on these, it only means that previously it was going unnoticed.
2011-09-06 17:47:54 +02:00
Yang Tse a50210710a fix bool variables checking and assignment 2011-09-05 20:46:09 +02:00
Yang Tse eb44ac0138 test suite: use test case specific netrc file names 2011-09-05 12:39:50 +02:00
Yang Tse 6b75d2c2df fix a bunch of MSVC compiler warnings 2011-09-03 16:07:09 +02:00
Yang Tse 0a5bbb2ac1 test harness: https, ftps and ssh servers allowed start up time increased 33% 2011-09-01 22:21:57 +02:00
Yang Tse 437848d754 test harness: fix detection of test harness client knownhosts file
Regenerate curl's tests client knownhosts file also when, somehow,
this file is empty.
2011-08-31 19:59:26 +02:00
Yang Tse 38fff918f9 test harness: fix detection of test harness host and client key files
Regenerate curl's tests host and client key files also when, somehow,
any of these files are empty.
2011-08-31 18:16:14 +02:00
Kamil Dudka 3445fa2e3f tests: break busy loops in tests 502, 555, and 573 2011-08-29 15:14:39 +02:00
Yang Tse b976d108f1 NTLM_WB: final congruency naming adjustments
Configure script option --enable-wb-ntlm-auth renamed to --enable-ntlm-wb
Configure script option --disable-wb-ntlm-auth renamed to --disable-ntlm-wb

Preprocessor symbol WINBIND_NTLM_AUTH_ENABLED renamed to NTLM_WB_ENABLED
Preprocessor symbol WINBIND_NTLM_AUTH_FILE renamed to NTLM_WB_FILE

Test harness env var CURL_NTLM_AUTH renamed to CURL_NTLM_WB_FILE

Static function wb_ntlm_close renamed to ntlm_wb_cleanup
Static function wb_ntlm_initiate renamed to ntlm_wb_init
Static function wb_ntlm_response renamed to ntlm_wb_response
2011-08-27 06:31:18 +02:00
Yang Tse b4f6319cf7 NTLM single-sign on adjustments (XI)
Feature string literal NTLM_SSO renamed to NTLM_WB.
Preprocessor symbol USE_NTLM_SSO renamed to WINBIND_NTLM_AUTH_ENABLED.
curl's 'long' option 'ntlm-sso' renamed to 'ntlm-wb'.
Fix some comments to make clear that this is actually a NTLM delegation.
2011-08-27 01:33:35 +02:00
Yang Tse fd00b382b2 base64: fix Curl_base64_encode and Curl_base64_decode interfaces
Previous interfaces for these libcurl internal functions did not allow to tell
apart a legitimate zero size result from an error condition. These functions
now return a CURLcode indicating function success or otherwise specific error.
Output size is returned using a pointer argument.

All usage of these two functions, and others closely related, has been adapted
to the new interfaces. Relative error and OOM handling adapted or added where
missing. Unit test 1302 also adapted.
2011-08-24 08:10:30 +02:00
Yang Tse a659cc4794 runtests.pl: option -gw for single test windowed debugging (where possible) 2011-08-21 19:25:35 +02:00
Yang Tse 838dd8f594 MemoryTracking: adjust initialization calling - followup
Fix macro definition
2011-08-21 06:10:52 +02:00
Yang Tse aaab5fa299 MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
2011-08-20 17:26:42 +02:00
Daniel Stenberg 7b054a42aa test573: fix the keywords 2011-08-19 00:15:37 +02:00
Daniel Stenberg ef2059a44c test572: fixed
Two problems were fixed:

GET_PARAMETER responses that have no body must be 204 response or
properly set length to 0.

One of the <data> sections had the wrong content-length for its
GET_PARAMETER response.

Enabled test 572 again.
2011-08-15 22:40:28 +02:00
Yang Tse 6a7ce5cc76 tests: disable #572 2011-08-15 00:20:32 +02:00
Daniel Stenberg 7c21c1c4f9 cookie parser: handle 'secure='
There are two keywords in cookie headers that don't follow the regular
name=value style: secure and httponly. Still we must support that they
are written like 'secure=' and then treat them as if they were written
'secure'. Test case 31 was much extended by Rob Ward to test this.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
Reported by: "gnombat"
2011-08-09 14:02:05 +02:00
Daniel Stenberg 45d883d88d CURLFORM_BUFFER: insert filename as documented
A regression where CURLFORM_BUFFER stopped to properly insert the file
name part in the formpart. Bug introduced in commit f851f76857.

Added CURLFORM_BUFFER use to test 554 to verify this.

Bug: http://curl.haxx.se/mail/lib-2011-07/0176.html
Reported by: Henry Ludemann
2011-08-08 18:45:03 +02:00
Daniel Stenberg afe88d85f4 test710: verify that --proxy socks5://hostname works 2011-08-05 00:46:59 +02:00
Daniel Stenberg 75fa3d2d6e test709: HTTP GET via SOCKS5 set in environment 2011-08-05 00:28:03 +02:00
Daniel Stenberg 86b50a1fe5 test1313: test content-disposition with uneven quotes 2011-08-04 23:25:55 +02:00
Daniel Stenberg 519d0c0dd2 -J: support ';' in quoted file names
Content-disposition headers can provide file names with semicolons which
previously would be cut off at that point.

Added test case 1311 and 1312 to verify -J.

Bug: http://curl.haxx.se/bug/view.cgi?id=3375603
Reported by: Peter Hjalmarsson
2011-08-04 17:48:45 +02:00
Daniel Stenberg d2c22411af getpart.pm: when no part match, return blank when section ends 2011-08-04 17:36:31 +02:00
Daniel Stenberg c4142034ff runtests.pl: support option=no-include 2011-08-04 17:36:00 +02:00
Yang Tse 10a0bed485 NTLM single-sign on adjustments (VIII)
Use preprocessor symbols WINBIND_NTLM_AUTH_ENABLED and WINBIND_NTLM_AUTH_FILE
for Samba's winbind daemon ntlm_auth helper code implementation and filename.

Retain preprocessor symbol USE_NTLM_SSO for NTLM single-sign-on feature
availability implementation independent.

For test harness, prefix NTLM_AUTH environment vars with CURL_

Refactor and rename configure option --with-ntlm-auth to --enable-wb-ntlm-auth[=FILE]
2011-07-31 20:44:41 +02:00
Dan Fandrich cc3e01cfae Renumbered test2005 to test1310
The 20xx range is for multiple sequential tests.
2011-07-29 12:35:52 -07:00
Yang Tse bcbac913d6 socketpair() usage tracking to allow fd leak detection 2011-07-29 13:27:10 +02:00
Yang Tse 5cdbfa1837 fix compiler warning 2011-07-29 13:27:08 +02:00
Yang Tse 35051d274f NTLM single-sign on adjustments (VI)
Fix compiler warning
2011-07-28 22:47:42 +02:00
Dan Fandrich 435e2bc757 Removed an extraneous \n that violated the SSO daemon protocol
This caused fake_ntlm to abort due to an invalid command
causing sporadic test 2005 failures.
2011-07-28 12:41:44 -07:00
Yang Tse 99848d3dab NTLM single-sign on adjustments (V)
Enhance test harness fake_ntlm logging upon invalid input.
2011-07-28 21:12:41 +02:00
Yang Tse dddf9aa610 NTLM single-sign on adjustments (IV)
Fix compiler warning
2011-07-27 20:10:02 +02:00
Yang Tse 6ac4eeab2f NTLM single-sign on adjustments (II)
Ensure test harness fake_ntlm main function can properly handle arguments.
2011-07-27 19:04:55 +02:00
Yang Tse 8350fb8f2f NTLM single-sign on adjustments (I)
Use fake_ntlm absolute filename in NTLM_AUTH environment variable for test
2005 definition.
2011-07-27 18:58:21 +02:00
Dan Fandrich cfcca89b76 Fixed test 2005 to work in out-of-tree builds
Also, set the test number in the test data file so fake_ntlm can
be reused in future tests.
2011-07-26 12:48:16 -07:00
Yang Tse 78bbd0eecf fix compiler warning 2011-07-26 19:42:16 +02:00
Yang Tse ef2176109f errno.h inclusion conditionally done in setup_once.h 2011-07-24 04:39:43 +02:00
Daniel Stenberg 3f9b4afdfd http error response: stop sending when error is received
When libcurl has said to the server that there's a POST or PUT coming
(with a content-length and all) it has to either deliver that amount of
data or it needs to close the connection before trying a second request.

Adds test case 1129, 1130 and 1131

The bug report is about when used with 100-continue, but the change is
more generic.

Bug: http://curl.haxx.se/mail/lib-2011-06/0191.html
Reported by: Steven Parkes
2011-07-20 00:08:41 +02:00
Daniel Stenberg 0ae15092d4 test2005: require a debug build 2011-07-19 23:50:34 +02:00
Daniel Stenberg b9313af838 runtests: add 'debug' as a feature a test can require 2011-07-19 23:49:40 +02:00
Daniel Stenberg 177fd0a14c gitignore: ignore fake_ntlm 2011-07-18 23:49:31 +02:00
Mandy Wu aa26c2751a test2005: verify ntlm single-signon 2011-07-18 23:48:53 +02:00
Daniel Stenberg 650a504b2f sws: don't enable pipelining for requests with content-length
Log texts also modified and some white space edits
2011-07-17 00:39:23 +02:00
Daniel Stenberg 9c1f50c583 runtests: ignore the 'all_proxy' environment variable as well
We should probably also make sure that [protocol]_proxy for all possible
protocols libcurl supports are unset.
2011-07-14 11:04:00 +02:00
Daniel Stenberg c7a4df16e0 sws: allow multiple commands in <servercmd> 2011-07-03 19:15:06 +02:00
Daniel Stenberg fb48e2050b libtests: stop checking for CURLM_CALL_MULTI_PERFORM
CURLM_CALL_MULTI_PERFORM stopped being a valid return code from
curl_multi_perform back in 7.20.0. All the libcurl tests are ajusted to
this and no longer check for this return code. Makes them simpler.
2011-06-27 16:01:41 +02:00
Dan Fandrich 78480892cd Fixed test 1300 to pass the memory torture test 2011-06-24 12:33:30 -07:00
Dan Fandrich 17a2d70dc4 Display notes from setup file in testcurl.pl
Autobuild submitters can use this to add some text to their
setup files to describe issues they've found with the build
or tests. This could include laying blame on test failures on
network issues or dependent libraries, explaining away compiler
warnings or providing any additional information that could be
useful to people reviewing and investigating problems with the
publicly available autobuild logs.  Note that persistent test
failures that are not issues with curl itself should normally be
fixed by excluding them from the test run instead.

This is an entirely optional field that is not entered by the
user the first time a new build is created.
2011-06-23 22:49:28 -07:00
Dan Fandrich 43ce5580a8 Added a leap second test to test517 2011-06-23 21:20:29 -07:00
Daniel Stenberg 0215f7cb4d runtests.pl: warn if a test is explicitly disabled
Just to make sure a user is aware of it.
2011-06-23 23:10:00 +02:00
Daniel Stenberg 57d51be60c parsedate: detect more invalid dates better 2011-06-23 13:49:29 +02:00
Ori Avtalion af6dcc92d5 [pop3] remove extra space in LIST command
Some servers, e.g. mail.bezeqint.net:110, consider it a syntax error
2011-06-21 18:12:05 +03:00
Amr Shahin c9f16e67ef unitteset: Curl_llist_move
adding unit test for Curl_llist_move, documenting unit-tested functions
in llist.c, changing unit-test to unittest, replacing assert calls with
abort_unless calls
2011-06-19 22:22:49 +02:00
Daniel Stenberg f851f76857 CURLFORM_STREAM: acknowledge CURLFORM_FILENAME
The CURLFORM_STREAM is documented to only insert a file name (and thus
look like a file upload) in the part if CURLFORM_FILENAME is set, but in
reality it always inserted a filename="" and if CURLFORM_FILENAME wasn't
set, it would insert insert rubbish (or possibly crash).

This is now fixed to work as documented, and test 554 has been extended
to verify this.

Reported by: Sascha Swiercy
Bug: http://curl.haxx.se/mail/lib-2011-06/0070.html
2011-06-17 22:23:42 +02:00
Daniel Stenberg 0aedccc18a curl_formget: fix FILE * leak
Properly deal with the fact that the last fread() call most probably is
a short read, and when using callbacks in fact all calls can be short
reads. No longer consider a file read done until it returns a 0 from the
read function.

Reported by: Aaron Orenstein
Bug: http://curl.haxx.se/mail/lib-2011-06/0048.html
2011-06-13 22:32:00 +02:00
Dan Fandrich a6fa7fc38e Added http as a dependency of test 1308 2011-06-11 17:02:37 -07:00
Daniel Stenberg b122f8be61 test1309: added to the dist 2011-06-12 00:10:51 +02:00
Daniel Stenberg 950fb3efcc write: add return code checks when used
These were just warnings in test code but it still makes it nicer to not
generate them.
2011-06-11 23:01:09 +02:00
Dan Fandrich b688f2c260 Fixed test 1309 to pass the torture test
Removing dynamic allocations also simplifies the test.
2011-06-11 00:10:09 -07:00
Daniel Stenberg c4dd8df081 splay: add unit tests
The test code that was #ifdef'ed in the code was converted into unit
tests in test case 1309. I also removed the #if 0'ed code from splay.c
2011-06-10 20:19:35 +02:00
Daniel Stenberg 36a22f9074 unit test formpost: added test case 1308
This is a few first rather basic tests of curl_formadd() and
curl_formget(). Should serve as building blocks to add more variations
to the test.
2011-06-10 12:03:29 +02:00
Daniel Stenberg c0b9dd27b5 HTTP time condition: force closure for 200 OK
When a time condition isn't met, so that no body is delivered to the
application even though a 2xx response is being read from the server, we
must close the connection to avoid a re-use of the connection to be
completely tricked.

Added test 1128 to verify.
2011-06-07 13:40:11 +02:00
Yang Tse 2a31dde76c unit tests: attempt to fix linkage issue 2011-06-02 22:26:01 +02:00
Yang Tse aa76dec33a unit tests: more build adjustments 2011-06-01 21:40:09 +02:00
Yang Tse 685359d4c3 makefile: avoid preprocessor definition usage when linking 2011-06-01 14:43:25 +02:00
Daniel Stenberg 3d64ed25df testcurl.pl: allow configure args to use '=' 2011-05-31 13:35:26 +02:00
Yang Tse f5d78919af distribution: Fix EXTRA_DIST letter case 2011-05-27 13:37:20 +02:00
Yang Tse 5d39dea3b3 compiler warning: fix
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-26 12:40:04 +02:00
Yang Tse 9f390a356e unit tests: build adjustment
Also define UNITTESTS macro when building unit test sources.

Fixing compiler warning: external definition with no prior declaration
2011-05-25 20:24:03 +02:00
Yang Tse 9b5343054a unit tests: README, adjust header inclusion order 2011-05-24 21:23:52 +02:00
Yang Tse ec33742d1b compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:35:08 +02:00
Yang Tse 2ea31b0e6f compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:29:50 +02:00
Yang Tse de70ddb749 compiler warning: fix
Fix compiler warning: argument is incompatible with corresponding format
string conversion
2011-05-24 17:24:59 +02:00
Yang Tse 8b849265d8 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:39:42 +02:00
Yang Tse 02f3ff3b0a unit tests: adjust header inclusion order
Additionally, prevent multiple inclusions of curl_config.h
2011-05-21 13:22:11 +02:00
Yang Tse b578534508 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585: Fix opensocket return type, and avoid function name clash.
2011-05-19 22:28:28 +02:00
Daniel Stenberg 873d70a6d8 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585 and 586 were added. Using a modified lib500.c
2011-05-18 22:56:46 +02:00
Daniel Stenberg 0c8e6f598a tests: added HTTP If-Modified-Since tests
Added test 1126 and 1127 to verify curl's behaviour when If-Modified-Since
is used and a 200 is returned.

The list of test cases in Makefile.am is now sorted numerically.
2011-05-13 08:55:15 +02:00
Daniel Stenberg 3b1b26578f proxy: allow socks:// prefix in proxy string
Inspired by a patch from OB.Conseil. Added test case 708 to verify.
2011-04-28 15:08:09 +02:00
Daniel Stenberg 4a42e5cdaa multi-socks: fix connect to proxy
When connecting to a socks or similar proxy we do the proxy handshake at
once when we know the TCP connect is completed and we only consider the
"connection" complete after the proxy handshake. This fixes test 564
which is now no longer considered disabled.

Reported by: Dmitri Shubin
Bug: http://curl.haxx.se/mail/lib-2011-04/0127.html
2011-04-28 10:06:49 +02:00
Dan Fandrich d8373cb992 Fixed test 1023 when using daily snapshots 2011-04-21 14:47:35 -07:00
Dan Fandrich 7872c8d5a2 Fixed closing test tag 2011-04-20 16:51:44 -07:00
Dan Fandrich 1b6df743f6 Fixed test 1022 when using daily snapshots 2011-04-20 14:11:12 -07:00
Daniel Stenberg 8e4fb01e64 transfer-encoding: added new option and cmdline
Added CURLOPT_TRANSFER_ENCODING as the option to set to request Transfer
Encoding in HTTP requests (if built zlib enabled). I also renamed
CURLOPT_ENCODING to CURLOPT_ACCEPT_ENCODING (while keeping the old name
around) to reduce the confusion when we have to encoding options for
HTTP.

--tr-encoding is now the new command line option for curl to request
this, and thus I updated the test cases accordingly.
2011-04-18 19:46:21 +02:00
Daniel Stenberg 9d191a6a40 TE: do the Connection: header
When TE: is inserted in the request, we must add a "Connection: TE" as
well to be HTTP 1.1 compliant. If a custom Connection: header is passed
in, we must use that and only append TE to it. Test case 1125 verifies
TE: + custom Connection:.
2011-04-18 19:46:21 +02:00
Daniel Stenberg be973b6f91 test1124: verify gzip AND chunked transfer-encoding 2011-04-18 19:46:21 +02:00
Daniel Stenberg 0790b27910 HTTP: add support for gzip and deflate Transfer-Encoding
Transfer-Encoding differs from Content-Encoding in a few subtle ways,
but primarily it concerns the transfer only and not the content so when
discovered to be compressed we know we have to uncompress it. There will
only arrive compressed transfers in a response after we have requested
them with the appropriate TE: header.

Test case 1122 and 1123 verify.
2011-04-18 19:46:21 +02:00
Daniel Stenberg 82ecc85d9e curl-config: fix --version
curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b5f), and unfortunately the test
case 1022 that was supposed to check for this was broken.

This change fixes the test to detect this problem and it fixes the
output.

Bug: http://curl.haxx.se/bug/view.cgi?id=3288727
2011-04-18 09:03:12 +02:00
Chris Smowton d54668eb00 HTTP pipelining: Fix handling of zero-length responses
Also add test case 584 for the same

Bug: http://curl.haxx.se/bug/view.cgi?id=3214223
2011-04-07 14:18:07 +02:00
Dan Fandrich c22c258029 Changed some nonportable types 2011-04-05 22:31:45 -07:00
Daniel Stenberg 9680df4807 headers: more copyright headers added 2011-03-22 22:48:11 +01:00
Julien Chaffraix 8702ebff74 unit1305: Fixed the test to match our coding style. 2011-03-20 08:03:25 -07:00
Dan Fandrich 7f57fb359d Added two more POP3 tests 2011-03-18 13:59:48 -07:00
Daniel Stenberg 4b51484a68 symbol-scan.pl: detect duplicates
Test 1119 now also makes sure that symbols-in-versions doesn't contain
any duplicates
2011-03-18 15:42:58 +01:00
Dan Fandrich ef1c18b952 Added support for LISTing a single POP3 message
Added tests for a number of POP3 LIST operations, including one
that shows a curl problem when listing no messages, so is
disabled.
2011-03-17 16:59:30 -07:00
Daniel Stenberg 14e8b13a45 lib582: use curl_socket_t for portability 2011-03-15 18:37:35 +01:00
Guenter Knauf 5a433a033f Removed unused var. 2011-03-15 12:21:58 +01:00
Daniel Stenberg 6c5448d59f test 582: enabled again
Commit ca37692bf4 should now hopefully make it run
2011-03-13 14:11:48 +01:00
Daniel Stenberg e649a7baae Revert "test582: enabled"
This reverts commit b847818740.
2011-03-13 00:55:27 +01:00
Daniel Stenberg 0718b7e31e test583: verify early SSH multi remove handle
This test case is meant to verify that the logic in commit
60172a0446 actually works. This test failed for me before that
change and it works after it.
2011-03-13 00:18:04 +01:00
Daniel Stenberg b847818740 test582: enabled 2011-03-12 23:10:58 +01:00
Daniel Stenberg 7612ca2a7e test582: improved info messages 2011-03-12 23:01:16 +01:00
Daniel Stenberg 1aeb635cdd sources: update source headers
All C and H files now (should) feature the proper project curl source
code header, which includes basic info, a copyright statement and some
basic disclaimers.
2011-03-10 12:04:33 +01:00
Daniel Stenberg 08221e738d tests: phase out haxx.se
Instead of using haxx.se as a fixed magic host name in lots of tests,
this is a first step to move toward the generic example.com host
instead.
2011-03-09 23:05:44 +01:00
Daniel Stenberg 16dcd13a2a test523: avoid using haxx.se
... since search engines find what they think is a URL in this, they
hammer www.haxx.se on this port!
2011-03-09 23:05:44 +01:00
Daniel Stenberg 3d3735d9a1 lib582: used for test 582
Accidentally not included in commit 0e74e1d8d8
2011-03-08 08:22:06 +01:00
Henry Ludemann 0e74e1d8d8 sftp-multi: test 582 added
Add test 582 for uploading a file using sftp and the multi interface.

(Patch and test slightly tweaked by Daniel Stenberg)

Initially marked as disabled until it is fixed in the source.
2011-03-08 00:20:48 +01:00
Dan Fandrich c60a6153be Moved test 577 into the unit test framework as test 1307 2011-03-04 15:56:40 -08:00
Dan Fandrich 80225b08cd Added unit test 1306 so tests 558 & 559 are now fully replaced 2011-03-04 15:13:12 -08:00
Dan Fandrich bfc491a2d2 The unit test argument is allowed to be used 2011-03-04 15:11:21 -08:00
Dan Fandrich fb199cd29d Converted tests 558 & 559 to use the unit test framework as 1305
Test 558 was just a subset of 559 which is something that can be
easily added later.
2011-03-04 14:32:58 -08:00
Dan Fandrich a8aab6e7d4 Fixed test 1300 to pass the torture test 2011-03-04 13:54:04 -08:00
Dan Fandrich 32aedf1d3d Added abort_* unit test macros
These are for when a test failure makes it impossible to continue
running further tests.
2011-03-04 13:53:15 -08:00
Daniel Stenberg 2345c1dd66 runtests.pl/stopserver: space separate pids
The stopserver function would append pids to kill and could append them
without separating them with space properly. The result would be a very
large number that by (some implementations of) kill would be interpreted
as a negative number and that process group would be wiped...

Bug: http://curl.haxx.se/bug/view.cgi?id=3188836
Reported by: Greg Pratt
2011-02-22 13:42:00 +01:00
Julien Chaffraix 9f8e960a1a tests: Cleaned up netrc testing.
Removed the "netrc_debug" keyword replaced with --netrc-file additions.
Removed the debug code from Curl_parsenetrc as it is superseeded by
--netrc-file.
2011-02-20 21:11:52 -08:00
Julien Chaffraix 311bd4c7b1 netrc: Enable setting up the filename in unit tests.
Unset the environment variable so that we can specify different
filenames in the unit test.
2011-02-10 07:38:48 -08:00
Julien Chaffraix 39d0d787d2 test1304: Added some unit tests for Curl_parsenetrc.
Moved some definitons into the header file so that we can reuse them.
2011-02-10 07:38:48 -08:00
Daniel Stenberg 08a77025c6 unit1300: code style cleanup 2011-02-02 13:35:55 +01:00
Amr Shahin 7a4b5079c6 adding unit tests for Curl_llist_remove 2011-02-02 13:24:04 +01:00
Daniel Stenberg 28c830efd8 test: add test 580 to the dist 2011-01-28 00:24:47 +01:00
Daniel Stenberg 20690e412d tests: more multiple headers checks 2011-01-25 18:09:54 +01:00