From bc649593e4b27b17c5f9d4455d50123cdf6a66d3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 30 Jul 2008 21:04:44 +0000 Subject: 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. --- tests/data/DISABLED | 2 + tests/data/Makefile.am | 2 +- tests/data/test1028 | 2 +- tests/data/test1052 | 97 ++++++++++++++++++++++++++++++++++++++ tests/data/test1053 | 125 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test1054 | 80 +++++++++++++++++++++++++++++++ tests/data/test1055 | 89 +++++++++++++++++++++++++++++++++++ 7 files changed, 395 insertions(+), 2 deletions(-) create mode 100644 tests/data/test1052 create mode 100644 tests/data/test1053 create mode 100644 tests/data/test1054 create mode 100644 tests/data/test1055 (limited to 'tests/data') diff --git a/tests/data/DISABLED b/tests/data/DISABLED index 562ee823b..4b41d668a 100644 --- a/tests/data/DISABLED +++ b/tests/data/DISABLED @@ -5,3 +5,5 @@ # Lines starting with '#' letters are treated as comments. 1041 1051 +1052 +1055 diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index c47ee476a..df25a7247 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -54,7 +54,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \ 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; \ diff --git a/tests/data/test1028 b/tests/data/test1028 index 327b3c2c0..fd5162a70 100644 --- a/tests/data/test1028 +++ b/tests/data/test1028 @@ -45,7 +45,7 @@ ftp HTTP Location: redirect to FTP URL --k http://%HOSTIP:%HTTPPORT/10280001 -L +http://%HOSTIP:%HTTPPORT/10280001 -L # The data section doesn't do variable substitution, so we must assert this diff --git a/tests/data/test1052 b/tests/data/test1052 new file mode 100644 index 000000000..fac7e7d2f --- /dev/null +++ b/tests/data/test1052 @@ -0,0 +1,97 @@ + + + +HTTP +HTTP PUT +followlocation + + + +# Server-side + + +HTTP/1.0 301 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/10520002.txt?coolsite=yes +Content-Length: 0 +Connection: close + + + +HTTP/1.0 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + +If this is received, the location following worked + + +HTTP/1.0 301 Redirect +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/10520002.txt?coolsite=yes +Content-Length: 0 +Connection: Keep-Alive + +HTTP/1.0 200 Followed here fine swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Content-Length: 51 + +If this is received, the location following worked + + + +# Client-side + + +http + + +HTTP 1.0 PUT with Location: following + + +http://%HOSTIP:%HTTPPORT/want/1052 -0 -L -T log/test1052.txt + + +Weird + file + to + upload +for + testing +the + PUT + feature + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +PUT /want/1052 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 78 + +PUT /want/data/10520002.txt?coolsite=yes HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 78 + +Weird + file + to + upload +for + testing +the + PUT + feature + + + diff --git a/tests/data/test1053 b/tests/data/test1053 new file mode 100644 index 000000000..a898dbaf1 --- /dev/null +++ b/tests/data/test1053 @@ -0,0 +1,125 @@ + +# Based on test 9 + + +HTTP +HTTP FORMPOST +HTTP file upload +followredirect + + + +# Server-side + + +HTTP/1.0 307 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/10530002.txt?coolsite=yes +Content-Length: 0 +Connection: close + + + +HTTP/1.0 200 OK swsclose +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +blablabla + + + +HTTP/1.0 307 Redirect swsclose +Date: Thu, 29 Jul 2008 14:49:00 GMT +Server: test-server/fake +Location: data/10530002.txt?coolsite=yes +Content-Length: 0 +Connection: close + +HTTP/1.0 200 OK swsclose +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +blablabla + + + + +# Client-side + + +http + + +HTTP RFC1867-type formposting from file with Location following + + +http://%HOSTIP:%HTTPPORT/we/want/1053 -L -F name=daniel -F tool=curl -F file=@log/test1053.txt + +# We create this file before the command is invoked! + +foo- +This is a moo- +bar + + + +# Verify data after the test has been "shot" + + +^(User-Agent:|Content-Type: multipart/form-data;|------------).* + + +POST /we/want/1053 HTTP/1.1 +User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 410 +Expect: 100-continue +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 + +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="name" + +daniel +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="tool" + +curl +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="file"; filename="test1053.txt" +Content-Type: text/plain + +foo- +This is a moo- +bar + +------------------------------9ef8d6205763-- +POST /we/want/data/10530002.txt?coolsite=yes HTTP/1.1 +User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 410 +Expect: 100-continue +Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 + +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="name" + +daniel +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="tool" + +curl +------------------------------9ef8d6205763 +Content-Disposition: form-data; name="file"; filename="test1053.txt" +Content-Type: text/plain + +foo- +This is a moo- +bar + +------------------------------9ef8d6205763-- + + + diff --git a/tests/data/test1054 b/tests/data/test1054 new file mode 100644 index 000000000..72389b376 --- /dev/null +++ b/tests/data/test1054 @@ -0,0 +1,80 @@ + + + +HTTP +HTTP POST +followlocation + + + +# +# Server-side + + +HTTP/1.1 301 OK swsclose +Location: moo.html&testcase=/10540002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + + + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + +body + + +HTTP/1.1 301 OK swsclose +Location: moo.html&testcase=/10540002 +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + +HTTP/1.1 200 OK swsclose +Date: Thu, 31 Jul 2008 14:49:00 GMT +Connection: close + +body + + + +# +# Client-side + + +http + + +HTTP POST from file with 301 redirect and --post301 + + +field=data + + +http://%HOSTIP:%HTTPPORT/blah/1054 -L -d @log/test1054.txt --post301 + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +POST /blah/1054 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + +field=dataPOST /blah/moo.html&testcase=/10540002 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 10 +Content-Type: application/x-www-form-urlencoded + +field=data + + + diff --git a/tests/data/test1055 b/tests/data/test1055 new file mode 100644 index 000000000..7e2eae1b8 --- /dev/null +++ b/tests/data/test1055 @@ -0,0 +1,89 @@ + + + +HTTP +HTTP PUT +followlocation +FTP +EPSV +STOR + + + +# +# Server-side + + +HTTP/1.1 307 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake swsclose +Content-Type: text/html +Location: ftp://127.0.0.1:8992/1055 +Content-Length: 0 +Connection: close + + + + +# +# Client-side + + +http +ftp + + +HTTP PUT Location: redirect to FTP URL + + +http://%HOSTIP:%HTTPPORT/1055 -L -T log/test1055.txt + +# The data section doesn't do variable substitution, so we must assert this + +perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );" + + +Weird + file + to + upload +for + testing +the + PUT + feature + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +PUT /1055 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +USER anonymous +PASS ftp@example.com +PWD +EPSV +TYPE I +STOR 1055 +QUIT + + +Weird + file + to + upload +for + testing +the + PUT + feature + + + -- cgit v1.2.3