summaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-09-12 18:27:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-09-14 12:53:12 +0200
commit7ea2e1d0c5a7fc7e2797a2d3c2a2429d6e09e581 (patch)
treef9434e82a665d1efe97926cb7c7f14080f14624e /tests/data
parenta1679498481de5b83532042d1b5bbd269b277a82 (diff)
downloadcurl-7ea2e1d0c5a7fc7e2797a2d3c2a2429d6e09e581.tar.gz
ftp: a 550 response to SIZE returns CURLE_REMOTE_FILE_NOT_FOUND
This is primarily interesting for cases where CURLOPT_NOBODY is set as previously curl would not return an error for this case. MDTM getting 550 now also returns this error (it returned CURLE_FTP_COULDNT_RETR_FILE before) in order to unify return codes for missing files across protocols and specific FTP commands. libcurl already returns error on a 550 as a MDTM response (when CURLOPT_FILETIME is set). If CURLOPT_NOBODY is not set, an error would happen subsequently anyway since the RETR command would fail. Add test 1913 and 1914 to verify. Updated several tests accordingly due to the updated SIZE behavior. Reported-by: Tomas Berger Fixes #5953 Closes #5957
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test10961
-rw-r--r--tests/data/test1181
-rw-r--r--tests/data/test1191
-rw-r--r--tests/data/test1381
-rw-r--r--tests/data/test191341
-rw-r--r--tests/data/test191442
-rw-r--r--tests/data/test2353
-rw-r--r--tests/data/test2361
-rw-r--r--tests/data/test5114
-rw-r--r--tests/data/test5332
-rw-r--r--tests/data/test5342
-rw-r--r--tests/data/test5462
13 files changed, 97 insertions, 6 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 3832e26b4..606a6031a 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -207,7 +207,7 @@ test1700 test1701 test1702 \
test1800 test1801 \
\
test1904 test1905 test1906 test1907 \
-test1908 test1909 test1910 test1911 test1912 \
+test1908 test1909 test1910 test1911 test1912 test1913 test1914 \
\
test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \
test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \
diff --git a/tests/data/test1096 b/tests/data/test1096
index 30748c1b4..a6c32c3a1 100644
--- a/tests/data/test1096
+++ b/tests/data/test1096
@@ -11,6 +11,7 @@ FAILURE
<reply>
<servercmd>
REPLY RETR 550 no such file!
+REPLY SIZE 500 command not understood
</servercmd>
</reply>
diff --git a/tests/data/test118 b/tests/data/test118
index 6cd086ca2..94985e319 100644
--- a/tests/data/test118
+++ b/tests/data/test118
@@ -12,6 +12,7 @@ FAILURE
<servercmd>
REPLY RETR 314 bluah you f00l!
REPLY EPSV 314 bluah you f00l!
+REPLY SIZE 500 command not understood
</servercmd>
</reply>
diff --git a/tests/data/test119 b/tests/data/test119
index 00a24287b..95d1021ca 100644
--- a/tests/data/test119
+++ b/tests/data/test119
@@ -11,6 +11,7 @@ FAILURE
<reply>
<servercmd>
REPLY RETR 314 bluah you f00l!
+REPLY SIZE 500 command not understood
</servercmd>
</reply>
diff --git a/tests/data/test138 b/tests/data/test138
index 4eb73e6cf..873313848 100644
--- a/tests/data/test138
+++ b/tests/data/test138
@@ -15,6 +15,7 @@ this is file contents
</size>
<servercmd>
RETRNOSIZE
+REPLY SIZE 500 command not understood
</servercmd>
</reply>
diff --git a/tests/data/test1913 b/tests/data/test1913
new file mode 100644
index 000000000..daf749025
--- /dev/null
+++ b/tests/data/test1913
@@ -0,0 +1,41 @@
+<testcase>
+<info>
+<keywords>
+FTP
+CURLOPT_NOBODY
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<servercmd>
+REPLY SIZE 550 no such file
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+
+# require debug so that alt-svc can work over plain old HTTP
+<name>
+FTP with NOBODY set, getting a missing file
+</name>
+<tool>
+lib1913
+</tool>
+
+<command>
+ftp://%HOSTIP:%FTPPORT/not-there/1913
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+78
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1914 b/tests/data/test1914
new file mode 100644
index 000000000..1aa3e48c0
--- /dev/null
+++ b/tests/data/test1914
@@ -0,0 +1,42 @@
+<testcase>
+<info>
+<keywords>
+FTP
+CURLOPT_NOBODY
+CURLOPT_FILETIME
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<servercmd>
+REPLY MDTM 550 no such file
+</servercmd>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+
+# require debug so that alt-svc can work over plain old HTTP
+<name>
+FTP with NOBODY and FILETIME set, getting a missing file
+</name>
+<tool>
+lib1913
+</tool>
+
+<command>
+ftp://%HOSTIP:%FTPPORT/not-there/1913 1
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<errorcode>
+78
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test235 b/tests/data/test235
index 625023221..94abb951c 100644
--- a/tests/data/test235
+++ b/tests/data/test235
@@ -7,6 +7,9 @@ FTP
# Server-side
<reply>
+<servercmd>
+REPLY SIZE 500 command not understood
+</servercmd>
</reply>
# Client-side
diff --git a/tests/data/test236 b/tests/data/test236
index 9ba706f1d..92e34bc3e 100644
--- a/tests/data/test236
+++ b/tests/data/test236
@@ -11,6 +11,7 @@ FTP
REPLY SIZE 550 access to this file is very much denied
REPLY APPE 550 I said: access to this file is very much denied
REPLY STOR 550 I said: access to this file is very much denied
+REPLY SIZE 500 command not understood
</servercmd>
</reply>
diff --git a/tests/data/test511 b/tests/data/test511
index 72b79938c..1a251fd89 100644
--- a/tests/data/test511
+++ b/tests/data/test511
@@ -35,9 +35,9 @@ ftp://%HOSTIP:%FTPPORT/511
#
# Verify data after the test has been "shot"
<verify>
-# CURLE_FTP_COULDNT_RETR_FILE
+# CURLE_REMOTE_FILE_NOT_FOUND
<errorcode>
-19
+78
</errorcode>
<protocol>
USER anonymous
diff --git a/tests/data/test533 b/tests/data/test533
index f4446cbe0..a67c8c824 100644
--- a/tests/data/test533
+++ b/tests/data/test533
@@ -15,7 +15,7 @@ multi
<servercmd>
REPLY RETR 550 the file doesn't exist
-REPLY SIZE 550 Can't check for file existence
+REPLY SIZE 500 Can't check for file existence
</servercmd>
</reply>
diff --git a/tests/data/test534 b/tests/data/test534
index 6045dba61..ba3f721e7 100644
--- a/tests/data/test534
+++ b/tests/data/test534
@@ -16,7 +16,7 @@ non-existing host
<servercmd>
REPLY RETR 550 the file doesn't exist
-REPLY SIZE 550 Can't check for file existence
+REPLY SIZE 500 Can't check for file existence
</servercmd>
</reply>
diff --git a/tests/data/test546 b/tests/data/test546
index 12e604a0e..00dca99fa 100644
--- a/tests/data/test546
+++ b/tests/data/test546
@@ -21,7 +21,7 @@ works
<servercmd>
REPLY RETR 550 the file doesn't exist
COUNT RETR 1
-REPLY SIZE 550 Can't check for file existence
+REPLY SIZE 500 Can't check for file existence
COUNT SIZE 1
</servercmd>
</reply>