]> granicus.if.org Git - curl/commitdiff
tests 1356 to 1363: several -O -J -i -D combinations with FTP protocol
authorYang Tse <yangsita@gmail.com>
Mon, 4 Jun 2012 18:58:46 +0000 (20:58 +0200)
committerYang Tse <yangsita@gmail.com>
Mon, 4 Jun 2012 18:59:45 +0000 (20:59 +0200)
Currently 1356 to 1362 succeed but a write failure is logged in traceNNNN.

Currently 1363 fails, so disabled for now.

tests/data/DISABLED
tests/data/Makefile.am
tests/data/test1356 [new file with mode: 0644]
tests/data/test1357 [new file with mode: 0644]
tests/data/test1358 [new file with mode: 0644]
tests/data/test1359 [new file with mode: 0644]
tests/data/test1360 [new file with mode: 0644]
tests/data/test1361 [new file with mode: 0644]
tests/data/test1362 [new file with mode: 0644]
tests/data/test1363 [new file with mode: 0644]

index 310f3e9d292e6d69961fe10fc53e82ebf725b079..52e3185566079197c8f97ab843acf9775f0de221 100644 (file)
@@ -6,3 +6,4 @@
 1209
 1211
 1355
+1363
index 44fcb3f6ef06f4e6acaf15ca0928b9d20d64c42d..e48a1681268e2dfa63c28ece087044b33d72faf1 100644 (file)
@@ -86,7 +86,8 @@ test1322 test1323 test1324 test1325 test1326 test1327 test1328 test1329 \
 test1331 test1332 test1333 test1334 test1335 test1336 test1337 test1338 \
 test1339 test1340 test1341 test1342 test1343 test1344 test1345 test1346 \
 test1347 test1348 test1349 test1350 test1351 test1352 test1353 test1354 \
-test1355 \
+test1355 test1356 test1357 test1358 test1359 test1360 test1361 test1362 \
+test1363 \
 test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \
 test2000 test2001 test2002 test2003 test2004
 
diff --git a/tests/data/test1356 b/tests/data/test1356
new file mode 100644 (file)
index 0000000..177395e
--- /dev/null
@@ -0,0 +1,82 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1356 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1356; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with Content-Disposition inside, using -O
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1356 -O
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1356\r
+RETR file1356\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1356">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1356; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1356">
+</file2>
+
+<file3 name="log/stdout1356">
+</file3>
+
+<file4 name="log/name1356">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1357 b/tests/data/test1357
new file mode 100644 (file)
index 0000000..0defd83
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1357 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1357; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -D file
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1357 -O -D log/heads1357
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1357\r
+RETR file1357\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1357">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1357; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1357">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1357 () (214 bytes).\r
+226 File transfer complete\r
+</file2>
+<stripfile2>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile2>
+
+<file3 name="log/stdout1357">
+</file3>
+
+<file4 name="log/name1357">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1358 b/tests/data/test1358
new file mode 100644 (file)
index 0000000..5855d1d
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1358 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1358; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -D stdout
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1358 -O -D -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1358\r
+RETR file1358\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1358">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1358; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1358">
+</file2>
+
+<file3 name="log/stdout1358">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1358 () (214 bytes).\r
+226 File transfer complete\r
+</file3>
+<stripfile3>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile3>
+
+<file4 name="log/name1358">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1359 b/tests/data/test1359
new file mode 100644 (file)
index 0000000..62a8f51
--- /dev/null
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1359 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1359; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -J -D file
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1359 -O -J -D log/heads1359
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1359\r
+RETR file1359\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1359">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1359; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1359">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1359 () (214 bytes).\r
+226 File transfer complete\r
+</file2>
+<stripfile2>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile2>
+
+<file3 name="log/stdout1359">
+curl: Saved to filename '%PWD/log/file1359'
+</file3>
+
+<file4 name="log/name1359">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1360 b/tests/data/test1360
new file mode 100644 (file)
index 0000000..5367186
--- /dev/null
@@ -0,0 +1,100 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1360 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1360; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -J -D stdout
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1360 -O -J -D -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1360\r
+RETR file1360\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1360">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1360; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1360">
+</file2>
+
+<file3 name="log/stdout1360">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1360 () (214 bytes).\r
+226 File transfer complete\r
+curl: Saved to filename '%PWD/log/file1360'
+</file3>
+<stripfile3>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile3>
+
+<file4 name="log/name1360">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1361 b/tests/data/test1361
new file mode 100644 (file)
index 0000000..b30d900
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1361 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1361; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -i -D file
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1361 -O -i -D log/heads1361
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1361\r
+RETR file1361\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1361">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1361; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1361">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1361 () (214 bytes).\r
+226 File transfer complete\r
+</file2>
+<stripfile2>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile2>
+
+<file3 name="log/stdout1361">
+</file3>
+
+<file4 name="log/name1361">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1362 b/tests/data/test1362
new file mode 100644 (file)
index 0000000..7d603f6
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1362 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1362; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -i -D stdout
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1362 -O -i -D -
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1362\r
+RETR file1362\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1362">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1362; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1362">
+</file2>
+
+<file3 name="log/stdout1362">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1362 () (214 bytes).\r
+226 File transfer complete\r
+</file3>
+<stripfile3>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile3>
+
+<file4 name="log/name1362">
+</file4>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1363 b/tests/data/test1363
new file mode 100644 (file)
index 0000000..e222c78
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+<info>
+<keywords>
+FTP
+RETR
+</keywords>
+</info>
+
+# Server-side
+<reply>
+# file1363 contents...
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1363; charset=funny; option=strange
+
+MOOOO
+</data>
+</reply>
+
+# Client-side
+<client>
+# this relies on the debug feature to allow us to set directory to store the
+# -O output in, using the CURL_TESTDIR variable
+<features>
+debug
+</features>
+<server>
+ftp
+</server>
+<name>
+FTP download file with C-D inside, using -O -i, without -D
+</name>
+<setenv>
+CURL_TESTDIR=%PWD/log
+</setenv>
+<command option="no-output,no-include">
+ftp://%HOSTIP:%FTPPORT/path/file1363 -O -i
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+CWD path\r
+EPSV\r
+TYPE I\r
+SIZE file1363\r
+RETR file1363\r
+QUIT\r
+</protocol>
+
+<file1 name="log/file1363">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Content-Disposition: filename=name1363; charset=funny; option=strange
+
+MOOOO
+</file1>
+
+<file2 name="log/heads1363">
+</file2>
+
+<file3 name="log/stdout1363">
+220-        _   _ ____  _     \r
+220-    ___| | | |  _ \| |    \r
+220-   / __| | | | |_) | |    \r
+220-  | (__| |_| |  _ <| |___ \r
+220    \___|\___/|_| \_\_____|\r
+331 We are happy you popped in!\r
+230 Welcome you silly person\r
+257 "/" is current directory\r
+250 CWD command successful.\r
+229 Entering Passive Mode (stripped)
+200 I modify TYPE as you wanted\r
+213 214\r
+150 Binary data connection for 1363 () (214 bytes).\r
+226 File transfer complete\r
+</file3>
+<stripfile3>
+s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
+</stripfile3>
+
+<file4 name="log/name1363">
+</file4>
+
+</verify>
+</testcase>