aboutsummaryrefslogtreecommitdiff
path: root/tests/data/test650
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2017-09-07 19:11:02 +0100
committerPatrick Monnerat <patrick@monnerat.net>2017-09-07 19:11:02 +0100
commit3620e569b312476f1e63b298106f942079b5afe8 (patch)
tree29ac559fce9c8200040f72f5ccef4ff83f674f77 /tests/data/test650
parent3dab9f6c71b0a2d7651109c8da43788eaad2a2f5 (diff)
form API: add new test 650.
Now that the form API is deprecated and not used anymore in curl tool, a lot of its features left untested. Test 650 attempts to check all these features not tested elsewhere.
Diffstat (limited to 'tests/data/test650')
-rw-r--r--tests/data/test650122
1 files changed, 122 insertions, 0 deletions
diff --git a/tests/data/test650 b/tests/data/test650
new file mode 100644
index 000000000..f429eac2f
--- /dev/null
+++ b/tests/data/test650
@@ -0,0 +1,122 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+FORM
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
+hello
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib650
+</tool>
+
+ <name>
+HTTP formpost using form API
+ </name>
+<stdin>
+ Some data from stdin
+</stdin>
+ <command>
+http://%HOSTIP:%HTTPPORT/650 log/test650.filedata
+</command>
+<file name="log/test650.filedata">
+This is data from a file.
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strippart>
+s/^--------------------------[a-z0-9]*/------------------------------/
+s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
+</strippart>
+# Note that the stripping above removes 12 bytes from every occurrence of the
+# boundary string and since 5 of them are in the body contents, we see
+# (5*12) == 60 bytes less
+<protocol>
+POST /650 HTTP/1.1
+Host: 127.0.0.1:8990
+Accept: */*
+Transfer-Encoding: chunked
+Content-Type: multipart/form-data; boundary=----------------------------
+Expect: 100-continue
+
+5f0
+------------------------------
+Content-Disposition: form-data; name="fieldname"
+
+this is what we post to the silly web server
+------------------------------
+Content-Disposition: form-data; name="fieldnam"
+
+uhis is what we post to the silly web serve
+------------------------------
+Content-Disposition: form-data; name="multifile"
+Content-Type: multipart/mixed; boundary=----------------------------
+
+------------------------------
+Content-Disposition: attachment; filename="test650.filedata"
+Content-Type: application/octet-stream
+
+This is data from a file.
+
+------------------------------
+Content-Disposition: attachment; filename="test650.filedata"
+Content-Type: text/whatever
+
+This is data from a file.
+
+------------------------------
+Content-Disposition: attachment; filename="test650.filedata"
+Content-Type: text/whatever
+
+This is data from a file.
+
+--------------------------------
+
+------------------------------
+Content-Disposition: form-data; name="filecontents"
+X-customheader-1: Header 1 data
+X-customheader-2: Header 2 data
+
+This is data from a file.
+
+------------------------------
+Content-Disposition: form-data; name="formlength"
+
+1341
+------------------------------
+Content-Disposition: form-data; name="standardinput"
+Content-Type: application/octet-stream
+
+ Some data from stdin
+
+--------------------------------
+
+0
+
+</protocol>
+</verify>
+</testcase>