]> git.kaiwu.me - haproxy.git/commit
REGTESTS: log: test the transaction state fetches and the logging actions
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:33:22 +0000 (20:33 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:55:57 +0000 (16:55 +0200)
commit70f915e26cec86caf3077be0866b245721757b6b
tree79e07bd69c9d9cb9307712f2e4dfaa268260cf7c
parent49930d36c536efa080f608a685e45148034275b3
REGTESTS: log: test the transaction state fetches and the logging actions

The txn.sess_term_state, term_events, last_entity, waiting_entity,
txn.conn_retries, txn.redispatched, txn.id32, txn.timer.total,
txn.timer.user, req.timer.queue, res.timer.data, prio_class, prio_offset,
bc_be_queue, bc_srv_queue, fc_err_name and bc_err_name fetches were not
covered, and neither were the set-priority-class, set-priority-offset,
set-nice, set-log-level and do-log actions.

They are checked from a custom log format since most of them only reach
their final value once the transaction is over. The test verifies that
"set-log-level err" raises the syslog priority of the message, that
"set-log-level silent" suppresses it entirely, that "do-log" emits an
extra message before the response exists, and that a denied request is
reported with the "PR" termination state and the rule which took the
decision.

Two syslog servers are needed because vtest only matches the messages
emitted at the level its server was declared with.

Note that path, url and the req.timer.hdr/idle/tq fetches are not usable
at log time, hence the use of capture.req.uri here.
reg-tests/log/txn_state.vtc [new file with mode: 0644]