haproxy/reg-tests/server/cli_set_fqdn.vtc
Willy Tarreau 9d511b3c27 REGTESTS: enable -dW on almost all tests to fail on warnings
Now that warnings were almost all removed, let's enable zero-warning
via -dW. All tests were adjusted, but two:

  - mcli/mcli_start_progs.vtc:
      the programs section currently cannot be silenced

  - stats/stats-file.vtc:
      the warning comes from the stats file itself on comment lines.

All other ones are now OK.
2024-11-19 09:27:08 +01:00

58 lines
1.5 KiB
Plaintext

varnishtest "Set server FQDN via CLI crash"
feature ignore_unknown_macro
# for "set server <srv> fqdn"
#REGTEST_TYPE=bug
# Do nothing. Is there only to create s1_* macros
server s1 {
} -start
haproxy h1 -arg '-dW' -conf {
defaults
mode http
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
frontend myfrontend
bind "fd@${my_fe}"
default_backend test
backend test
server www1 ${s1_addr}:${s1_port}
} -start
haproxy h2 -arg '-dW' -conf {
defaults
mode http
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
resolvers systemdns
parse-resolv-conf
frontend myfrontend
bind "fd@${my_fe}"
default_backend test
backend test
server www1 ${s1_addr}:${s1_port} resolvers systemdns resolve-prefer ipv4
} -start
haproxy h1 -cli {
send "set server test/www1 fqdn foo.fqdn"
expect ~ "set server <b>/<s> fqdn failed because no resolution is configured."
send "show servers state test"
expect ~ "test 1 www1 ${s1_addr} .* - ${s1_port}"
} -wait
haproxy h2 -cli {
send "set server test/www1 fqdn localhost"
expect ~ "test/www1 changed its FQDN from \\(null\\) to localhost"
send "show servers state test"
expect ~ "test 1 www1 127.0.0.1 .* localhost"
} -wait