]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Test] Functional test for lua_extras two-phase loader 6020/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 5 May 2026 19:43:53 +0000 (20:43 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 5 May 2026 19:43:53 +0000 (20:43 +0100)
commitebd16ed3383173e9d4d258aed9840244b06c43ce
tree3fe3caa4bccc3bfc98602f75b33014f3eb766d06
parent7d69711ce4b71ad2b1874a00d21c6dba84490ebc
[Test] Functional test for lua_extras two-phase loader

Adds Functional.Cases.001_Merged.271_Lua_Extras with two cases:

* the deferred-selector regexp fires when the From-domain is present in
  the map captured by the selector factory;
* the same regexp stays silent when the From-domain is absent.

The companion lua_extras_test.lua stages a tree under TMPDIR with maps,
selectors and regexps subdirectories, then calls lua_extras.load_extras
on it. The selector entry is wrapped in lua_extras.deferred so the
factory captures rspamd_maps[name] at registration time, exercising the
maps -> selectors -> regexps phase 2 ordering and the re_selector
auto-binding into the regexp DSL.

Also wires the new lua file into merged.conf alongside selector_test.lua.
test/functional/cases/001_merged/271_lua_extras.robot [new file with mode: 0644]
test/functional/configs/merged.conf
test/functional/lua/lua_extras_test.lua [new file with mode: 0644]
test/functional/messages/lua_extras_in_map.eml [new file with mode: 0644]
test/functional/messages/lua_extras_not_in_map.eml [new file with mode: 0644]