diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:35:11 +0000 |
commit | da76459dc21b5af2449af2d36eb95226cb186ce2 (patch) | |
tree | 542ebb3c1e796fac2742495b8437331727bbbfa0 /reg-tests/server/cli_delete_server_lua.vtc | |
parent | Initial commit. (diff) | |
download | haproxy-upstream/2.6.12.tar.xz haproxy-upstream/2.6.12.zip |
Adding upstream version 2.6.12.upstream/2.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'reg-tests/server/cli_delete_server_lua.vtc')
-rw-r--r-- | reg-tests/server/cli_delete_server_lua.vtc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/reg-tests/server/cli_delete_server_lua.vtc b/reg-tests/server/cli_delete_server_lua.vtc new file mode 100644 index 0000000..396cd21 --- /dev/null +++ b/reg-tests/server/cli_delete_server_lua.vtc @@ -0,0 +1,43 @@ +# This script is to check that servers that are referenced by a lua script +# cannot be removed at runtime. +varnishtest "Delete lua server via cli" + +feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.5-dev0)'" +feature cmd "$HAPROXY_PROGRAM -cc 'feature(LUA)'" +feature ignore_unknown_macro + +server s1 { + rxreq + txresp +} -start + +haproxy h1 -conf { + global + lua-load ${testdir}/get_srv_stats.lua + + defaults + mode http + timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" + timeout client "${HAPROXY_TEST_TIMEOUT-5s}" + timeout server "${HAPROXY_TEST_TIMEOUT-5s}" + + frontend fe + bind "fd@${feS}" + default_backend test + + backend test + http-request add-header s1-stats %[lua.get_srv_stats(s1)] + server s1 ${s1_addr}:${s1_port} # referenced in lua script +} -start + +# make a request to force the execution of the lua script which references a +# server +client c1 -connect ${h1_feS_sock} { + txreq + rxresp +} -run + +haproxy h1 -cli { + send "experimental-mode on; del server test/s1" + expect ~ "This server cannot be removed at runtime due to other configuration elements pointing to it." +} |