Commit Graph

1295 Commits

Author SHA1 Message Date
Yang Tse 40087ce7c0 change max allowed time for this test to complete to 90 seconds 2007-03-10 00:19:05 +00:00
Dan Fandrich e12d46ac50 Updated the test harness to add a new "crypto" feature check and updated the
appropriate test case to use it.  For now, this is treated the same as the
"SSL" feature because curl doesn't list it separately.
2007-03-09 23:39:42 +00:00
Dan Fandrich 1962ebf8e7 Updated the test harness to check for protocol support before running each
test, fixing KNOWN_BUGS #11.  Fixed some tests to more accurately specify
their required servers and features.
2007-03-09 21:01:39 +00:00
Dan Fandrich 7c144d5a7e Made a few cleanups. 2007-03-08 20:00:28 +00:00
Dan Fandrich 0f0540d00b Added SSL as a required feature for test case 400. 2007-03-08 19:50:32 +00:00
Dan Fandrich 1bfa7dfe39 Added test infrastructure to support basic FTPS tests. This currently
supports only ftps:// URLs with --ftp-ssl-control specified, which
implicitly encrypts the control channel but not the data channels.  That
allows stunnel to be used with an unmodified ftp server in exactly the
same way that the test https server is set up.
Added test case 400 as a basic FTPS test.
2007-03-08 02:38:49 +00:00
Yang Tse e5f8e5e57a stricter newline policy 2007-03-03 05:16:57 +00:00
Yang Tse 53a3abc76b 30 seconds isn't long enough for this test on a loaded server. 2007-03-03 04:27:19 +00:00
Yang Tse bfd6474f6b stricter newline policy 2007-03-03 02:06:44 +00:00
Yang Tse cef5b14baa Reduce the posibility of leaving the sockfilter hanging around when
tearing down the test ftp server due to a read error condition.
2007-03-01 16:42:02 +00:00
Yang Tse e817eb6cec log a 1120 chars long string to aid in quoted-printable and soft
line break detection in daily build logs.
2007-02-27 23:46:48 +00:00
Dan Fandrich fe0afb211e 5 seconds isn't always enough time to start a server on a loaded system. 2007-02-22 18:35:57 +00:00
Yang Tse 141b3d0c2f remove redundant check in timestamp detection 2007-02-22 17:34:02 +00:00
Yang Tse 69565afab0 Check for stdbool.h at configuration stage, and include it if available.
Check for lowercase 'bool' type at configuration stage. If not available
provide a suitable replacement with a type definition of 'unsigned char'
in setup_once.h

Move definitions of TRUE and FALSE to setup_once.h
2007-02-22 02:51:54 +00:00
Daniel Stenberg f19d333ef6 - Ravi Pratap provided work on libcurl making pipelining more robust and
fixing some bugs:
  o Don't mix GET and POST requests in a pipeline
  o Fix the order in which requests are dispatched from the pipeline
  o Fixed several curl bugs with pipelining when the server is returning
    chunked encoding:
    * Added states to chunked parsing for final CRLF
    * Rewind buffer after parsing chunk with data remaining
    * Moved chunked header initializing to a spot just before receiving
      headers
2007-02-21 21:59:40 +00:00
Yang Tse 29bb6f65f1 Move header file inclusion logic and definition of timeval
struct for platforms that don't have it to setup_once.h
2007-02-20 12:12:27 +00:00
Yang Tse 37f07a54bd Several corrections & changes to what has been stated in revision 1.45
1) The maketgz script does not insert the timestamp in curlver.h,
   it actually updates it. For CVS versions it is the "CVS" string.

2) testcurl.pl will always print the "date" string which represents
   the moment the test build is run.

3) testcurl.pl may not print the "timestamp" string since the script
   may end before it is printed out. (i.e. unable to update from CVS)

4) The "timestamp" string printed will be the same as the "date" one
   unless one of the following conditions is met.

   *) It is a tarball-based build. Timestamp will be creation time.

   *) CVS update has been done. Timestamp will be end of CVS update.
