mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-11 22:15:14 +00:00
0d6fb7a3eb
This patch adds support to the following authentication methods: - AUTH_REQ_GSS (7) - AUTH_REQ_SSPI (9) - AUTH_REQ_SASL (10) Note that since AUTH_REQ_SASL allows multiple authentication mechanisms such as SCRAM-SHA-256 or SCRAM-SHA-256-PLUS, the auth payload length may vary since the method is sent in plaintext. In order to allow this, the regex now matches any payload length. This partially fixes Github issue #1508 since user authentication is still broken but should restore pre-2.2 behavior. This should be backported up to 2.2. Signed-off-by: Fatih Acar <facar@scaleway.com>
94 lines
2.9 KiB
Plaintext
94 lines
2.9 KiB
Plaintext
varnishtest "Health-checks: PostgreSQL health-check"
|
|
#REQUIRE_VERSION=2.2
|
|
#REGTEST_TYPE=slow
|
|
feature ignore_unknown_macro
|
|
|
|
# This scripts tests health-checks for PostgreSQL application, enabled using
|
|
# "option pgsql-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 23
|
|
sendhex "520000000800000000"
|
|
} -start
|
|
|
|
server s2 {
|
|
recv 23
|
|
sendhex "450000000B53464154414C00"
|
|
} -start
|
|
|
|
server s3 {
|
|
recv 23
|
|
send "Not a PostgreSQL response"
|
|
} -start
|
|
|
|
server s4 {
|
|
recv 23
|
|
sendhex "52000000170000000A534352414D2D5348412D3235360000"
|
|
} -start
|
|
|
|
syslog S1 -level notice {
|
|
recv
|
|
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv succeeded, reason: Layer7 check passed.+info: \"PostgreSQL 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 invalid response.+info: \"FATAL\".+check duration: [[:digit:]]+ms, status: 0/1 DOWN."
|
|
} -start
|
|
|
|
syslog S3 -level notice {
|
|
recv
|
|
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be3/srv failed, reason: Layer7 wrong status.+info: \"PostgreSQL unknown error\".+check duration: [[:digit:]]+ms, status: 0/1 DOWN."
|
|
} -start
|
|
|
|
syslog S4 -level notice {
|
|
recv
|
|
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be4/srv succeeded, reason: Layer7 check passed.+info: \"PostgreSQL server is ok\".+check duration: [[:digit:]]+ms, status: 1/1 UP."
|
|
} -start
|
|
|
|
haproxy h1 -conf {
|
|
defaults
|
|
mode tcp
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
backend be1
|
|
log ${S1_addr}:${S1_port} daemon
|
|
option log-health-checks
|
|
option pgsql-check user postgres
|
|
server srv ${h1_pgsql_addr}:${h1_pgsql_port} check inter 1s rise 1 fall 1
|
|
|
|
backend be2
|
|
log ${S2_addr}:${S2_port} daemon
|
|
option log-health-checks
|
|
option pgsql-check user postgres
|
|
server srv ${s2_addr}:${s2_port} check inter 1s rise 1 fall 1
|
|
|
|
backend be3
|
|
log ${S3_addr}:${S3_port} daemon
|
|
option log-health-checks
|
|
option pgsql-check user postgres
|
|
server srv ${s3_addr}:${s3_port} check inter 1s rise 1 fall 1
|
|
|
|
backend be4
|
|
log ${S4_addr}:${S4_port} daemon
|
|
option log-health-checks
|
|
option pgsql-check user postgres
|
|
server srv ${s4_addr}:${s4_port} check inter 1s rise 1 fall 1
|
|
|
|
listen pgsql1
|
|
bind "fd@${pgsql}"
|
|
tcp-request inspect-delay 100ms
|
|
tcp-request content accept if { req.len eq 23 } { req.payload(0,23) -m bin "00000017000300007573657200706f7374677265730000" }
|
|
tcp-request content reject
|
|
server srv ${s1_addr}:${s1_port}
|
|
} -start
|
|
|
|
syslog S1 -wait
|
|
syslog S2 -wait
|
|
syslog S3 -wait
|
|
syslog S4 -wait
|