REGTESTS: add a test for proxy "log-steps"

Now that proxy "log-steps" keyword was implemented and is usable since
("MEDIUM: log: consider log-steps proxy setting for existing log origins")
let's add some tests for it in reg-tests/log/log_profile.vtc.
This commit is contained in:
Aurelien DARRAGON 2024-09-05 16:48:09 +02:00
parent 7ad4e00c1f
commit 0c94b2efec
1 changed files with 62 additions and 1 deletions

View File

@ -6,11 +6,12 @@ barrier b1 cond 4 -cyclic
barrier b2 cond 4 -cyclic barrier b2 cond 4 -cyclic
barrier b3 cond 3 -cyclic barrier b3 cond 3 -cyclic
barrier b4 cond 3 -cyclic barrier b4 cond 3 -cyclic
barrier b5 cond 2 -cyclic
server s1 { server s1 {
rxreq rxreq
txresp txresp
} -repeat 3 -start } -repeat 5 -start
syslog Slg1 -level info { syslog Slg1 -level info {
recv recv
@ -73,6 +74,27 @@ syslog Slg4 -level info {
barrier b4 sync barrier b4 sync
} -start } -start
syslog Slg5 -level info {
#rfc5424, logprof4, http connect, close
recv
expect ~ ".* haproxy ${h1_pid} .* connect"
recv
expect ~ ".* haproxy ${h1_pid} .* close"
barrier b5 sync
#rfc5424, logprof4, http all steps
recv
expect ~ ".* haproxy ${h1_pid} .* accept"
recv
expect ~ ".* haproxy ${h1_pid} .* request"
recv
expect ~ ".* haproxy ${h1_pid} .* connect"
recv
expect ~ ".* haproxy ${h1_pid} .* response"
recv
expect ~ ".* haproxy ${h1_pid} .* close"
} -start
haproxy h1 -conf { haproxy h1 -conf {
defaults defaults
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
@ -120,6 +142,22 @@ haproxy h1 -conf {
log udp@${Slg3_addr}:${Slg3_port} format rfc5424 profile logprof2 local0 log udp@${Slg3_addr}:${Slg3_port} format rfc5424 profile logprof2 local0
log udp@${Slg4_addr}:${Slg4_port} format rfc5424 profile logprof3 local0 log udp@${Slg4_addr}:${Slg4_port} format rfc5424 profile logprof3 local0
listen fe5
bind "fd@${fe_5}"
mode http
log-format "dummy"
log-steps connect,close
log udp@${Slg5_addr}:${Slg5_port} format rfc5424 profile logprof4 local0
default_backend be
listen fe6
bind "fd@${fe_6}"
mode http
log-format "dummy"
log-steps all
log udp@${Slg5_addr}:${Slg5_port} format rfc5424 profile logprof4 local0
default_backend be
log-profile logprof1 log-profile logprof1
on close format "close" sd "sdclose" on close format "close" sd "sdclose"
@ -132,6 +170,13 @@ haproxy h1 -conf {
on error format "error" on error format "error"
on any drop on any drop
log-profile logprof4
on accept format "accept"
on request format "request"
on connect format "connect"
on response format "response"
on close format "close"
backend be backend be
mode http mode http
server app1 ${s1_addr}:${s1_port} server app1 ${s1_addr}:${s1_port}
@ -179,7 +224,23 @@ client c4 -connect ${h1_fe_4_sock} {
# Wait matching log messages # Wait matching log messages
barrier b4 sync barrier b4 sync
client c5 -connect ${h1_fe_5_sock} {
txreq -url "/"
rxresp
expect resp.status == 200
} -start -wait
# Wait matching log messages
barrier b5 sync
client c6 -connect ${h1_fe_6_sock} {
txreq -url "/"
rxresp
expect resp.status == 200
} -start -wait
syslog Slg1 -wait syslog Slg1 -wait
syslog Slg2 -wait syslog Slg2 -wait
syslog Slg3 -wait syslog Slg3 -wait
syslog Slg4 -wait syslog Slg4 -wait
syslog Slg5 -wait