2007-02-20 05:28:41 +00:00
Yang Tse da8c666e4f add tutil_tvdiff_secs() for completeness 2007-02-20 01:09:38 +00:00
Yang Tse 78a1e5d1a6 fix typo 2007-02-19 19:46:07 +00:00
Yang Tse 116f60e063 Show libcurl's timestamp. This timestamp is only available in curlver.h
for tarball-based tests and builds, the maketgz script inserts it when
the tarball is created. For CVS-based tests and builds the timestamp we
show is the current UTC build time as it is the CVS version timestamp.

In this way, all builds will have a valid source code timestamp which
isn't related to the moment the tests and build is performed, with the
exception of CVS-based ones which have the same "date" and "timestamp"
2007-02-19 19:41:48 +00:00
Yang Tse 75fca27f8e log a message, stating the need of openssl to run this test 2007-02-19 04:51:47 +00:00
Yang Tse f2cd2882a0 Oops missing var 2007-02-19 03:59:41 +00:00
Yang Tse 31e598d2f3 add debug messages for initialization failures 2007-02-19 02:03:58 +00:00
Yang Tse d9bf55570b Move portable error number symbolic name definitions to setup_once.h 2007-02-17 13:51:24 +00:00
Yang Tse 789fd0b74a Replicate the configure tests that determined that timeval was available. 2007-02-17 11:43:52 +00:00
Dan Fandrich 3f140a6008 getpart implicitly drags in some networking functions, so it needs to be
linked to the networking libraries.
2007-02-17 08:16:53 +00:00
Dan Fandrich a0a47f2767 Better separate the library dependencies into those required by libcurl
and those required by other components to avoid forcing unneeded
dependencies into the target objects.
2007-02-17 01:29:01 +00:00
Dan Fandrich 213017e9cf Remove C99isms 2007-02-17 01:25:32 +00:00
Yang Tse d46cab4a94 add debug messages for fopen() failures 2007-02-16 19:41:25 +00:00
Yang Tse 4dc453c087 add debug messages for fopen() failures 2007-02-16 19:17:05 +00:00
Yang Tse a1d5983991 use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling 2007-02-16 18:19:35 +00:00
Yang Tse 4894ce16fc use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling 2007-02-16 16:01:19 +00:00
Yang Tse 5a267c4312 compiler warning fix 2007-02-14 13:46:08 +00:00
Yang Tse 7033a1c072 enhance HTTP server request input writing,
retrying upon EINTR errors.
2007-02-14 00:28:01 +00:00
Daniel Stenberg 4efa0d9f68 ftp@example.com is now the new anonymous FTP password. I opted for 'ftp' on
the left side of @ to make it short(er).
2007-02-13 22:50:16 +00:00
Daniel Stenberg 7f70dbcad5 Rob Crittenden added support for NSS (Network Security Service) for the
SSL/TLS layer. http://www.mozilla.org/projects/security/pki/nss/
2007-02-12 22:32:37 +00:00
Yang Tse 8c9233f6b2 Include both testutil.c and testutil.h, and not just testutil.c, in the
list of source files for those tests that use it. Otherwise testutil.h
might not be found by the compiler.
2007-02-09 12:41:57 +00:00
Yang Tse 6fcf98f617 Some tests were using functions curlx_tvnow and curlx_tvdiff which are not
part of the official libcurl API http://curl.haxx.se/lxr/source/lib/README.curlx
The documented way of using them would be to use timeval.c as a source code file.

The above described method works very well when statically linking libcurl and
apps, test programs, but has several drawbacks when you build a true shared
libcurl (i.e. Name space clash at linkage stage as functions are defined more
than once. Windows makefiles are not capable of handling this system of
source-level sharing)

So...

Now testutil.h and testutil.c define and implement tutil_tvnow and tutil_tvdiff
which replace curlx_tvnow and curlx_tvdiff for the libtest programs. Doing this
we avoid the above described problems, and the code in the testsuite does not
impose the need to keep those functions public in libcurl even when not part of
the API.
2007-02-09 01:17:24 +00:00
Yang Tse 2f4fe0175b Some tests were using functions curlx_tvnow and curlx_tvdiff which are not
part of the official libcurl API http://curl.haxx.se/lxr/source/lib/README.curlx
The documented way of using them would be to use timeval.c as a source code file.

