diff options
author | Andrew Lewis <nerf@judo.za.org> | 2021-05-11 13:50:29 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2021-05-18 11:41:13 +0200 |
commit | 5f7dd6e1f27ebec013ed74865f9c1873414380cb (patch) | |
tree | e542005b610c32590a4586f313da844564295467 /test/functional/lua | |
parent | 7974dd00478625cbe8e754e67e39bf52d361bda9 (diff) | |
download | rspamd-5f7dd6e1f27ebec013ed74865f9c1873414380cb.tar.gz rspamd-5f7dd6e1f27ebec013ed74865f9c1873414380cb.zip |
[Test] Merge test suites; use settings
Diffstat (limited to 'test/functional/lua')
-rw-r--r-- | test/functional/lua/get_from.lua | 8 | ||||
-rw-r--r-- | test/functional/lua/http.lua | 6 | ||||
-rw-r--r-- | test/functional/lua/maps_kv.lua | 6 |
3 files changed, 11 insertions, 9 deletions
diff --git a/test/functional/lua/get_from.lua b/test/functional/lua/get_from.lua index 4e3267b41..9282866da 100644 --- a/test/functional/lua/get_from.lua +++ b/test/functional/lua/get_from.lua @@ -1,8 +1,10 @@ rspamd_config:register_symbol({ - name = 'SIMPLE_TEST', + name = 'GET_FROM', score = 1.0, callback = function(task) - local a = task:get_from('mime')[1] - task:insert_result('GET_FROM', 0.0, a.name .. ',' .. a.addr .. ',' .. a.user .. ',' .. a.domain) + local a = task:get_from('mime') + if not a then return end + a = a[1] + return true, (a.name or '') .. ',' .. (a.addr or '') .. ',' .. (a.user or '') .. ',' .. (a.domain or '') end }) diff --git a/test/functional/lua/http.lua b/test/functional/lua/http.lua index d0ed4e7b7..c5b91ff3d 100644 --- a/test/functional/lua/http.lua +++ b/test/functional/lua/http.lua @@ -106,7 +106,7 @@ local function periodic(cfg, ev_base) end rspamd_config:register_symbol({ - name = 'SIMPLE_TEST', + name = 'SIMPLE_HTTP_TEST', score = 1.0, callback = http_symbol, no_squeeze = true, @@ -145,7 +145,7 @@ local function http_large_symbol(task) end end rspamd_config:register_symbol({ - name = 'LARGE_TEST', + name = 'LARGE_HTTP_TEST', score = 1.0, callback = http_large_symbol, no_squeeze = true, @@ -166,4 +166,4 @@ rspamd_config:add_on_load(function(cfg, ev_base, worker) end rspamd_config:add_periodic(ev_base, 0, periodic, false) -end)
\ No newline at end of file +end) diff --git a/test/functional/lua/maps_kv.lua b/test/functional/lua/maps_kv.lua index b63b32c34..a62d25ddd 100644 --- a/test/functional/lua/maps_kv.lua +++ b/test/functional/lua/maps_kv.lua @@ -2,17 +2,17 @@ local rspamd_ip = require 'rspamd_ip' local rspamd_logger = require 'rspamd_logger' local radix_map = rspamd_config:add_map ({ - url = '${RADIX_MAP}', + url = rspamd_env.RADIX_MAP, type = 'radix', }) local map_map = rspamd_config:add_map ({ - url = '${MAP_MAP}', + url = rspamd_env.MAP_MAP, type = 'map', }) local regexp_map = rspamd_config:add_map ({ - url = '${REGEXP_MAP}', + url = rspamd_env.REGEXP_MAP, type = 'regexp', }) |