From: Daniel Stenberg Date: Mon, 29 Jul 2024 08:17:08 +0000 (+0200) Subject: tests: provide FTP directory contents in the test file X-Git-Tag: curl-8_9_1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14f630ecf6e1ec433473c19a91fd1f3e2ed5d85e;p=thirdparty%2Fcurl.git tests: provide FTP directory contents in the test file Instead of providing a fixed single synthetic response in the test server itself. To allow us to better use *different* directory listings in different test cases. In this change, most listings remain the same as before. The wildcard match tests still use synthetic responses but we should fix that as well. Updated numerous test cases to use this. Closes #14295 --- diff --git a/tests/data/test100 b/tests/data/test100 index de6a82bda9..b7554383ea 100644 --- a/tests/data/test100 +++ b/tests/data/test100 @@ -9,8 +9,6 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . diff --git a/tests/data/test101 b/tests/data/test101 index 26824c7411..3febc5e72a 100644 --- a/tests/data/test101 +++ b/tests/data/test101 @@ -8,9 +8,7 @@ LIST # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -22,7 +20,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # Client-side diff --git a/tests/data/test1010 b/tests/data/test1010 index d1eee918af..d45efdc8a5 100644 --- a/tests/data/test1010 +++ b/tests/data/test1010 @@ -9,9 +9,8 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -19,11 +18,11 @@ drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT -r--r--r-- 1 0 1 35 Jul 16 1996 README lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev -drwxrwxrwx 2 98 98 512 May 29 16:04 download.html +drwxrwxrwx 2 98 98 512 May 29 16:04 downthis.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test1047 b/tests/data/test1047 index d54a8494db..b863bd0061 100644 --- a/tests/data/test1047 +++ b/tests/data/test1047 @@ -11,9 +11,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test1048 b/tests/data/test1048 index d4e12494b1..600e11faf6 100644 --- a/tests/data/test1048 +++ b/tests/data/test1048 @@ -13,9 +13,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -27,7 +25,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test1050 b/tests/data/test1050 index d302f10563..e6dd82a321 100644 --- a/tests/data/test1050 +++ b/tests/data/test1050 @@ -10,9 +10,7 @@ EPRT # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # Client-side diff --git a/tests/data/test1149 b/tests/data/test1149 index 7686ef10b9..d4e97d540d 100644 --- a/tests/data/test1149 +++ b/tests/data/test1149 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test1152 b/tests/data/test1152 index 490fde3b74..1823bab4a9 100644 --- a/tests/data/test1152 +++ b/tests/data/test1152 @@ -13,8 +13,6 @@ LIST REPLY PWD 257 "just one -# When doing LIST, we get the default list output hard-coded in the test -# FTP server total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . diff --git a/tests/data/test1153 b/tests/data/test1153 index 36c76693ac..a74b1838ce 100644 --- a/tests/data/test1153 +++ b/tests/data/test1153 @@ -13,8 +13,6 @@ LIST REPLY PWD 257 "/""hello""" -# When doing LIST, we get the default list output hard-coded in the test -# FTP server total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . diff --git a/tests/data/test130 b/tests/data/test130 index d6fed33676..2c4dfe85eb 100644 --- a/tests/data/test130 +++ b/tests/data/test130 @@ -10,9 +10,8 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test131 b/tests/data/test131 index c48931175c..4a73de2850 100644 --- a/tests/data/test131 +++ b/tests/data/test131 @@ -10,10 +10,7 @@ netrc # # Server-side -# -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test1316 b/tests/data/test1316 index b6b8a18969..2218b6e147 100644 --- a/tests/data/test1316 +++ b/tests/data/test1316 @@ -19,15 +19,7 @@ Magic: sure you can FTP me -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - -HTTP/1.1 200 Mighty fine indeed -Magic: sure you can FTP me - -HTTP/1.1 200 Mighty fine indeed -Magic: sure you can FTP me - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -39,7 +31,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test132 b/tests/data/test132 index 8aa2f7906a..77d47c8fd2 100644 --- a/tests/data/test132 +++ b/tests/data/test132 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test133 b/tests/data/test133 index c8d2f9039e..4a2c46cde4 100644 --- a/tests/data/test133 +++ b/tests/data/test133 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test134 b/tests/data/test134 index d0716c3d12..207e4f5d47 100644 --- a/tests/data/test134 +++ b/tests/data/test134 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test2039 b/tests/data/test2039 index fdb61ed024..7cab984ce5 100644 --- a/tests/data/test2039 +++ b/tests/data/test2039 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test215 b/tests/data/test215 index cead9c742d..058639f272 100644 --- a/tests/data/test215 +++ b/tests/data/test215 @@ -7,9 +7,7 @@ FTP # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -21,7 +19,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + diff --git a/tests/data/test250 b/tests/data/test250 index 455d9ea1a2..4f01ea79a3 100644 --- a/tests/data/test250 +++ b/tests/data/test250 @@ -11,7 +11,7 @@ SLOWDOWN # When doing LIST, we get the default list output hard-coded in the test # FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + SLOWDOWN diff --git a/tests/data/test251 b/tests/data/test251 index 46124bfeca..9ed8c94880 100644 --- a/tests/data/test251 +++ b/tests/data/test251 @@ -8,9 +8,7 @@ SLOWDOWN # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -22,7 +20,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + SLOWDOWN diff --git a/tests/data/test252 b/tests/data/test252 index e803a85b23..1480ee1ec1 100644 --- a/tests/data/test252 +++ b/tests/data/test252 @@ -10,9 +10,7 @@ EPSV # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test253 b/tests/data/test253 index 75b7b85671..01ec416ac6 100644 --- a/tests/data/test253 +++ b/tests/data/test253 @@ -10,9 +10,7 @@ EPRT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -21,10 +19,10 @@ drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev drwxrwxrwx 2 98 98 512 May 29 16:04 download.html -dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc +dr-xr-xr-x 2 0 1 512 Nov 30 1995 moo drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test254 b/tests/data/test254 index d9de0b139d..90b58a0b30 100644 --- a/tests/data/test254 +++ b/tests/data/test254 @@ -11,9 +11,7 @@ EPSV # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test255 b/tests/data/test255 index ec42d117b0..1a1526a10c 100644 --- a/tests/data/test255 +++ b/tests/data/test255 @@ -11,9 +11,7 @@ EPRT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test280 b/tests/data/test280 index 1ed41e6528..1aee4b517f 100644 --- a/tests/data/test280 +++ b/tests/data/test280 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,8 +21,8 @@ dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub -dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - +dr-xr-xr-x 5 0 1 512 Oct 1 1997 fine + REPLY USER 530 We don't like USER commands COUNT USER 1 diff --git a/tests/data/test294 b/tests/data/test294 index b840b8c70f..67108aedb9 100644 --- a/tests/data/test294 +++ b/tests/data/test294 @@ -11,9 +11,7 @@ ACCT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + REPLY PASS 332 Give me an ACCT now REPLY ACCT 230 Thank-you for the ACCT diff --git a/tests/data/test350 b/tests/data/test350 index 6830d704d0..3eb8b80aa6 100644 --- a/tests/data/test350 +++ b/tests/data/test350 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test351 b/tests/data/test351 index ef21364ad4..ffa93e3e29 100644 --- a/tests/data/test351 +++ b/tests/data/test351 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test352 b/tests/data/test352 index cfcdc1f10d..0cc4d69fd1 100644 --- a/tests/data/test352 +++ b/tests/data/test352 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test353 b/tests/data/test353 index 26115d6753..a94828bd6b 100644 --- a/tests/data/test353 +++ b/tests/data/test353 @@ -9,9 +9,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test380 b/tests/data/test380 index bd0c69765c..f9ccafdabc 100644 --- a/tests/data/test380 +++ b/tests/data/test380 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test381 b/tests/data/test381 index 902cc91d15..41b9eb779c 100644 --- a/tests/data/test381 +++ b/tests/data/test381 @@ -10,9 +10,7 @@ netrc # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test400 b/tests/data/test400 index db774bf120..e20774a4d0 100644 --- a/tests/data/test400 +++ b/tests/data/test400 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test403 b/tests/data/test403 index 7c2904afbe..7c08d5ca86 100644 --- a/tests/data/test403 +++ b/tests/data/test403 @@ -12,9 +12,7 @@ FAILURE # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -26,7 +24,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test406 b/tests/data/test406 index eca49d0d37..db497bf6c4 100644 --- a/tests/data/test406 +++ b/tests/data/test406 @@ -10,9 +10,7 @@ LIST # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTPS server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -24,7 +22,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test521 b/tests/data/test521 index 1eec1bb2cf..90473b33a0 100644 --- a/tests/data/test521 +++ b/tests/data/test521 @@ -9,9 +9,7 @@ CURLOPT_PORT # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -23,7 +21,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test539 b/tests/data/test539 index 1fb4e12554..7985a52347 100644 --- a/tests/data/test539 +++ b/tests/data/test539 @@ -12,22 +12,14 @@ FTP file contents + +contents for file number two + + file contents +contents for file number two - -total 20 -drwxr-xr-x 8 98 98 512 Oct 22 13:06 . -drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. -drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT --r--r--r-- 1 0 1 35 Jul 16 1996 README -lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin -dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev -drwxrwxrwx 2 98 98 512 May 29 16:04 download.html -dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc -drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub -dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - # Client-side @@ -44,7 +36,7 @@ lib%TESTNUMBER Two FTP fetches using different CURLOPT_FTP_FILEMETHOD -ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER +ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER0001 @@ -63,8 +55,8 @@ RETR %TESTNUMBER SYST CWD / EPSV -TYPE A -LIST path/to/the/file/%TESTNUMBER. +SIZE path/to/the/file/%TESTNUMBER0001 +RETR path/to/the/file/%TESTNUMBER0001 QUIT diff --git a/tests/data/test574 b/tests/data/test574 index 436e1828bd..3c151286c8 100644 --- a/tests/data/test574 +++ b/tests/data/test574 @@ -11,10 +11,8 @@ ftplistparser # # Server-side - - - - +# +# Data is generated by the ftp server itself # Client-side diff --git a/tests/data/test706 b/tests/data/test706 index 656b3dd8b7..faafd90385 100644 --- a/tests/data/test706 +++ b/tests/data/test706 @@ -11,9 +11,7 @@ SOCKS4 # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/data/test707 b/tests/data/test707 index 3ed89ec627..2c41dfea70 100644 --- a/tests/data/test707 +++ b/tests/data/test707 @@ -11,9 +11,7 @@ SOCKS5 # # Server-side -# When doing LIST, we get the default list output hard-coded in the test -# FTP server - + total 20 drwxr-xr-x 8 98 98 512 Oct 22 13:06 . drwxr-xr-x 8 98 98 512 Oct 22 13:06 .. @@ -25,7 +23,7 @@ drwxrwxrwx 2 98 98 512 May 29 16:04 download.html dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr - + # diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 3da888976a..0b552e074b 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -2071,7 +2071,8 @@ sub CWD_ftp { my ($folder, $fullcommand) = $_[0]; switch_directory($folder); if($ftptargetdir =~ /^\/fully_simulated/) { - $ftplistparserstate = "enabled"; + $ftplistparserstate = "enabled"; + logmsg "enabled FTP list parser mode\n"; } else { undef $ftplistparserstate; @@ -2091,19 +2092,6 @@ sub PWD_ftp { sub LIST_ftp { # print "150 ASCII data connection for /bin/ls (193.15.23.1,59196) (0 bytes)\r\n"; -# this is a built-in fake-dir ;-) -my @ftpdir=("total 20\r\n", -"drwxr-xr-x 8 98 98 512 Oct 22 13:06 .\r\n", -"drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..\r\n", -"drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT\r\n", -"-r--r--r-- 1 0 1 35 Jul 16 1996 README\r\n", -"lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin\r\n", -"dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev\r\n", -"drwxrwxrwx 2 98 98 512 May 29 16:04 download.html\r\n", -"dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc\r\n", -"drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub\r\n", -"dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr\r\n"); - if($datasockf_conn eq 'no') { if($nodataconn425) { sendcontrol "150 Opening data connection\r\n"; @@ -2123,15 +2111,17 @@ my @ftpdir=("total 20\r\n", return 0; } - if($ftplistparserstate) { - @ftpdir = ftp_contentlist($ftptargetdir); - } - logmsg "pass LIST data on data connection\n"; - if($cwd_testno) { - loadtest("$logdir/test$cwd_testno"); - + if($ftplistparserstate) { + # provide a synthetic response + my @ftpdir = ftp_contentlist($ftptargetdir); + # old hard-coded style + for(@ftpdir) { + senddata $_; + } + } + else { my @data = getpart("reply", "data"); for(@data) { my $send = $_; @@ -2141,13 +2131,6 @@ my @ftpdir=("total 20\r\n", logmsg "send $send as data\n"; senddata $send; } - $cwd_testno = 0; # forget it again - } - else { - # old hard-coded style - for(@ftpdir) { - senddata $_; - } } close_dataconn(0); sendcontrol "226 ASCII transfer complete\r\n"; @@ -2214,6 +2197,7 @@ sub MDTM_ftp { sub SIZE_ftp { my $testno = $_[0]; + if($ftplistparserstate) { my $size = wildcard_filesize($ftptargetdir, $testno); if($size == -1) { @@ -2374,7 +2358,7 @@ sub RETR_ftp { $sz = "($retrsize bytes)"; } - sendcontrol "150 Binary data connection for $testno () $sz.\r\n"; + sendcontrol "150 Binary data connection for $testno ($testpart) $sz.\r\n"; for(@data) { my $send = $_; diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c index ebd6af1209..2e079fae36 100644 --- a/tests/libtest/lib539.c +++ b/tests/libtest/lib539.c @@ -55,18 +55,11 @@ CURLcode test(char *URL) /* * Change the FTP_FILEMETHOD option to use full paths rather than a CWD - * command. Alter the URL's path a bit, appending a "./". Use an innocuous - * QUOTE command, after which curl will CWD to ftp_conn->entrypath and then - * (on the next call to ftp_statemach_act) find a non-zero ftpconn->dirdepth - * even though no directories are stored in the ftpconn->dirs array (after a - * call to freedirs). + * command. Use an innocuous QUOTE command, after which curl will CWD to + * ftp_conn->entrypath and then (on the next call to ftp_statemach_act) + * find a non-zero ftpconn->dirdepth even though no directories are stored + * in the ftpconn->dirs array (after a call to freedirs). */ - newURL = aprintf("%s./", URL); - if(!newURL) { - curl_easy_cleanup(curl); - curl_global_cleanup(); - return TEST_ERR_MAJOR_BAD; - } slist = curl_slist_append(NULL, "SYST"); if(!slist) { @@ -76,7 +69,7 @@ CURLcode test(char *URL) return TEST_ERR_MAJOR_BAD; } - test_setopt(curl, CURLOPT_URL, newURL); + test_setopt(curl, CURLOPT_URL, libtest_arg2); test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD); test_setopt(curl, CURLOPT_QUOTE, slist); diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c index 3d7ecfc8ba..0d107ef113 100644 --- a/tests/libtest/lib574.c +++ b/tests/libtest/lib574.c @@ -31,8 +31,8 @@ static int new_fnmatch(void *ptr, const char *pattern, const char *string) { (void)ptr; - (void)pattern; - (void)string; + fprintf(stderr, "lib574: match string '%s' against pattern '%s'\n", + string, pattern); return CURL_FNMATCHFUNC_MATCH; }