Changelog
+Daniel Fandrich (30 Jul 2008)
+- Added test cases 1052 through 1055 to test uploading data from files
+ during redirects. Test cases 1052 and 1055 show problems (maybe the same
+ root cause as 1051) and are disabled.
+
Daniel Fandrich (29 Jul 2008)
- Fixed --use-ascii to properly convert text files on Symbian OS, MS-DOS
and OS/2.
- Added test case 1051 to test Location: following with PUT, as reported
- by Ben Sutcliffe. The test when run manually shows a problem in curl,
- but the test harness web server doesn't run the test correctly so it's
- disabled for now.
+ by Ben Sutcliffe. The test when run manually shows a problem in curl
+ so it's disabled.
Daniel Fandrich (28 Jul 2008)
- Fixed display of the interface bind address in the trace output when it's
# Lines starting with '#' letters are treated as comments.
1041
1051
+1052
+1055
test556 test1031 test628 test629 test630 test631 test632 test1032 \
test1033 test539 test1034 test1035 test1036 test1037 test1038 test1039 \
test1040 test1041 test1042 test1043 test1044 test1045 test1046 test1047 \
- test1048 test1049 test1050 test1051
+ test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055
filecheck:
@mkdir test-place; \
HTTP Location: redirect to FTP URL
</name>
<command>
--k http://%HOSTIP:%HTTPPORT/10280001 -L
+http://%HOSTIP:%HTTPPORT/10280001 -L
</command>
# The data section doesn't do variable substitution, so we must assert this
<precheck>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+followlocation
+</keywords>
+
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.0 301 Redirect swsclose\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: data/10520002.txt?coolsite=yes\r
+Content-Length: 0\r
+Connection: close\r
+\r
+</data>
+<data2>
+HTTP/1.0 200 Followed here fine swsclose\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 51\r
+\r
+If this is received, the location following worked
+</data2>
+<datacheck>
+HTTP/1.0 301 Redirect\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: data/10520002.txt?coolsite=yes\r
+Content-Length: 0\r
+Connection: Keep-Alive\r
+\r
+HTTP/1.0 200 Followed here fine swsclose\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 51\r
+\r
+If this is received, the location following worked
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP 1.0 PUT with Location: following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/want/1052 -0 -L -T log/test1052.txt
+</command>
+<file name="log/test1052.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /want/1052 HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 78\r
+\r
+PUT /want/data/10520002.txt?coolsite=yes HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 78\r
+\r
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+# Based on test 9
+<info>
+<keywords>
+HTTP
+HTTP FORMPOST
+HTTP file upload
+followredirect
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.0 307 Redirect swsclose\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: data/10530002.txt?coolsite=yes\r
+Content-Length: 0\r
+Connection: close\r
+\r
+</data>
+<data2>
+HTTP/1.0 200 OK swsclose\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+\r
+blablabla
+
+</data2>
+<datacheck>
+HTTP/1.0 307 Redirect swsclose\r
+Date: Thu, 29 Jul 2008 14:49:00 GMT\r
+Server: test-server/fake\r
+Location: data/10530002.txt?coolsite=yes\r
+Content-Length: 0\r
+Connection: close\r
+\r
+HTTP/1.0 200 OK swsclose\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+\r
+blablabla
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP RFC1867-type formposting from file with Location following
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/we/want/1053 -L -F name=daniel -F tool=curl -F file=@log/test1053.txt
+</command>
+# We create this file before the command is invoked!
+<file name="log/test1053.txt">
+foo-
+This is a moo-
+bar
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^(User-Agent:|Content-Type: multipart/form-data;|------------).*
+</strip>
+<protocol>
+POST /we/want/1053 HTTP/1.1\r
+User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 410\r
+Expect: 100-continue\r
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763\r
+\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="name"\r
+\r
+daniel\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="tool"\r
+\r
+curl\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="file"; filename="test1053.txt"\r
+Content-Type: text/plain\r
+\r
+foo-
+This is a moo-
+bar
+\r
+------------------------------9ef8d6205763--\r
+POST /we/want/data/10530002.txt?coolsite=yes HTTP/1.1\r
+User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 410\r
+Expect: 100-continue\r
+Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763\r
+\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="name"\r
+\r
+daniel\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="tool"\r
+\r
+curl\r
+------------------------------9ef8d6205763\r
+Content-Disposition: form-data; name="file"; filename="test1053.txt"\r
+Content-Type: text/plain\r
+\r
+foo-
+This is a moo-
+bar
+\r
+------------------------------9ef8d6205763--\r
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+followlocation
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 301 OK swsclose\r
+Location: moo.html&testcase=/10540002\r
+Date: Thu, 31 Jul 2008 14:49:00 GMT\r
+Connection: close\r
+\r
+</data>
+<data2>
+HTTP/1.1 200 OK swsclose\r
+Date: Thu, 31 Jul 2008 14:49:00 GMT\r
+Connection: close\r
+\r
+body
+</data2>
+<datacheck>
+HTTP/1.1 301 OK swsclose\r
+Location: moo.html&testcase=/10540002\r
+Date: Thu, 31 Jul 2008 14:49:00 GMT\r
+Connection: close\r
+\r
+HTTP/1.1 200 OK swsclose\r
+Date: Thu, 31 Jul 2008 14:49:00 GMT\r
+Connection: close\r
+\r
+body
+</datacheck>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST from file with 301 redirect and --post301
+ </name>
+<file name="log/test1054.txt">
+field=data
+</file>
+ <command>
+http://%HOSTIP:%HTTPPORT/blah/1054 -L -d @log/test1054.txt --post301
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol nonewline="yes">
+POST /blah/1054 HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 10\r
+Content-Type: application/x-www-form-urlencoded\r
+\r
+field=dataPOST /blah/moo.html&testcase=/10540002 HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+Content-Length: 10\r
+Content-Type: application/x-www-form-urlencoded\r
+\r
+field=data
+</protocol>
+</verify>
+</testcase>
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+followlocation
+FTP
+EPSV
+STOR
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 307 OK\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake swsclose\r
+Content-Type: text/html\r
+Location: ftp://127.0.0.1:8992/1055\r
+Content-Length: 0\r
+Connection: close\r
+\r
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+ftp
+</server>
+ <name>
+HTTP PUT Location: redirect to FTP URL
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1055 -L -T log/test1055.txt
+</command>
+# The data section doesn't do variable substitution, so we must assert this
+<precheck>
+perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"
+</precheck>
+<file name="log/test1055.txt">
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+PUT /1055 HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
+\r
+USER anonymous\r
+PASS ftp@example.com\r
+PWD\r
+EPSV\r
+TYPE I\r
+STOR 1055\r
+QUIT\r
+</protocol>
+<upload>
+Weird
+ file
+ to
+ upload
+for
+ testing
+the
+ PUT
+ feature
+</upload>
+</verify>
+</testcase>