The above described method works very well when statically linking libcurl and
apps, test programs, but has several drawbacks when you build a true shared
libcurl (i.e. Name space clash at linkage stage as functions are defined more
than once. Windows makefiles are not capable of handling this system of
source-level sharing)

So...

Now testutil.h and testutil.c define and implement tutil_tvnow and tutil_tvdiff
which replace curlx_tvnow and curlx_tvdiff for the libtest programs. Doing this
we avoid the above described problems, and the code in the testsuite does not
impose the need to keep those functions public in libcurl even when not part of
the API.
2007-02-09 01:11:14 +00:00
Yang Tse 9b6474378a Year 2038 has its own problems (32 bit integer overflow).
So cookie expiration date is lowered to expire at most in 2035.
2007-02-05 02:38:25 +00:00
Gisle Vanem a7748c2024 Constify argument to suburl(). Remove trailing space. 2007-02-04 12:12:02 +00:00
Yang Tse c26ec47e90 compiler warning fix 2007-02-02 17:16:06 +00:00
Yang Tse f71c8c7d84 fix leftover updating cookie expiration date 2007-02-02 11:49:15 +00:00
Yang Tse 68f3c2adca reported in bug: #1566077 the former URL mentioned in the generated cookie
jar has died and we now instead point out our own version of that
2007-02-02 02:12:34 +00:00
Yang Tse 2a8e2edf83 fix test case 62 which was failing due to cookies expiring 1 Feb 2007 2007-02-02 01:36:08 +00:00
Yang Tse 401598c2fe more fixes for the testsuite cookie expiration issue 2007-02-02 01:05:50 +00:00
Yang Tse d60848d04b cookie expiration time got us with pants at our knees.
Next time in 2038 :-)
2007-02-02 00:10:40 +00:00
Yang Tse c2639e0738 when using select() instead of poll, skip the test if the number of
open file descriptors is greater than FD_SETSIZE minus SAFETY_MARGIN,
also skip the test if any of the open file descriptors has a number
greater than FD_SETSIZE minus SAFETY_MARGIN.
2007-01-31 15:34:53 +00:00
Yang Tse d7d5baa0e2 fix temp string buffer variable name 2007-01-30 13:21:39 +00:00
Yang Tse bad67830b3 skip test on platforms on which we use select() instead
of poll() and select() happens to be bound by FD_SETSIZE
2007-01-30 03:48:29 +00:00
Daniel Stenberg a4b39c6ab8 the same source file is re-used for multiple tests and I missed to add the
timval.c dependency on some of those
2007-01-29 20:37:02 +00:00
Gisle Vanem d10e174fd1 Some compilers lacks <sys/time.h>. Include "timeval.h" to simplify the #ifdefs. 2007-01-29 20:24:00 +00:00
Daniel Stenberg 4d8dcf7b77 the libtest source codes that use curlx_tv* functions MUST use the
lib/timeval.c source code since those functions are not in the API (and might
not be accessible)
2007-01-29 10:09:06 +00:00
Daniel Stenberg abdbd3100f - Michael Wallner reported that when doing a CONNECT with a custom User-Agent
header, you got _two_ User-Agent headers in the CONNECT request...! Added
  test case 287 to verify the fix.
