blob: c4b0b534e314f082eea1381f8790e8b8e7c87447 [file] [log] [blame]
Christopher Fauletaec7f762020-04-22 15:16:58 +02001varnishtest "Health-checks: ssl-hello health-check"
2#REQUIRE_OPTION=OPENSSL
3#REQUIRE_VERSION=2.2
4#REGTEST_TYPE=slow
5feature ignore_unknown_macro
6
7# This scripts tests health-checks for SSL application, enabled using
8# "option ssl-hello-chk" line.
9
10syslog S1 -level notice {
11 recv
12 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be1 started."
13 recv
14 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv succeeded, reason: Layer6 check passed.+check duration: [[:digit:]]+ms, status: 1/1 UP."
15} -start
16
17
18syslog S2 -level notice {
19 recv
20 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be2 started."
21 recv
22 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv failed, reason: Layer6 invalid response.+info: \"TCPCHK got an empty response at step 2\".+check duration: [[:digit:]]+ms, status: 0/1 DOWN."
23} -start
24
25syslog S3 -level notice {
26 recv
27 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Proxy be3 started."
28 recv
29 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be3/srv failed, reason: Layer6 invalid response.+check duration: [[:digit:]]+ms, status: 0/1 DOWN."
30} -start
31
32haproxy htst -conf {
33 global
34 tune.ssl.default-dh-param 2048
35
36 defaults
37 mode tcp
38 timeout client 1s
39 timeout server 1s
40 timeout connect 100ms
41
42 frontend fe1
43 bind "fd@${fe1}" ssl crt ${testdir}/common.pem
44
45 frontend fe2
46 bind "fd@${fe2}"
47
48 frontend fe3
49 mode http
50 bind "fd@${fe3}"
51
52} -start
53
54haproxy h1 -conf {
55 defaults
56 mode tcp
57 timeout client 1s
58 timeout server 1s
59 timeout connect 100ms
60
61 backend be1
62 log ${S1_addr}:${S1_port} daemon
63 option log-health-checks
64 option ssl-hello-chk
65 server srv ${htst_fe1_addr}:${htst_fe1_port} check inter 1s rise 1 fall 1
66
67 backend be2
68 log ${S2_addr}:${S2_port} daemon
69 option log-health-checks
70 option ssl-hello-chk
71 server srv ${htst_fe2_addr}:${htst_fe2_port} check inter 1s rise 1 fall 1
72
73 backend be3
74 log ${S3_addr}:${S3_port} daemon
75 option log-health-checks
76 option ssl-hello-chk
77 server srv ${htst_fe3_addr}:${htst_fe3_port} check inter 1s rise 1 fall 1
78} -start
79
80syslog S1 -wait
81syslog S2 -wait
82syslog S3 -wait