diff --git a/CHANGES b/CHANGES index 361e81662..cee4d48c8 100644 --- a/CHANGES +++ b/CHANGES @@ -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=" when using HTTP proxies for FTP urls. diff --git a/tests/data/test101 b/tests/data/test101 index a9314a71f..815292b2c 100644 --- a/tests/data/test101 +++ b/tests/data/test101 @@ -34,17 +34,16 @@ ftp FTP dir list, PORT with specified IP -ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP +ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test103 b/tests/data/test103 index 27d4cb0ef..15712f5da 100644 --- a/tests/data/test103 +++ b/tests/data/test103 @@ -33,18 +33,18 @@ ftp://%HOSTIP:%FTPPORT/a/path/103 -P - # Verify data after the test has been "shot" - -s/^LPRT.*[\r\n]*// -s/^EPRT.*[\r\n]*// -s/^(PORT 127,0,0,1,)([0-9,]+)/$1/ - +# Strip all valid kinds of PORT and EPRT that curl can send + +^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}\| + 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 diff --git a/tests/data/test108 b/tests/data/test108 index ff7b5e131..eb2ea63c1 100644 --- a/tests/data/test108 +++ b/tests/data/test108 @@ -31,10 +31,10 @@ Moooooooooooo # Verify data after the test has been "shot" +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test116 b/tests/data/test116 index d3718e393..b396c96b2 100644 --- a/tests/data/test116 +++ b/tests/data/test116 @@ -22,7 +22,7 @@ ftp FTP download, failed PORT -ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1 +ftp://%HOSTIP:%FTPPORT/116 -P 1.2.3.4 @@ -31,15 +31,17 @@ ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1 30 - -^PORT 127,0,0,1,.* -^EPRT .* -^LPRT .* - +# Strip the port number but leave the rest + +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/ + USER anonymous PASS ftp@example.com PWD +EPRT |1|1.2.3.4| +PORT 1,2,3,4, QUIT diff --git a/tests/data/test119 b/tests/data/test119 index 0db6d297c..00a24287b 100644 --- a/tests/data/test119 +++ b/tests/data/test119 @@ -32,10 +32,10 @@ ftp://%HOSTIP:%FTPPORT/119 -P - 19 +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test144 b/tests/data/test144 index 4a9f0038e..b6fa260cd 100644 --- a/tests/data/test144 +++ b/tests/data/test144 @@ -23,11 +23,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test145 b/tests/data/test145 index 931d52745..a35c3f0ac 100644 --- a/tests/data/test145 +++ b/tests/data/test145 @@ -26,11 +26,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l 19 -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test146 b/tests/data/test146 index 73895f29b..1c9779463 100644 --- a/tests/data/test146 +++ b/tests/data/test146 @@ -21,11 +21,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/146 ftp://%HOSTIP:%FTPPORT/146 # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test147 b/tests/data/test147 index 9d2b27aea..aaa4ca156 100644 --- a/tests/data/test147 +++ b/tests/data/test147 @@ -25,11 +25,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/147 --ftp-create-dirs # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test148 b/tests/data/test148 index ace4b4d4e..de0fa7ab3 100644 --- a/tests/data/test148 +++ b/tests/data/test148 @@ -22,11 +22,10 @@ ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/148 --ftp-create-dirs # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| 9 diff --git a/tests/data/test149 b/tests/data/test149 index c50f134eb..64c0c6ca4 100644 --- a/tests/data/test149 +++ b/tests/data/test149 @@ -21,11 +21,10 @@ send away this contents # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test212 b/tests/data/test212 index d00e677d7..9a802c0c3 100644 --- a/tests/data/test212 +++ b/tests/data/test212 @@ -31,9 +31,10 @@ data blobb # Verify data after the test has been "shot" +# Strip the addresses and port number but leave the rest -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/ 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 diff --git a/tests/data/test251 b/tests/data/test251 index 84d2a995d..6b0d321ec 100644 --- a/tests/data/test251 +++ b/tests/data/test251 @@ -36,11 +36,10 @@ ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test406 b/tests/data/test406 index d3ff294b4..3259bc6ae 100644 --- a/tests/data/test406 +++ b/tests/data/test406 @@ -39,18 +39,17 @@ ftps FTPS dir list, PORT with specified IP --k --ftp-ssl-control -P %HOSTIP ftps://%HOSTIP:%FTPSPORT/ +-k --ftp-ssl-control -P %CLIENTIP ftps://%HOSTIP:%FTPSPORT/ # # Verify data after the test has been "shot" -# strip all kinds of PORT, EPRT and LPRT curl can do +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test408 b/tests/data/test408 index 211d1fa04..d0aa13b8a 100644 --- a/tests/data/test408 +++ b/tests/data/test408 @@ -34,10 +34,10 @@ Moooooooooooo # Verify data after the test has been "shot" +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test525 b/tests/data/test525 index 598f54029..9c0d926ea 100644 --- a/tests/data/test525 +++ b/tests/data/test525 @@ -34,10 +34,10 @@ Moooooooooooo # Verify data after the test has been "shot" +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test529 b/tests/data/test529 index 1374c1642..6ee6fe926 100644 --- a/tests/data/test529 +++ b/tests/data/test529 @@ -34,10 +34,10 @@ Moooooooooooo # Verify data after the test has been "shot" +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous diff --git a/tests/data/test531 b/tests/data/test531 index 48807f03d..d986128fc 100644 --- a/tests/data/test531 +++ b/tests/data/test531 @@ -37,10 +37,10 @@ don't upload this # Verify data after the test has been "shot" +# Strip all valid kinds of PORT and EPRT that curl can send -^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}\| USER anonymous