2007-01-29 09:26:36 +00:00
Yang Tse e09450103b Compiler warning fix 2007-01-28 03:51:10 +00:00
Yang Tse b6f889085d update copyright year notice 2007-01-27 03:43:05 +00:00
Gunter Knauf abb4cdafe9 set proper lib extension for non-configure mingw32 builds on Win32. 2007-01-25 14:06:38 +00:00
Dan Fandrich 44ac2776ae Fixed a dangling pointer problem that prevented the http_proxy environment
variable from being properly used in many cases (and caused test case 63
to fail).
2007-01-25 01:35:43 +00:00
Dan Fandrich f68323da7d Ignore XML DOCTYPEs and declarations. 2007-01-23 20:24:26 +00:00
Dan Fandrich 33bea767eb Convert (most of) the test data files into genuine XML. A handful still
are not, due mainly to the lack of support for XML character entities
(e.g. & => &amp; ).  This will make it easier to validate test files using
tools like xmllint, as well as edit and view them using XML tools.
2007-01-23 02:25:56 +00:00
Dan Fandrich 6da70628c6 Make the test script tag parser a bit more robust.
Check for the .exe extension on mingw32 builds.
2007-01-18 20:32:46 +00:00
Dan Fandrich 3bae748256 Added precheck that curl supports the 'openssl' engine in test 307. 2007-01-18 18:04:20 +00:00
Dan Fandrich 521c4b303d Fixed some tag typos in the test data files. 2007-01-17 20:36:56 +00:00
Dan Fandrich a2effd123a Disabled test 307 for now. 2007-01-17 19:23:32 +00:00
Dan Fandrich 32fe5b14ec Added simple OpenSSL crypto engine tests. 2007-01-16 18:34:58 +00:00
Dan Fandrich f11d3c329c Added TFTP upload tests. 2007-01-15 21:06:12 +00:00
Dan Fandrich b0d13fa4cb Leave the TFTPD test server running after a file upload.
Flush the protocol log data so it's immediately available to the test harness.
2007-01-15 21:03:53 +00:00
Dan Fandrich 5ec5b95f54 Added test for TFTP retrieve of boundary case 512 byte file. 2007-01-10 23:40:22 +00:00
Dan Fandrich 7efb955fd0 Added test of TFTP server error reporting. 2007-01-10 03:32:19 +00:00
Daniel Stenberg e61e09f658 prevent compiler warning since we use base64.h from libcurl which now has
function(s) using SessionHandle pointers
2007-01-04 23:04:50 +00:00
Daniel Stenberg 88c8d72a21 Alexey Simak found out that when doing FTP with the multi interface and
something went wrong like it got a bad response code back from the server,
libcurl would leak memory. Added test case 538 to verify the fix.

I also noted that the connection would get cached in that case, which
doesn't make sense since it cannot be re-use when the authentication has
failed. I fixed that issue too at the same time, and also that the path
would be "remembered" in vain for cases where the connection was about to
get closed.
2006-12-11 09:32:58 +00:00
Daniel Stenberg 090f5a9a45 added the new test 282 2006-11-25 13:32:48 +00:00
Daniel Stenberg da58d03ff7 Venkat Akella found out that libcurl did not like HTTP responses that simply
responded with a single status line and no headers nor body. Starting now, a
HTTP response on a persistent connection (i.e not set to be closed after the
response has been taken care of) must have Content-Length or chunked
encoding set, or libcurl will simply assume that there is no body.

To my horror I learned that we had no less than 57(!) test cases that did bad
HTTP responses like this, and even the test http server (sws) responded badly
when queried by the test system if it is the test system. So although the
actual fix for the problem was tiny, going through all the newly failing test
cases got really painful and boring.
2006-11-25 13:32:04 +00:00
Yang Tse 268fe09322 Revert ftpserver.pl back to revision 1.74 Adding change done in 1.76
This is done to back out changes done in revisions 1.77 and 1.75
2006-11-20 16:58:41 +00:00
Yang Tse 7a557e984a Revert runtests.pl back to revision 1.212
This is done to back out changes done from revisions 1.213 to 1.217
2006-11-20 16:58:04 +00:00
Yang Tse f1a55cbe6d Revert ftp.pm back to revision 1.5 Adding copyright notice.
This is done to back out changes done from revisions 1.6 to 1.10
2006-11-20 16:57:01 +00:00
Yang Tse 1e35d95df8 Add some message logging 2006-11-20 10:35:25 +00:00
Yang Tse d8387b418d stop slaves before stopping servers 2006-11-20 06:22:51 +00:00
Yang Tse adea16a294 Revert to KILL test servers until all test servers
have proper TERM and INT signal handlers implemented.
2006-11-20 03:25:17 +00:00
Daniel Stenberg 7f2d5cab2d log the sleep, like when done in test 190 2006-11-19 22:48:40 +00:00
Yang Tse 8db353e1d7 Avoid passing child pid and test server pid, using the running
servers hash, and adjust message arguments accordingly.
2006-11-19 03:47:56 +00:00
Yang Tse e6978117a7 Comment out the use of the "warnings" module now that ftp.pm seems to
be clear of warnings. Uncomment it if this module is further modified.

