summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-20 23:00:13 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-21 16:38:53 +0100
commit58c4b8d6360f3afedb43848be199be4d383f1894 (patch)
treeeb1575b521b3b202cf4f09fcf1168d29fb88633a
parentf7a65979f30ae83fedcaf0103501d220d905bc29 (diff)
downloadcurl-58c4b8d6360f3afedb43848be199be4d383f1894.tar.gz
test: verify new --write-out variables
Extended test 1029 and added 1188
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test10294
-rw-r--r--tests/data/test118847
3 files changed, 51 insertions, 2 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index 998d6aab8..4b9fc44dc 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -139,6 +139,8 @@ test1160 test1161 test1162 test1163 test1164 test1165 test1166 test1167 \
test1168 test1170 test1171 test1172 test1173 test1174 test1175 \
test1176 test1177 test1178 test1179 \
\
+test1188 \
+\
test1190 test1191 test1192 test1193 test1194 test1195 test1196 test1197 \
test1198 test1199 \
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
diff --git a/tests/data/test1029 b/tests/data/test1029
index 9a351a4f3..36797e334 100644
--- a/tests/data/test1029
+++ b/tests/data/test1029
@@ -30,7 +30,7 @@ http
HTTP Location: and 'redirect_url' check
</name>
<command>
-http://%HOSTIP:%HTTPPORT/we/want/our/1029 -w '%{redirect_url}\n'
+http://%HOSTIP:%HTTPPORT/we/want/our/1029 -w '%{redirect_url} %{url} %{exitcode} %{errormsg}\n'
</command>
</client>
@@ -50,7 +50,7 @@ Content-Length: 62
Connection: close
This server reply is for testing a simple Location: following
-http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes
+http://%HOSTIP:%HTTPPORT/we/want/our/data/10290002.txt?coolsite=yes http://%HOSTIP:%HTTPPORT/we/want/our/1029 0 No error
</stdout>
</verify>
</testcase>
diff --git a/tests/data/test1188 b/tests/data/test1188
new file mode 100644
index 000000000..d2e741e4d
--- /dev/null
+++ b/tests/data/test1188
@@ -0,0 +1,47 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+--write-out
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Content-Length: 3
+Connection: close
+
+hi
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+--write-out with %{onerror} and %{urlnum} to stderr
+ </name>
+<command>
+http://%HOSTIP:%NOLISTENPORT/we/want/our/1188 http://%HOSTIP:%HTTPPORT/we/want/our/1188 -w '%{onerror}%{stderr}%{urlnum} says %{exitcode} %{errormsg}\n' -s
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /we/want/our/1188 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<stderr mode="text">
+0 says 7 Failed to connect to %HOSTIP port %NOLISTENPORT: Connection refused
+</stderr>
+</verify>
+</testcase>