]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: provide FTP directory contents in the test file
authorDaniel Stenberg <daniel@haxx.se>
Mon, 29 Jul 2024 08:17:08 +0000 (10:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 29 Jul 2024 11:04:24 +0000 (13:04 +0200)
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

42 files changed:
tests/data/test100
tests/data/test101
tests/data/test1010
tests/data/test1047
tests/data/test1048
tests/data/test1050
tests/data/test1149
tests/data/test1152
tests/data/test1153
tests/data/test130
tests/data/test131
tests/data/test1316
tests/data/test132
tests/data/test133
tests/data/test134
tests/data/test2039
tests/data/test215
tests/data/test250
tests/data/test251
tests/data/test252
tests/data/test253
tests/data/test254
tests/data/test255
tests/data/test280
tests/data/test294
tests/data/test350
tests/data/test351
tests/data/test352
tests/data/test353
tests/data/test380
tests/data/test381
tests/data/test400
tests/data/test403
tests/data/test406
tests/data/test521
tests/data/test539
tests/data/test574
tests/data/test706
tests/data/test707
tests/ftpserver.pl
tests/libtest/lib539.c
tests/libtest/lib574.c

index de6a82bda99fe512f97b7e43538b8ce266e9d512..b7554383ea304a7024c6a306ed7faa0e4cb94c43 100644 (file)
@@ -9,8 +9,6 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
 <data mode="text">
 total 20
 drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
index 26824c741156f48d17e2df09940c99e4cf63763c..3febc5e72aa5ebffce1f157a70f91c0fc1717304 100644 (file)
@@ -8,9 +8,7 @@ LIST
 </info>
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 # Client-side
index d1eee918af221e3eecc611d3ff0c94dfa0399018..d45efdc8a5e4e29cb5b7e4873ecb3f7d59ca74fb 100644 (file)
@@ -9,9 +9,8 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index d54a8494db07f627f730a7240cced1c3eb83e087..b863bd0061bdef115721c53937b42626976e36f8 100644 (file)
@@ -11,9 +11,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index d4e12494b19461209e83f4e5f5e8993a57254e46..600e11faf6641f5677e94c1db2e9e1675737edd1 100644 (file)
@@ -13,9 +13,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index d302f1056370c5fc6d6e797977675e60c94eb55b..e6dd82a321a5feb2a574ad6c1f9b56933f09c0ae 100644 (file)
@@ -10,9 +10,7 @@ EPRT
 
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 # Client-side
index 7686ef10b981990e45f3df7ae523a01ab3be17f3..d4e97d540d50fc724bcabd8ec5b9740d91b3a928 100644 (file)
@@ -10,9 +10,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 490fde3b74e59ffc7c5d59df536626735dbb0ddc..1823bab4a9afa1297e7fd907147af50748700b5b 100644 (file)
@@ -13,8 +13,6 @@ LIST
 REPLY PWD 257 "just one
 </servercmd>
 
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
 <data mode="text">
 total 20
 drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
index 36c76693ace14d44cf572cda0a97cb82362c9ce6..a74b1838ceca7cf2de5859ac82e4ecf4183baced 100644 (file)
@@ -13,8 +13,6 @@ LIST
 REPLY PWD 257 "/""hello"""
 </servercmd>
 
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
 <data mode="text">
 total 20
 drwxr-xr-x   8 98       98           512 Oct 22 13:06 .
index d6fed33676f2b33e5039c6019a2a18856f8017e6..2c4dfe85eb54e3a69e59b5462b6f17604c9133a6 100644 (file)
@@ -10,9 +10,8 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index c48931175c483569bc7342aec9a2cdd2785ac0d2..4a73de2850133bb2d22c041be630ba2ff990e85d 100644 (file)
@@ -10,10 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-#
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index b6b8a18969133b0a235f573aa3293c710e5a2452..2218b6e1474230da0ef40d97878aa7363f780cfa 100644 (file)
@@ -19,15 +19,7 @@ Magic: sure you can FTP me
 \r
 </connect>
 
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
-HTTP/1.1 200 Mighty fine indeed\r
-Magic: sure you can FTP me\r
-\r
-HTTP/1.1 200 Mighty fine indeed\r
-Magic: sure you can FTP me\r
-\r
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 8aa2f7906a991e94a7e5c0d00905eea158304109..77d47c8fd2e7d7a86f86a05de3a48f81d8039f0f 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index c8d2f9039e3e71c1be1e8bda40008fdbfe105886..4a2c46cde4b80fac87a3890f7344489d18d02bc2 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index d0716c3d12fd129e3b520ca2c3f5d0f3d70f90fa..207e4f5d47412865959e4b8c037c9b91493e71c3 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index fdb61ed0243cb8b5d7176fa994d0596324898569..7cab984ce5ab4ee7632b5f48f362f397dae779a4 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index cead9c742d11bb2fd840f7a3ee8b3549f00c1f76..058639f272cbb31000fcdc04b73c32be8aa8be9e 100644 (file)
@@ -7,9 +7,7 @@ FTP
 
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 
 </reply>
 
index 455d9ea1a29b46138807eeb3d10667bb4e9ad7f3..4f01ea79a38a002de0a637d354ce9f2e2caae2d5 100644 (file)
@@ -11,7 +11,7 @@ SLOWDOWN
 <reply>
 # When doing LIST, we get the default list output hard-coded in the test
 # FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 <servercmd>
 SLOWDOWN
 </servercmd>
index 46124bfecab2aab6e100b169056069a15761198b..9ed8c9488009b8aa9174033ac440584a4ed44b39 100644 (file)
@@ -8,9 +8,7 @@ SLOWDOWN
 
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 <servercmd>
 SLOWDOWN
 </servercmd>
index e803a85b23b53f519d13537e7f326e2bdeddbe12..1480ee1ec1dc672b6ecbd42dd45c1be1ac242126 100644 (file)
@@ -10,9 +10,7 @@ EPSV
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 75b7b8567132158702787d34b2318db5d9a717a9..01ec416ac62e65d7fcfc6b5deab2252a641d3b5d 100644 (file)
@@ -10,9 +10,7 @@ EPRT
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index d9de0b139d2ab5292b8a7d03fa652174b4ae198a..90b58a0b30675c826562905adfaed97c2ef31905 100644 (file)
@@ -11,9 +11,7 @@ EPSV
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index ec42d117b0bffdb093d527eaf3ff59da4ae29a36..1a1526a10caf49ed14fe5b2bc28f6a75966bd475 100644 (file)
@@ -11,9 +11,7 @@ EPRT
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 1ed41e6528f9cd913737abfd23f8b534c9b1ab17..1aee4b517f1159f15c77de1547dc6423579eb51a 100644 (file)
@@ -10,9 +10,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+dr-xr-xr-x   5 0        1            512 Oct  1  1997 fine
+</data>
 <servercmd>
 REPLY USER 530 We don't like USER commands
 COUNT USER 1
index b840b8c70f638379a5d1069378dbd64de3dd1f3c..67108aedb91f365bdda622494aab08efc24e38c4 100644 (file)
@@ -11,9 +11,7 @@ ACCT
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 <servercmd>
 REPLY PASS 332 Give me an ACCT now
 REPLY ACCT 230 Thank-you for the ACCT
index 6830d704d0fcad5a9604f696f983405613850b62..3eb8b80aa6bd405fb377dd68a59abef8279cb165 100644 (file)
@@ -9,9 +9,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index ef21364ad4be35dd9e3a4fb932eb8ac945d73d7d..ffa93e3e2987817f4752341dd3738c75714341d2 100644 (file)
@@ -9,9 +9,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index cfcdc1f10d3d6755c58648dbcd9dd7b74f50c71c..0cc4d69fd1e45dffc1edc893d7b5ce7b2635a1a6 100644 (file)
@@ -9,9 +9,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 26115d6753440fd65182cb80fb73f022e6d25e12..a94828bd6b987a9f033e2d5d3ab9ebe3c5b6183a 100644 (file)
@@ -9,9 +9,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index bd0c69765c6665d946f5daa7051fbc86f89b89d7..f9ccafdabc2826f5390e320cebf309c4711380b1 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 902cc91d156b014c34d639137728ad53482d6ecb..41b9eb779c74194d9de2fa489694e57b6f594afd 100644 (file)
@@ -10,9 +10,7 @@ netrc
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index db774bf1203df486bf3783877edd2422be5dd47f..e20774a4d04d639ee4c4d329ba83bdcaee64f4f1 100644 (file)
@@ -10,9 +10,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTPS server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 7c2904afbeb21c9b88d48415a34f0af8a38ea68e..7c08d5ca865d5a9e4b56a139b22915bfdab1eb2b 100644 (file)
@@ -12,9 +12,7 @@ FAILURE
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTPS server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index eca49d0d37030a7d085fa29746fe6d498a64c3c3..db497bf6c4a2be21b7544d3ee711c93a9b77033e 100644 (file)
@@ -10,9 +10,7 @@ LIST
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTPS server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 1eec1bb2cf9d2d65e38ca7bdc0eefa92fb167b97..90473b33a0b78c781370f82a32de3d1d178b6a9c 100644 (file)
@@ -9,9 +9,7 @@ CURLOPT_PORT
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 1fb4e125544c12856d10617218d8342177b0e2dd..7985a52347e08309a4279ed579e1bc23d695325f 100644 (file)
@@ -12,22 +12,14 @@ FTP
 file contents
 </data>
 
+<data1>
+contents for file number two
+</data1>
+
 <datacheck>
 file contents
+contents for file number two
 </datacheck>
-<datacheck1 mode="text">
-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
-</datacheck1>
 </reply>
 
 # Client-side
@@ -44,7 +36,7 @@ lib%TESTNUMBER
 Two FTP fetches using different CURLOPT_FTP_FILEMETHOD
 </name>
 <command>
-ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER
+ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER ftp://%HOSTIP:%FTPPORT/path/to/the/file/%TESTNUMBER0001
 </command>
 </client>
 
@@ -63,8 +55,8 @@ RETR %TESTNUMBER
 SYST\r
 CWD /\r
 EPSV\r
-TYPE A\r
-LIST path/to/the/file/%TESTNUMBER.\r
+SIZE path/to/the/file/%TESTNUMBER0001\r
+RETR path/to/the/file/%TESTNUMBER0001\r
 QUIT\r
 </protocol>
 </verify>
index 436e1828bdb690b2a0d9af73495b6cbc5d32d970..3c151286c87a9607dab407ee1aa0ed959683d923 100644 (file)
@@ -11,10 +11,8 @@ ftplistparser
 
 #
 # Server-side
-<reply>
-<data mode="text">
-</data>
-</reply>
+#
+# Data is generated by the ftp server itself
 
 # Client-side
 <client>
index 656b3dd8b7bca093bda61d50ffb6e6753327c100..faafd903850d5d45e4b36a609e8af185e3d49e48 100644 (file)
@@ -11,9 +11,7 @@ SOCKS4
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 3ed89ec627349a9ae699fb7d850daced48a80c23..2c41dfea70d242402a87ee09f2e1e1842e5a98c1 100644 (file)
@@ -11,9 +11,7 @@ SOCKS5
 #
 # Server-side
 <reply>
-# When doing LIST, we get the default list output hard-coded in the test
-# FTP server
-<datacheck mode="text">
+<data mode="text">
 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
-</datacheck>
+</data>
 </reply>
 
 #
index 3da888976ac3648e383dc8d96ebeb62814137064..0b552e074b6376cbf068a35826efe3e852e77e4c 100755 (executable)
@@ -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 = $_;
index ebd6af1209475847a657ac3701736e58cc7655c4..2e079fae368d9fd9d7b041d41c86b94b171fc266 100644 (file)
@@ -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);
 
index 3d7ecfc8ba03a38124bb7dd291e1ff3d7d21f158..0d107ef11385bdb0d2a5580115794f2bcaf8489e 100644 (file)
@@ -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;
 }