haproxy/reg-tests/proxy/cli_del_backend.vtc
Willy Tarreau 11bad01760 MINOR: proxy: remove the experimental status on dynamic backends
As initially planned, if no trouble was reported on dynamic backend
commands on the CLI, the experimental status could be dropped before the
release. The feedback was not very broad, but was conclusive in that the
operations work as expected and the current syntax can be preserved even
for future evolutions. So we can drop the experimental status.
2026-05-19 14:56:45 +02:00

88 lines
1.9 KiB
Text

varnishtest "Delete backend via cli"
feature ignore_unknown_macro
haproxy h1 -conf {
global
.if feature(THREAD)
thread-groups 1
.endif
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}"
use_backend be_ref
listen li
bind "fd@${feli}"
backend be_ref
backend be
server s1 ${s1_addr}:${s1_port} disabled
# Defaults with tcp-check rules in it
# Currently this is the only case of runtime ref on an unnamed default
defaults
mode http
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
option httpchk GET / HTTP/1.1
backend be_unnamed_def_ref
backend be_unnamed_def_ref2
} -start
haproxy h1 -cli {
send "del backend other"
expect ~ "No such backend."
send "del backend li"
expect ~ "Cannot delete a listen section."
send "del backend be_ref"
expect ~ "This proxy cannot be removed at runtime due to other configuration elements pointing to it."
send "show stat be 2 -1"
expect ~ "be,BACKEND,"
send "del backend be"
expect ~ "Backend must be unpublished prior to its deletion."
send "unpublish backend be;"
expect ~ ".*"
send "del backend be"
expect ~ "Only a backend without server can be deleted."
send "del server be/s1"
expect ~ ".*"
send "del backend be"
expect ~ "Backend deleted."
send "show stat be 2 -1"
expect !~ "be,BACKEND,"
}
haproxy h1 -cli {
send "show stat be_unnamed_def_ref 2 -1"
expect ~ "be_unnamed_def_ref,BACKEND,"
send "unpublish backend be_unnamed_def_ref;"
expect ~ ".*"
send "del backend be_unnamed_def_ref"
expect ~ "Backend deleted."
send "show stat be_unnamed_def_ref 2 -1"
expect !~ "be_unnamed_def_ref,BACKEND,"
send "unpublish backend be_unnamed_def_ref2;"
expect ~ ".*"
send "del backend be_unnamed_def_ref2"
expect ~ "Backend deleted."
}