# This scripts tests health-checks for Redis application, enabled using
# "option redis-check" line. A intermediate listener is used to validate
# the request because it is impossible with VTEST to read and match raw
# text.
server s1 {
recv 14
send "+PONG\r\n"
} -start
server s2 {
recv 14
send "-Error message\r\n"
} -start
syslog S1 -level notice {
recv
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv succeeded, reason: Layer7 check passed.+info: \"Redis server is ok\".+check duration: [[:digit:]]+ms, status: 1/1 UP."
} -start
syslog S2 -level notice {
recv
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be2/srv failed, reason: Layer7 wrong status.+info: \"-Error message\".+check duration: [[:digit:]]+ms, status: 0/1 DOWN."