mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-23 13:17:16 +00:00
db522b542e
A few regtests continue to regularly fail in highly loaded VMs because
they have very short timeouts. Actually the goal of running with short
timeouts was to make sure we do not uselessly wait during tests designed
to trigger them, but these timeouts here are never supposed to fire at
all, so they don't need to be kept in the 15-20ms range. They do not
pose any issue on any regular machine, but VMs are often suffering from
huge time jumps and cannot always produce responses in that short of a
time.
Just like with commit ce6fc25b1
("REGTEST: increase timeouts on the
seamless-reload test"), let's raise these short timeouts to 1 second.
A few other ones remain set to 150-200ms and do not seem to cause any
issue. Some are actually expected to trigger so let's not touch them
for now.
81 lines
1.6 KiB
Plaintext
81 lines
1.6 KiB
Plaintext
varnishtest "haproxy ACL, CLI and mCLI spaces"
|
|
feature ignore_unknown_macro
|
|
|
|
#REQUIRE_VERSION=2.0
|
|
|
|
server s1 {
|
|
rxreq
|
|
expect req.method == "GET"
|
|
txresp
|
|
} -repeat 2 -start
|
|
|
|
haproxy h1 -W -S -conf {
|
|
defaults
|
|
mode http
|
|
${no-htx} option http-use-htx
|
|
log global
|
|
option httplog
|
|
timeout connect 1s
|
|
timeout client 1s
|
|
timeout server 1s
|
|
|
|
frontend fe1
|
|
bind "fd@${fe1}"
|
|
|
|
http-request deny if { req.hdr(user-agent) -i -m str -f ${testdir}/agents.acl }
|
|
|
|
default_backend be1
|
|
|
|
backend be1
|
|
server s1 ${s1_addr}:${s1_port}
|
|
|
|
} -start
|
|
|
|
client c1 -connect ${h1_fe1_sock} {
|
|
txreq -hdr "User-Agent: Mon User Agent"
|
|
rxresp
|
|
expect resp.status == 200
|
|
} -run
|
|
|
|
haproxy h1 -cli {
|
|
send "add acl ${testdir}/agents.acl Mon\\ User\\ Agent\\;"
|
|
expect ~ .*
|
|
|
|
send "show acl ${testdir}/agents.acl"
|
|
expect ~ ".*Mon User Agent.*"
|
|
}
|
|
|
|
client c1 -connect ${h1_fe1_sock} {
|
|
txreq -hdr "User-Agent: Mon User Agent;"
|
|
rxresp
|
|
expect resp.status == 403
|
|
} -run
|
|
|
|
|
|
haproxy h1 -cli {
|
|
send "del acl ${testdir}/agents.acl Mon\\ User\\ Agent\\;"
|
|
expect ~ .*
|
|
|
|
send "show acl ${testdir}/agents.acl"
|
|
expect ~ .*
|
|
}
|
|
|
|
client c1 -connect ${h1_fe1_sock} {
|
|
txreq -hdr "User-Agent: Mon User Agent;"
|
|
rxresp
|
|
expect resp.status == 200
|
|
} -run
|
|
|
|
|
|
# Try it with the master CLI
|
|
haproxy h1 -mcli {
|
|
send "@1 add acl ${testdir}/agents.acl Mon\\ User\\ Agent\\;;@1 show acl ${testdir}/agents.acl"
|
|
expect ~ ".*Mon User Agent;.*"
|
|
}
|
|
|
|
client c1 -connect ${h1_fe1_sock} {
|
|
txreq -hdr "User-Agent: Mon User Agent;"
|
|
rxresp
|
|
expect resp.status == 403
|
|
} -run
|