blob: 387c2990117a1731ebcd97df068b77c0ff622bf1 [file] [log] [blame]
William Dauchyf6370442020-11-14 19:25:33 +01001varnishtest "Set server ssl via CLI"
2
3feature ignore_unknown_macro
4
5# for "set server <srv> ssl"
6#REQUIRE_VERSION=2.4
William Lallemanda1ef7542020-11-18 17:41:28 +01007#REGTEST_TYPE=devel
8#REQUIRE_OPTIONS=OPENSSL
William Dauchyf6370442020-11-14 19:25:33 +01009
10# Do nothing. Is there only to create s1_* macros
11server s1 {
12} -start
13
14haproxy h1 -conf {
15 global
16 ssl-server-verify none
17
18 defaults
19 mode http
William Dauchyf6370442020-11-14 19:25:33 +010020 timeout connect 1s
21 timeout client 1s
22 timeout server 1s
23
24 frontend myfrontend
25 bind "fd@${my_fe}"
26 default_backend test0
27
28 backend test0
29 default-server ssl
30 server www0 ${s1_addr}:${s1_port} no-ssl
31
32 backend test1
33 server www0 ${s1_addr}:${s1_port} no-ssl
34} -start
35
36haproxy h1 -cli {
37 # supported case
38 send "show servers state test0"
39 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - -1"
40 send "set server test0/www0 ssl on"
41 expect ~ "server ssl setting updated"
42 send "show servers state test0"
43 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - 1"
44 send "set server test0/www0 ssl off"
45 expect ~ "server ssl setting updated"
46 send "show servers state test0"
47 expect ~ "test0 1 www0 ${s1_addr} .* - ${s1_port} - 0"
48
49 # unsupported case
50 send "show servers state test1"
51 expect ~ "test1 1 www0 ${s1_addr} .* - ${s1_port} - -1"
52 send "set server test1/www0 ssl on"
53 expect ~ "'set server <srv> ssl' cannot be set"
54} -wait