diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:18:05 +0000 |
commit | b46aad6df449445a9fc4aa7b32bd40005438e3f7 (patch) | |
tree | 751aa858ca01f35de800164516b298887382919d /reg-tests/http-errorfiles/http_return.vtc | |
parent | Initial commit. (diff) | |
download | haproxy-b46aad6df449445a9fc4aa7b32bd40005438e3f7.tar.xz haproxy-b46aad6df449445a9fc4aa7b32bd40005438e3f7.zip |
Adding upstream version 2.9.5.upstream/2.9.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | reg-tests/http-errorfiles/http_return.vtc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/reg-tests/http-errorfiles/http_return.vtc b/reg-tests/http-errorfiles/http_return.vtc new file mode 100644 index 0000000..8db77a9 --- /dev/null +++ b/reg-tests/http-errorfiles/http_return.vtc @@ -0,0 +1,46 @@ +varnishtest "Test the HTTP return action with errorfiles" +#REQUIRE_VERSION=2.2 + +# This config tests the HTTP return action when error files are used to reply to +# the client. + +feature ignore_unknown_macro + +haproxy h1 -conf { + http-errors errors-2 + errorfile 400 ${testdir}/errors/400-2.http + + defaults + mode http + timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" + timeout client "${HAPROXY_TEST_TIMEOUT-5s}" + timeout server "${HAPROXY_TEST_TIMEOUT-5s}" + + frontend fe1 + bind "fd@${fe1}" + errorfile 400 ${testdir}/errors/400.http + http-request return status 400 default-errorfiles if { path /def } + http-request return status 400 errorfile ${testdir}/errors/400-1.http if { path /400-1 } + http-request return status 400 errorfiles errors-2 if { path /400-2 } +} -start + +client c1 -connect ${h1_fe1_sock} { + txreq -req GET -url /def + rxresp + expect resp.status == 400 + expect resp.http.x-err-type == "default" +} -run + +client c1r2 -connect ${h1_fe1_sock} { + txreq -req GET -url /400-1 + rxresp + expect resp.status == 400 + expect resp.http.x-err-type == "errors-1" +} -run + +client c1r3 -connect ${h1_fe1_sock} { + txreq -req GET -url /400-2 + rxresp + expect resp.status == 400 + expect resp.http.x-err-type == "errors-2" +} -run |