diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-01-17 12:59:23 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-01-17 19:40:35 +0100 |
commit | c43127414d89ccb9ef6517081f68986d991bcfb3 (patch) | |
tree | f6a639061f5e199089a923b052904aa24901243c /tests | |
parent | 9fd88abb7032346e88636165e688232e36f5c336 (diff) |
always-multi: always use non-blocking internals
Remove internal separated behavior of the easy vs multi intercace.
curl_easy_perform() is now using the multi interface itself.
Several minor multi interface quirks and bugs have been fixed in the
process.
Much help with debugging this has been provided by: Yang Tse
Diffstat (limited to 'tests')
33 files changed, 77 insertions, 73 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 65a618ea6..7e55d96ab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,7 +27,7 @@ EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \ FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm \ sshserver.pl sshhelp.pm testcurl.1 runtests.1 $(HTMLPAGES) $(PDFPAGES) \ serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \ - CMakeLists.txt mem-include-scan.pl + CMakeLists.txt mem-include-scan.pl valgrind.supp # we have two variables here to make sure DIST_SUBDIRS won't get 'unit' # added twice as then targets such as 'distclean' misbehave and try to diff --git a/tests/data/test1208 b/tests/data/test1208 index a0d428b43..504f6c7bb 100644 --- a/tests/data/test1208 +++ b/tests/data/test1208 @@ -36,6 +36,11 @@ FTP PORT download, no data conn and no transient negative reply <strippart> s/^EPRT \|1\|(.*)/EPRT \|1\|/ </strippart> + +# This test doesn't send a QUIT because the main state machine in multi.c +# triggers the timeout and sets the CURLE_OPERATION_TIMEDOUT error (28) for +# which the FTP disconect code generically has to assume could mean the +# control the connection and thus it cannot send any command. <protocol> USER anonymous
PASS ftp@example.com
@@ -44,10 +49,9 @@ EPRT |1| TYPE I
SIZE 1208
RETR 1208
-QUIT
</protocol> <errorcode> -12 +28 </errorcode> </verify> </testcase> diff --git a/tests/data/test1349 b/tests/data/test1349 index c88eec9e0..28576fe90 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -54,6 +54,8 @@ fooo mooo </file1> +# The final "221 bye bye baby" response to QUIT will not be recorded +# since that is not considered part of this particular transfer! <file2 name="log/heads1349"> 220- _ _ ____ _
220- ___| | | | _ \| |
@@ -69,7 +71,6 @@ mooo 213 10
150 Binary data connection for 1349 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1350 b/tests/data/test1350 index 214289484..df12de59d 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -54,6 +54,8 @@ fooo mooo </file1> +# The final "221 bye bye baby" response to QUIT will not be recorded +# since that is not considered part of this particular transfer! <file2 name="log/stdout1350"> 220- _ _ ____ _
220- ___| | | | _ \| |
@@ -69,7 +71,6 @@ mooo 213 10
150 Binary data connection for 1350 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1351 b/tests/data/test1351 index fea442fc7..d81265e01 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -55,6 +55,8 @@ fooo mooo </file1> +# The final "221 bye bye baby" response to QUIT will not be recorded +# since that is not considered part of this particular transfer! <file2 name="log/heads1351"> 220- _ _ ____ _
220- ___| | | | _ \| |
@@ -70,7 +72,6 @@ mooo 213 10
150 Binary data connection for 1351 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1352 b/tests/data/test1352 index ca24d4911..fa9d1ce7b 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -55,6 +55,8 @@ fooo mooo </file1> +# The final "221 bye bye baby" response to QUIT will not be recorded +# since that is not considered part of this particular transfer! <file2 name="log/stdout1352"> 220- _ _ ____ _
220- ___| | | | _ \| |
@@ -70,7 +72,6 @@ mooo 213 10
150 Binary data connection for 1352 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1353 b/tests/data/test1353 index 015f60a41..b2954b14d 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -54,6 +54,8 @@ fooo mooo </file1> +# The final "221 bye bye baby" response to QUIT will not be recorded +# since that is not considered part of this particular transfer! <file2 name="log/heads1353"> 220- _ _ ____ _
220- ___| | | | _ \| |
@@ -69,7 +71,6 @@ mooo 213 10
150 Binary data connection for 1353 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1354 b/tests/data/test1354 index cf644294c..aa54f2d07 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -69,7 +69,6 @@ mooo 213 10
150 Binary data connection for 1354 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1357 b/tests/data/test1357 index 4b539ec6d..952572032 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -87,7 +87,6 @@ MOOOO 213 214
150 Binary data connection for 1357 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1358 b/tests/data/test1358 index 081b36f1d..24cc724ea 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -87,7 +87,6 @@ MOOOO 213 214
150 Binary data connection for 1358 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1359 b/tests/data/test1359 index bb9747ae4..96445bb4e 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -88,7 +88,6 @@ MOOOO 213 214
150 Binary data connection for 1359 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1360 b/tests/data/test1360 index d2cb33dfc..abfbe8c68 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -88,7 +88,6 @@ MOOOO 213 214
150 Binary data connection for 1360 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1361 b/tests/data/test1361 index 8d3f1f53b..b97de16cd 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -87,7 +87,6 @@ MOOOO 213 214
150 Binary data connection for 1361 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1362 b/tests/data/test1362 index 5dc41811c..0ea7461ea 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -87,7 +87,6 @@ MOOOO 213 214
150 Binary data connection for 1362 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1379 b/tests/data/test1379 index 26552c8fa..0fd06d5c5 100644 --- a/tests/data/test1379 +++ b/tests/data/test1379 @@ -64,7 +64,6 @@ mooo 213 10
150 Binary data connection for 1379 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1380 b/tests/data/test1380 index 060b4b0b8..ec7800d5d 100644 --- a/tests/data/test1380 +++ b/tests/data/test1380 @@ -64,7 +64,6 @@ mooo 213 10
150 Binary data connection for 1380 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1381 b/tests/data/test1381 index c82ac745d..8f3bc37f0 100644 --- a/tests/data/test1381 +++ b/tests/data/test1381 @@ -65,7 +65,6 @@ mooo 213 10
150 Binary data connection for 1381 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1382 b/tests/data/test1382 index 5e5513f38..fbf5195f7 100644 --- a/tests/data/test1382 +++ b/tests/data/test1382 @@ -65,7 +65,6 @@ mooo 213 10
150 Binary data connection for 1382 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1383 b/tests/data/test1383 index 2604faf96..0469e72e0 100644 --- a/tests/data/test1383 +++ b/tests/data/test1383 @@ -64,7 +64,6 @@ mooo 213 10
150 Binary data connection for 1383 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1384 b/tests/data/test1384 index 289aa9bdb..2deeb7c4c 100644 --- a/tests/data/test1384 +++ b/tests/data/test1384 @@ -64,7 +64,6 @@ mooo 213 10
150 Binary data connection for 1384 () (10 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1387 b/tests/data/test1387 index 6628b8963..a2c5a4d6b 100644 --- a/tests/data/test1387 +++ b/tests/data/test1387 @@ -79,7 +79,6 @@ MOOOO 213 214
150 Binary data connection for 1387 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1388 b/tests/data/test1388 index 478a2e9fa..b4662e654 100644 --- a/tests/data/test1388 +++ b/tests/data/test1388 @@ -79,7 +79,6 @@ MOOOO 213 214
150 Binary data connection for 1388 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1389 b/tests/data/test1389 index 06b9c26b1..c2ac3ad9d 100644 --- a/tests/data/test1389 +++ b/tests/data/test1389 @@ -80,7 +80,6 @@ MOOOO 213 214
150 Binary data connection for 1389 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1390 b/tests/data/test1390 index b5980369e..3cf86e775 100644 --- a/tests/data/test1390 +++ b/tests/data/test1390 @@ -80,7 +80,6 @@ MOOOO 213 214
150 Binary data connection for 1390 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1391 b/tests/data/test1391 index fa7d89a66..913f25afe 100644 --- a/tests/data/test1391 +++ b/tests/data/test1391 @@ -79,7 +79,6 @@ MOOOO 213 214
150 Binary data connection for 1391 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1392 b/tests/data/test1392 index c1e8346a2..b05fc317c 100644 --- a/tests/data/test1392 +++ b/tests/data/test1392 @@ -79,7 +79,6 @@ MOOOO 213 214
150 Binary data connection for 1392 () (214 bytes).
226 File transfer complete
-221 bye bye baby
</file2> <stripfile2> s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ diff --git a/tests/data/test1407 b/tests/data/test1407 index a0c84057d..842778a7c 100644 --- a/tests/data/test1407 +++ b/tests/data/test1407 @@ -12,7 +12,7 @@ LIST # Server-side <reply> <servercmd> -REPLY LIST +OK 1407 100 +REPLY LIST +OK 1407 100\r\n. </servercmd> </reply> diff --git a/tests/data/test506 b/tests/data/test506 index c1a959a40..a61e2fc00 100644 --- a/tests/data/test506 +++ b/tests/data/test506 @@ -101,66 +101,60 @@ run 1: set cookie 1, 2 and 3 lock: dns [Pigs in space]: 14 unlock: dns [Pigs in space]: 15 CLEANUP -lock: dns [Pigs in space]: 16 -unlock: dns [Pigs in space]: 17 -lock: cookie [Pigs in space]: 18 -unlock: cookie [Pigs in space]: 19 -lock: share [Pigs in space]: 20 -unlock: share [Pigs in space]: 21 +lock: cookie [Pigs in space]: 16 +unlock: cookie [Pigs in space]: 17 +lock: share [Pigs in space]: 18 +unlock: share [Pigs in space]: 19 *** run 2 CURLOPT_SHARE -lock: share [Pigs in space]: 22 -unlock: share [Pigs in space]: 23 +lock: share [Pigs in space]: 20 +unlock: share [Pigs in space]: 21 PERFORM -lock: dns [Pigs in space]: 24 -unlock: dns [Pigs in space]: 25 +lock: dns [Pigs in space]: 22 +unlock: dns [Pigs in space]: 23 +lock: cookie [Pigs in space]: 24 +unlock: cookie [Pigs in space]: 25 lock: cookie [Pigs in space]: 26 unlock: cookie [Pigs in space]: 27 lock: cookie [Pigs in space]: 28 unlock: cookie [Pigs in space]: 29 -lock: cookie [Pigs in space]: 30 -unlock: cookie [Pigs in space]: 31 run 2: set cookie 4 and 5 -lock: dns [Pigs in space]: 32 -unlock: dns [Pigs in space]: 33 +lock: dns [Pigs in space]: 30 +unlock: dns [Pigs in space]: 31 CLEANUP -lock: dns [Pigs in space]: 34 -unlock: dns [Pigs in space]: 35 -lock: cookie [Pigs in space]: 36 -unlock: cookie [Pigs in space]: 37 -lock: share [Pigs in space]: 38 -unlock: share [Pigs in space]: 39 +lock: cookie [Pigs in space]: 32 +unlock: cookie [Pigs in space]: 33 +lock: share [Pigs in space]: 34 +unlock: share [Pigs in space]: 35 *** run 3 CURLOPT_SHARE -lock: share [Pigs in space]: 40 -unlock: share [Pigs in space]: 41 +lock: share [Pigs in space]: 36 +unlock: share [Pigs in space]: 37 CURLOPT_COOKIEJAR PERFORM -lock: dns [Pigs in space]: 42 -unlock: dns [Pigs in space]: 43 +lock: dns [Pigs in space]: 38 +unlock: dns [Pigs in space]: 39 +lock: cookie [Pigs in space]: 40 +unlock: cookie [Pigs in space]: 41 +lock: cookie [Pigs in space]: 42 +unlock: cookie [Pigs in space]: 43 lock: cookie [Pigs in space]: 44 unlock: cookie [Pigs in space]: 45 -lock: cookie [Pigs in space]: 46 -unlock: cookie [Pigs in space]: 47 -lock: cookie [Pigs in space]: 48 -unlock: cookie [Pigs in space]: 49 run 3: overwrite cookie 1 and 4 -lock: dns [Pigs in space]: 50 -unlock: dns [Pigs in space]: 51 +lock: dns [Pigs in space]: 46 +unlock: dns [Pigs in space]: 47 try SHARE_CLEANUP... -lock: share [Pigs in space]: 52 -unlock: share [Pigs in space]: 53 +lock: share [Pigs in space]: 48 +unlock: share [Pigs in space]: 49 SHARE_CLEANUP failed, correct CLEANUP -lock: dns [Pigs in space]: 54 -unlock: dns [Pigs in space]: 55 -lock: cookie [Pigs in space]: 56 -unlock: cookie [Pigs in space]: 57 -lock: share [Pigs in space]: 58 -unlock: share [Pigs in space]: 59 +lock: cookie [Pigs in space]: 50 +unlock: cookie [Pigs in space]: 51 +lock: share [Pigs in space]: 52 +unlock: share [Pigs in space]: 53 SHARE_CLEANUP -lock: share [Pigs in space]: 60 -unlock: share [Pigs in space]: 61 +lock: share [Pigs in space]: 54 +unlock: share [Pigs in space]: 55 GLOBAL_CLEANUP </stdout> <stderr> diff --git a/tests/data/test808 b/tests/data/test808 index 2c9c11cdd..9027a5ab9 100644 --- a/tests/data/test808 +++ b/tests/data/test808 @@ -10,7 +10,8 @@ LIST # Server-side <reply> <servercmd> -REPLY LIST +OK 808 100 +# include the '.\r\n' 3-byte trailer to end the transfer poperly! +REPLY LIST +OK 808 100\r\n. </servercmd> </reply> diff --git a/tests/data/test813 b/tests/data/test813 index 1447fa277..fac4aa0ef 100644 --- a/tests/data/test813 +++ b/tests/data/test813 @@ -34,11 +34,13 @@ pop3://%HOSTIP:%POP3PORT/813 -u user:wrong <errorcode> 67 </errorcode> +# +# The multi interface considers a broken "DO" request as a prematurely broken +# transfer and such a connection will not get a "QUIT" <protocol> CAPA
USER user
PASS wrong
-QUIT
</protocol> </verify> </testcase> diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 24d252235..5da537995 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -41,7 +41,7 @@ #error "this test requires FD_SETSIZE" #endif -#define SAFETY_MARGIN (10) +#define SAFETY_MARGIN (11) #if defined(WIN32) || defined(_WIN32) || defined(MSDOS) #define DEV_NULL "NUL" diff --git a/tests/runtests.pl b/tests/runtests.pl index f6c2016c4..c59d68fb7 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -6,7 +6,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -3084,6 +3084,7 @@ sub singletest { my $valgrindcmd = "$valgrind "; $valgrindcmd .= "$valgrind_tool " if($valgrind_tool); $valgrindcmd .= "--leak-check=yes "; + $valgrindcmd .= "--suppressions=valgrind.supp "; $valgrindcmd .= "--num-callers=16 "; $valgrindcmd .= "${valgrind_logfile}=$LOGDIR/valgrind$testnum"; $CMDLINE = "$valgrindcmd $CMDLINE"; diff --git a/tests/valgrind.supp b/tests/valgrind.supp new file mode 100644 index 000000000..6fb9ce801 --- /dev/null +++ b/tests/valgrind.supp @@ -0,0 +1,16 @@ +{ + libidn-idna_to_ascii-error + Memcheck:Addr4 + fun:idna_to_ascii_4z + fun:idna_to_ascii_8z + fun:idna_to_ascii_lz + fun:fix_hostname + fun:resolve_server + fun:create_conn + fun:Curl_connect + fun:multi_runsingle + fun:curl_multi_perform + fun:curl_easy_perform + fun:operate + fun:main +} |