The "warnings" module requires perl 5.006 or later. Previous perl
versions don't have it and die on missing modules.
2006-11-19 03:47:11 +00:00
Yang Tse 0b5e1a9b2f Avoid keeping dupe pids When forked pid and test server pid is the same one. 2006-11-18 04:07:01 +00:00
Yang Tse 2e17a97474 Fix warning "Use of uninitialized value in ...".
If the list has only one item avoid sort subroutine.
2006-11-18 04:05:42 +00:00
Yang Tse 74ddbd8a3b The hash of running servers is now a hash of hashes which for each running
server holds not only its two main pids, but also the pidfile of the test
server and the 'slavepidfiles' for ftp* servers. This allows a better control
when stopping servers.

Now from runtests.pl when test servers are stopped they are signalled in
sequence TERM, INT and KILL allowing time in between for them to die. This
will give us a chance of gracefully stopping test servers, which we didn't
have when we were killing them in first instance.
2006-11-17 16:44:22 +00:00
Daniel Stenberg e264f699d4 Tor Arntsen spotted this mistake 2006-11-13 13:48:55 +00:00
Yang Tse 17d4f9513e Remove showing stderr log files unconditionally for tests 518 and 537.
Add failure checking for servers when fork()ed.

Use same code path in 'stopserver' when called with a single or multiple pids.
2006-11-09 13:20:42 +00:00
Yang Tse 318a7584f3 add a couple more of debugging messages 2006-11-03 14:13:25 +00:00
Yang Tse 78081a1652 reduce max size of dinamically allocated arrays to minimize the nasty
behaviour some versions of IRIX exhibit of committing suicide on big
mallocs instead of just returning a friendly null pointer
2006-11-03 10:05:21 +00:00
Yang Tse 1dee2cd55e fix comments and renumber rlimit return codes
fix closing of fd's when limit is reached
2006-11-03 01:57:25 +00:00
Yang Tse 426ecfd136 fix comments and renumber rlimit return codes 2006-11-03 01:56:55 +00:00
Yang Tse 7f1870da5f remove leftover comment 2006-11-02 20:56:40 +00:00
Yang Tse 2149a095f7 update and split test cases 518 and 537 into its own source code file 2006-11-02 20:50:18 +00:00
Yang Tse e8d21adbaa code cleanup 2006-11-02 15:47:24 +00:00
Yang Tse fa28531322 use our internal string functions and replace sprintf with snprintf 2006-11-02 03:45:07 +00:00
Yang Tse deef85ca9a Update protocol verification end of lines 2006-11-02 01:21:28 +00:00
Yang Tse 4f4427ff41 check symbol HAVE_UNISTD_H instead of UNISTD_H to include unistd.h 2006-11-02 00:34:21 +00:00
Yang Tse 905ca77c9e test 518 is all about testing libcurl functionality
when more than FD_SETSIZE file descriptors are open.
This means that if for any reason we are not able to
open more than FD_SETSIZE file descriptors then test
518 should not be run.

test 537 is all about testing libcurl functionality
when the system has nearly exhausted the number of
free file descriptors. Test 537 will try to run with
very few free file descriptors.
2006-11-01 18:33:50 +00:00
Yang Tse f51c567de3 Show stderr log file for test 518 unconditionally.
In this way we'll be able to sort out problems that might
arise in the prechek phase of the 518 test.

Once that 518 has been verified this change will be undone.
2006-10-31 01:30:42 +00:00
Yang Tse 9b2acca63e Sync comment with code and add three messages more 2006-10-31 01:24:03 +00:00