summaryrefslogtreecommitdiffstats
path: root/reg-tests/server/cli_set_fqdn.vtc
blob: f82674f30ee8bc40a53d25f2bf82cdee53bc43d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 -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 -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