aboutsummaryrefslogtreecommitdiff
path: root/tests/data
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
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')
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test650122
2 files changed, 123 insertions, 1 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index d7ea5c951..d34e1351b 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -78,7 +78,7 @@ test608 test609 test610 test611 test612 test613 test614 test615 test616 \
test617 test618 test619 test620 test621 test622 test623 test624 test625 \
test626 test627 test628 test629 test630 test631 test632 test633 test634 \
test635 test636 test637 test638 test639 test640 test641 test642 \
-test643 test644 test645 test646 test647 test648 test649 \
+test643 test644 test645 test646 test647 test648 test649 test650 \
\
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
test709 test710 test711 test712 test713 test714 test715 \
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>