mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:23:32 +03:00
FTP: WILDCARDMATCH/CHUNKING/FNMATCH added
This commit is contained in:
parent
04cb15ae9d
commit
0825cd80a6
36 changed files with 3778 additions and 16 deletions
|
|
@ -60,6 +60,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
|||
test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
|
||||
test1080 test1081 test1082 test1083 test1084 test1085 test633 test634 \
|
||||
test635 test636 test637 test558 test559 test1086 test1087 test1088 \
|
||||
test574 test575 test576 test577 test1113 test1114 \
|
||||
test1089 test1090 test1091 test1092 test1093 test1094 test1095 test1096 \
|
||||
test1097 test560 test561 test1098 test1099 test562 test563 test1100 \
|
||||
test564 test1101 test1102 test1103 test1104 test299 test310 test311 \
|
||||
|
|
|
|||
71
tests/data/test1113
Normal file
71
tests/data/test1113
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
wildcardmatch
|
||||
ftplistparser
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<data mode="text">
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
</server>
|
||||
<tool>
|
||||
lib574
|
||||
</tool>
|
||||
<name>
|
||||
FTP wildcard download - changed fnmatch, 2x perform (DOS LIST response)
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*.txt
|
||||
</command>
|
||||
</client>
|
||||
|
||||
############################################
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<strip>
|
||||
^RETR.*
|
||||
^EPSV.*
|
||||
^PWD.*
|
||||
^CWD.*
|
||||
^TYPE.*
|
||||
^LIST.*
|
||||
</strip>
|
||||
<strippart>
|
||||
s/USER.*/USER/
|
||||
s/PASS.*/PASS/
|
||||
s/QUIT.*/QUIT/
|
||||
</strippart>
|
||||
# THERE SHOULD NOT BE "SIZE"! and once "USER && PASS"
|
||||
<protocol>
|
||||
USER
|
||||
PASS
|
||||
QUIT
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
136
tests/data/test1114
Normal file
136
tests/data/test1114
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
wildcardmatch
|
||||
ftplistparser
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
</server>
|
||||
<tool>
|
||||
lib576
|
||||
</tool>
|
||||
<name>
|
||||
FTP wildcard download - skip/parser_correctness/CURLOPT_FNMATCH_FUNCTION (DOS)
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<stdout mode="text">
|
||||
=============================================================
|
||||
Remains: 12
|
||||
Filename: .
|
||||
Size: 0B
|
||||
Time: 04-27-10 05:12AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 11
|
||||
Filename: ..
|
||||
Size: 0B
|
||||
Time: 04-23-10 03:12AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 10
|
||||
Filename: chmod1
|
||||
Size: 38B
|
||||
Time: 01-11-10 10:00AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 444
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 9
|
||||
Filename: chmod2
|
||||
Size: 38B
|
||||
Time: 02-01-10 08:00AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 666
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 8
|
||||
Filename: chmod3
|
||||
Size: 38B
|
||||
Time: 02-01-10 08:00AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 777
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 7
|
||||
Filename: chmod4
|
||||
Size: 0B
|
||||
Time: 05-04-10 04:31AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 6
|
||||
Filename: chmod5
|
||||
Size: 0B
|
||||
Time: 05-04-10 04:31AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 5
|
||||
Filename: empty_file.dat
|
||||
Size: 0B
|
||||
Time: 04-27-10 11:01AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 4
|
||||
Filename: file.txt
|
||||
Size: 35B
|
||||
Time: 04-27-10 11:01AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This is content of file "file.txt"
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 3
|
||||
Filename: .NeXT
|
||||
Size: 0B
|
||||
Time: 01-23-05 02:05AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 2
|
||||
Filename: someothertext.txt
|
||||
Size: 47B
|
||||
Time: 04-27-10 11:01AM
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 1
|
||||
Filename: weirddir.txt
|
||||
Size: 0B
|
||||
Time: 04-23-10 03:12AM
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
@ -45,7 +45,7 @@ EPSV
|
|||
TYPE I
|
||||
SIZE 146
|
||||
RETR 146
|
||||
CWD /nowhere/anywhere
|
||||
CWD /
|
||||
EPSV
|
||||
SIZE 146
|
||||
RETR 146
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ CWD dir1
|
|||
EPSV
|
||||
TYPE I
|
||||
STOR 149
|
||||
CWD /nowhere/anywhere
|
||||
CWD /
|
||||
CWD dir2
|
||||
EPSV
|
||||
STOR 149
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ TYPE I
|
|||
SIZE 539
|
||||
RETR 539
|
||||
SYST
|
||||
CWD /nowhere/anywhere
|
||||
CWD /
|
||||
EPSV
|
||||
TYPE A
|
||||
LIST path/to/the/file/539./
|
||||
|
|
|
|||
71
tests/data/test574
Normal file
71
tests/data/test574
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
wildcardmatch
|
||||
ftplistparser
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
<data mode="text">
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
</server>
|
||||
<tool>
|
||||
lib574
|
||||
</tool>
|
||||
<name>
|
||||
FTP wildcard download - changed fnmatch, 2x perform (UNIX LIST response)
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*.txt
|
||||
</command>
|
||||
</client>
|
||||
|
||||
############################################
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<strip>
|
||||
^RETR.*
|
||||
^EPSV.*
|
||||
^PWD.*
|
||||
^CWD.*
|
||||
^TYPE.*
|
||||
^LIST.*
|
||||
</strip>
|
||||
<strippart>
|
||||
s/USER.*/USER/
|
||||
s/PASS.*/PASS/
|
||||
s/QUIT.*/QUIT/
|
||||
</strippart>
|
||||
# THERE SHOULD NOT BE "SIZE"! and once "USER && PASS"
|
||||
<protocol>
|
||||
USER
|
||||
PASS
|
||||
QUIT
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
79
tests/data/test575
Normal file
79
tests/data/test575
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
multi
|
||||
wildcardmatch
|
||||
ftplistparser
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
</server>
|
||||
<tool>
|
||||
lib575
|
||||
</tool>
|
||||
<name>
|
||||
FTP wildcard download - dup_handle && multi interface
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*
|
||||
</command>
|
||||
</client>
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strip>
|
||||
^RETR.*
|
||||
^EPSV.*
|
||||
^CWD.*
|
||||
^PWD.*
|
||||
^TYPE.*
|
||||
</strip>
|
||||
<strippart>
|
||||
s/^USER.*/USER/
|
||||
s/^PASS.*/PASS/
|
||||
s/^LIST.*/LIST/
|
||||
s/^QUIT.*/QUIT/
|
||||
</strippart>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<protocol>
|
||||
USER
|
||||
PASS
|
||||
LIST
|
||||
LIST
|
||||
QUIT
|
||||
USER
|
||||
PASS
|
||||
LIST
|
||||
QUIT
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
This file should have permissions 444
|
||||
This file should have permissions 666
|
||||
This file should have permissions 777
|
||||
This is content of file "file.txt"
|
||||
Some junk ;-) This file does not really exist.
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
192
tests/data/test576
Normal file
192
tests/data/test576
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
FTP
|
||||
wildcardmatch
|
||||
ftplistparser
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
ftp
|
||||
</server>
|
||||
<tool>
|
||||
lib576
|
||||
</tool>
|
||||
<name>
|
||||
FTP wildcard download - skip/parser_correctness/CURLOPT_FNMATCH_FUNCTION (UNIX)
|
||||
</name>
|
||||
<command>
|
||||
ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
0
|
||||
</errorcode>
|
||||
<stdout mode="text">
|
||||
=============================================================
|
||||
Remains: 14
|
||||
Filename: .
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 20480B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 27 5:12
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 13
|
||||
Filename: ..
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 20480B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 23 3:12
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 12
|
||||
Filename: chmod1
|
||||
Permissions: r--r--r-- (parsed => 444)
|
||||
Size: 38B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Jan 11 10:00
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 444
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 11
|
||||
Filename: chmod2
|
||||
Permissions: rw-rw-rw- (parsed => 666)
|
||||
Size: 38B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Feb 1 8:00
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 666
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 10
|
||||
Filename: chmod3
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 38B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Feb 1 8:00
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This file should have permissions 777
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 9
|
||||
Filename: chmod4
|
||||
Permissions: --S--S--t (parsed => 7001)
|
||||
Size: 4096B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: May 4 4:31
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 8
|
||||
Filename: chmod5
|
||||
Permissions: --s--s--T (parsed => 7110)
|
||||
Size: 4096B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: May 4 4:31
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 7
|
||||
Filename: empty_file.dat
|
||||
Permissions: rw-r--r-- (parsed => 644)
|
||||
Size: 0B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 27 11:01
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 6
|
||||
Filename: file.txt
|
||||
Permissions: rw-r--r-- (parsed => 644)
|
||||
Size: 35B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 27 11:01
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
This is content of file "file.txt"
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 5
|
||||
Filename: link
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 0B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Jan 6 4:42
|
||||
Filetype: symlink
|
||||
Target: file.txt
|
||||
=============================================================
|
||||
Remains: 4
|
||||
Filename: link_absolute
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 0B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Jan 6 4:45
|
||||
Filetype: symlink
|
||||
Target: /data/ftp/file.txt
|
||||
=============================================================
|
||||
Remains: 3
|
||||
Filename: .NeXT
|
||||
Permissions: rwxrwxrwx (parsed => 777)
|
||||
Size: 4096B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Jan 23 2:05
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
Remains: 2
|
||||
Filename: someothertext.txt
|
||||
Permissions: rw-r--r-- (parsed => 644)
|
||||
Size: 47B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 27 11:01
|
||||
Filetype: regular file
|
||||
Content:
|
||||
-------------------------------------------------------------
|
||||
# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #
|
||||
-------------------------------------------------------------
|
||||
=============================================================
|
||||
Remains: 1
|
||||
Filename: weirddir.txt
|
||||
Permissions: rwxr-xrwx (parsed => 757)
|
||||
Size: 4096B
|
||||
User: ftp-default
|
||||
Group: ftp-default
|
||||
Time: Apr 23 3:12
|
||||
Filetype: directory
|
||||
=============================================================
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
38
tests/data/test577
Normal file
38
tests/data/test577
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
wildcardmatch
|
||||
</keywords>
|
||||
</info>
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
none
|
||||
</server>
|
||||
# tool is what to use instead of 'curl'
|
||||
<tool>
|
||||
lib577
|
||||
</tool>
|
||||
|
||||
<name>
|
||||
Curl_fnmatch() testing
|
||||
</name>
|
||||
<command>
|
||||
nothing
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<stdout mode="text">
|
||||
===========================
|
||||
===========================
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue