From 14424f7058cd6c2a5aa31dc179db3d4b7bc564a0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 18 Apr 2005 06:57:44 +0000 Subject: Modified the FTP server to use the new 'sockfilt' program to do all the socket level stuff. The FTP server communicates with sockfilt using perl's open2(). This enables easier IPv6 support and hopefully FTP-SSL support in the future. Added four test cases for FTP-ipv6. --- tests/data/Makefile.am | 2 +- tests/data/test103 | 6 ++++-- tests/data/test252 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test253 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test254 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test255 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 tests/data/test252 create mode 100644 tests/data/test253 create mode 100644 tests/data/test254 create mode 100644 tests/data/test255 (limited to 'tests/data') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 66c5f52ef..a1e455efa 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -34,7 +34,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \ test199 test225 test226 test227 test230 test231 test232 test228 \ test229 test233 test234 test235 test236 test520 test237 test238 \ test239 test243 test245 test246 test247 test248 test249 test250 \ - test251 + test251 test252 test253 test254 test255 # The following tests have been removed from the dist since they no longer # work. We need to fix the test suite's FTPS server first, then bring them diff --git a/tests/data/test103 b/tests/data/test103 index 87a640d20..b7ae60baf 100644 --- a/tests/data/test103 +++ b/tests/data/test103 @@ -26,8 +26,8 @@ ftp://%HOSTIP:%FTPPORT/a/path/103 -P - # Verify data after the test has been "shot" -s/^LPRT.*[\n]// -s/^EPRT.*[\n]// +s/^LPRT.*/LPRT/ +s/^EPRT.*/EPRT/ s/^(PORT 127,0,0,1,)([0-9,]+)/$1/ @@ -36,6 +36,8 @@ PASS curl_by_daniel@haxx.se PWD CWD a CWD path +EPRT +LPRT PORT 127,0,0,1, TYPE I SIZE 103 diff --git a/tests/data/test252 b/tests/data/test252 new file mode 100644 index 000000000..3e5ffa6d3 --- /dev/null +++ b/tests/data/test252 @@ -0,0 +1,57 @@ + + +FTP-ipv6 +EPSV + + +# +# Server-side + + +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 + + + +# +# Client-side + + +ipv6 + + +ftp-ipv6 + + +FTP IPv6 dir list PASV + + +-g "ftp://%HOST6IP:%FTP6PORT/" + + + +# +# Verify data after the test has been "shot" + + +filter off really nothing + + +USER anonymous +PASS curl_by_daniel@haxx.se +PWD +EPSV +TYPE A +LIST +QUIT + + diff --git a/tests/data/test253 b/tests/data/test253 new file mode 100644 index 000000000..7f66ae604 --- /dev/null +++ b/tests/data/test253 @@ -0,0 +1,57 @@ + + +FTP-ipv6 +EPRT + + +# +# Server-side + + +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 + + + +# +# Client-side + + +ipv6 + + +ftp-ipv6 + + +FTP IPv6 dir list with EPRT + + +-g "ftp://%HOST6IP:%FTP6PORT/" -P - + + + +# +# Verify data after the test has been "shot" + + +s/^(EPRT \|2\|::1\|)(.*)/$1/ + + +USER anonymous +PASS curl_by_daniel@haxx.se +PWD +EPRT |2|::1| +TYPE A +LIST +QUIT + + diff --git a/tests/data/test254 b/tests/data/test254 new file mode 100644 index 000000000..8466ce200 --- /dev/null +++ b/tests/data/test254 @@ -0,0 +1,58 @@ + + +FTP-ipv6 +EPSV +--disable-epsv + + +# +# Server-side + + +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 + + + +# +# Client-side + + +ipv6 + + +ftp-ipv6 + + +FTP IPv6 dir list PASV and --disable-epsv + + +-g "ftp://%HOST6IP:%FTP6PORT/" --disable-epsv + + + +# +# Verify data after the test has been "shot" + + +filter off really nothing + + +USER anonymous +PASS curl_by_daniel@haxx.se +PWD +EPSV +TYPE A +LIST +QUIT + + diff --git a/tests/data/test255 b/tests/data/test255 new file mode 100644 index 000000000..212847356 --- /dev/null +++ b/tests/data/test255 @@ -0,0 +1,58 @@ + + +FTP-ipv6 +EPRT +--disable-eprt + + +# +# Server-side + + +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 + + + +# +# Client-side + + +ipv6 + + +ftp-ipv6 + + +FTP IPv6 dir list with EPRT and --disable-eprt + + +-g "ftp://%HOST6IP:%FTP6PORT/" -P - --disable-eprt + + + +# +# Verify data after the test has been "shot" + + +s/^(EPRT \|2\|::1\|)(.*)/$1/ + + +USER anonymous +PASS curl_by_daniel@haxx.se +PWD +EPRT |2|::1| +TYPE A +LIST +QUIT + + -- cgit v1.2.3