Changed some FTP tests to validate the format of the PORT and EPRT commands

sent by curl, if not the addresses themselves.
This commit is contained in:
Dan Fandrich 2007-09-17 21:44:57 +00:00
Родитель 048c74f2fa
Коммит 7f496d8c3f
19 изменённых файлов: 74 добавлений и 73 удалений

Просмотреть файл

@ -6,6 +6,13 @@
Changelog
Dan F (17 September 2007)
- Added hooks to the test suite to make it possible to test a curl running
on a remote host.
- Changed some FTP tests to validate the format of the PORT and EPRT commands
sent by curl, if not the addresses themselves.
Daniel S (15 September 2007)
- Michal Marek made libcurl automatically append ";type=<a|i>" when using HTTP
proxies for FTP urls.

Просмотреть файл

@ -34,17 +34,16 @@ ftp
FTP dir list, PORT with specified IP
</name>
<command>
ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP
ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP
</command>
</client>
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -33,18 +33,18 @@ ftp://%HOSTIP:%FTPPORT/a/path/103 -P -
# Verify data after the test has been "shot"
<verify>
<strippart>
s/^LPRT.*[\r\n]*//
s/^EPRT.*[\r\n]*//
s/^(PORT 127,0,0,1,)([0-9,]+)/$1/
</strippart>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
CWD a
CWD path
PORT 127,0,0,1,
PORT 127,0,0,1,0,0
TYPE I
SIZE 103
RETR 103

Просмотреть файл

@ -31,10 +31,10 @@ Moooooooooooo
# Verify data after the test has been "shot"
<verify>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT .*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -22,7 +22,7 @@ ftp
FTP download, failed PORT
</name>
<command>
ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1
ftp://%HOSTIP:%FTPPORT/116 -P 1.2.3.4
</command>
</client>
@ -31,15 +31,17 @@ ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1
<errorcode>
30
</errorcode>
<strip>
^PORT 127,0,0,1,.*
^EPRT .*
^LPRT .*
</strip>
# Strip the port number but leave the rest
<strippart>
s/^(PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},)\d{1,3},\d{1,3}/$1/
s/^(EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|)\d{1,5}\|/$1/
</strippart>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
EPRT |1|1.2.3.4|
PORT 1,2,3,4,
QUIT
</protocol>
</verify>

Просмотреть файл

@ -32,10 +32,10 @@ ftp://%HOSTIP:%FTPPORT/119 -P -
<errorcode>
19
</errorcode>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT.*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -23,11 +23,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -26,11 +26,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l
<errorcode>
19
</errorcode>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -21,11 +21,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/146 ftp://%HOSTIP:%FTPPORT/146
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -25,11 +25,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/147 --ftp-create-dirs
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -22,11 +22,10 @@ ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/148 --ftp-create-dirs
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<errorcode>
9

Просмотреть файл

@ -21,11 +21,10 @@ send away this contents
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -31,9 +31,10 @@ data blobb
# Verify data after the test has been "shot"
<verify>
# Strip the addresses and port number but leave the rest
<strippart>
s/^(EPRT \|1\|127.0.0.1).*/$1/
s/^(PORT 127,0,0,1,).*/$1/
s/^(EPRT \|1\|)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|/$1/
s/^(PORT )\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}/$1/
</strippart>
<protocol>
USER anonymous
@ -41,12 +42,12 @@ PASS ftp@example.com
PWD
CWD a
CWD path
EPRT |1|127.0.0.1
PORT 127,0,0,1,
EPRT |1|
PORT
TYPE I
SIZE 212
RETR 212
PORT 127,0,0,1,
PORT
SIZE 212
RETR 212
QUIT

Просмотреть файл

@ -36,11 +36,10 @@ ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -39,18 +39,17 @@ ftps
FTPS dir list, PORT with specified IP
</name>
<command>
-k --ftp-ssl-control -P %HOSTIP ftps://%HOSTIP:%FTPSPORT/
-k --ftp-ssl-control -P %CLIENTIP ftps://%HOSTIP:%FTPSPORT/
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
# strip all kinds of PORT, EPRT and LPRT curl can do
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT 127,0,0,1,.*
^EPRT.*
^LPRT.*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -34,10 +34,10 @@ Moooooooooooo
# Verify data after the test has been "shot"
<verify>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT .*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -34,10 +34,10 @@ Moooooooooooo
# Verify data after the test has been "shot"
<verify>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT .*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -34,10 +34,10 @@ Moooooooooooo
# Verify data after the test has been "shot"
<verify>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT .*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous

Просмотреть файл

@ -37,10 +37,10 @@ don't upload this
# Verify data after the test has been "shot"
<verify>
# Strip all valid kinds of PORT and EPRT that curl can send
<strip>
^PORT .*
^EPRT .*
^LPRT .*
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
</strip>
<protocol>
USER anonymous