mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-22 12:30:07 +00:00
f673923629
With the CI occasionally slowing down, we're starting to see again some spurious failures despite the long 1-second timeouts. This reports false positives that are disturbing and doesn't provide as much value as this could. However at this delay it already becomes a pain for developers to wait for the tests to complete. This commit adds support for the new environment variable HAPROXY_TEST_TIMEOUT that will allow anyone to modify the connect, client and server timeouts. It was set to 5 seconds by default, which should be plenty for quite some time in the CI. All relevant values that were 200ms or above were replaced by this one. A few larger values were left as they are special. One test for the set-timeout action that used to rely on a fixed 1-sec value was extended to a fixed 5-sec, as the timeout is normally not reached, but it needs to be known to compare the old and new values.
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
varnishtest "Health-checks: basic HTTP health-check though a socks4 proxy"
|
|
#REQUIRE_VERSION=2.0
|
|
#REGTEST_TYPE=slow
|
|
feature ignore_unknown_macro
|
|
|
|
# This scripts tests a simple HTTP health-checks though a socks4 proxy.
|
|
|
|
server s1 {
|
|
} -start
|
|
|
|
server socks {
|
|
## get socks4 request
|
|
recv 16
|
|
|
|
## send socks4 response :
|
|
## constant(1): 0x00
|
|
## statut(1) : 0x5a (success)
|
|
## padding(6) : ignored
|
|
sendhex "005A000000000000"
|
|
|
|
rxreq
|
|
expect req.method == OPTIONS
|
|
expect req.url == /
|
|
expect req.proto == HTTP/1.0
|
|
txresp
|
|
} -start
|
|
|
|
syslog S1 -level notice {
|
|
recv
|
|
expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be1/srv succeeded, reason: Layer7 check passed.+code: 200.+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 httpchk
|
|
server srv ${s1_addr}:${s1_port} socks4 ${h1_socks_addr}:${h1_socks_port} check-via-socks4 check inter 1s rise 1 fall 1
|
|
|
|
listen socks
|
|
bind "fd@${socks}"
|
|
tcp-request inspect-delay 500ms
|
|
## Accept socks4 request on 16 bytes :
|
|
## version(1) : 0x04
|
|
## command(1) : 0x01
|
|
## port(2) : ${s1_port}
|
|
## addr(4) : ${s1_addr}
|
|
## user-id : "HAProxy\0"
|
|
tcp-request content accept if { req.len eq 16 } { req.payload(0,1) -m bin "04" } { req.payload(1,1) -m bin "01" } { req.payload(2,2),hex,hex2i eq ${s1_port} } { req.payload(4,4),hex,hex2i -m ip ${s1_addr} } { req.payload(8,8) -m bin "484150726F787900" }
|
|
tcp-request content reject
|
|
server srv ${socks_addr}:${socks_port}
|
|
|
|
} -start
|
|
|
|
syslog S1 -wait
|