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
This commit is contained in:
Daniel Stenberg 2024-07-29 10:17:08 +02:00
parent ae0b08ae6e
commit 14f630ecf6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
42 changed files with 103 additions and 213 deletions

View 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 .

View 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

View 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>
#

View 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>
#

View 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>
#

View 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

View 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>
#

View 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 .

View 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 .

View 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>
#

View 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>
#

View File

@ -19,15 +19,7 @@ Magic: sure you can FTP me
</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
Magic: sure you can FTP me
HTTP/1.1 200 Mighty fine indeed
Magic: sure you can FTP me
<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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>

View 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>

View 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>

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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

View 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

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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
CWD /
EPSV
TYPE A
LIST path/to/the/file/%TESTNUMBER.
SIZE path/to/the/file/%TESTNUMBER0001
RETR path/to/the/file/%TESTNUMBER0001
QUIT
</protocol>
</verify>

View 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>

View 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>
#

View 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>
#

View File

@ -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 = $_;

View 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);

View 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;
}