From 58c4b8d6360f3afedb43848be199be4d383f1894 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 20 Dec 2020 23:00:13 +0100 Subject: [PATCH] test: verify new --write-out variables Extended test 1029 and added 1188 --- tests/data/Makefile.inc | 2 ++ tests/data/test1029 | 4 ++-- tests/data/test1188 | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 tests/data/test1188 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 -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' @@ -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 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 @@ + + + +HTTP +HTTP GET +--write-out + + + +# Server-side + + +HTTP/1.1 200 OK +Content-Length: 3 +Connection: close + +hi + + + +# Client-side + + +http + + +--write-out with %{onerror} and %{urlnum} to stderr + + +http://%HOSTIP:%NOLISTENPORT/we/want/our/1188 http://%HOSTIP:%HTTPPORT/we/want/our/1188 -w '%{onerror}%{stderr}%{urlnum} says %{exitcode} %{errormsg}\n' -s + + + +# Verify data after the test has been "shot" + + +GET /we/want/our/1188 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +User-Agent: curl/%VERSION +Accept: */* + + + +0 says 7 Failed to connect to %HOSTIP port %NOLISTENPORT: Connection refused + + +