sent by curl, if not the addresses themselves.
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.
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\r
# 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\r
PASS ftp@example.com\r
PWD\r
CWD a\r
CWD path\r
-PORT 127,0,0,1,\r
+PORT 127,0,0,1,0,0\r
TYPE I\r
SIZE 103\r
RETR 103\r
# 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\r
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>
<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\r
PASS ftp@example.com\r
PWD\r
+EPRT |1|1.2.3.4|\r
+PORT 1,2,3,4,\r
QUIT\r
</protocol>
</verify>
<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\r
# 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\r
<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\r
# 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\r
# 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\r
# 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
# 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\r
# 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\r
PWD\r
CWD a\r
CWD path\r
-EPRT |1|127.0.0.1
-PORT 127,0,0,1,
+EPRT |1|\r
+PORT \r
TYPE I\r
SIZE 212\r
RETR 212\r
-PORT 127,0,0,1,
+PORT \r
SIZE 212\r
RETR 212\r
QUIT\r
# 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\r
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\r
# 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\r
# 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\r
# 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\r
# 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\r