summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-21 15:52:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-21 17:58:51 +0100
commit6b676918bbb037c111fa2616f1709ead9ac3c788 (patch)
tree5d5dfeed936482f5431eac4e0428746a90885678 /test
parente971c539fa763d3f632735ec59f1d5e50685467f (diff)
downloadrspamd-6b676918bbb037c111fa2616f1709ead9ac3c788.tar.gz
rspamd-6b676918bbb037c111fa2616f1709ead9ac3c788.zip
[Rework] Drop url tags
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/url_tags.lua56
1 files changed, 0 insertions, 56 deletions
diff --git a/test/functional/lua/url_tags.lua b/test/functional/lua/url_tags.lua
deleted file mode 100644
index 9dc38ac72..000000000
--- a/test/functional/lua/url_tags.lua
+++ /dev/null
@@ -1,56 +0,0 @@
-
-local rspamd_logger = require 'rspamd_logger'
-
-rspamd_config:register_symbol({
- name = 'ADDED_TAGS',
- score = 1.0,
- callback = function(task)
- if not task:get_request_header('addtags') then
- return true, 'nope! not requested'
- end
- local urls = task:get_urls()
- if not (urls and urls[1]) then
- return true, 'nope! found no urls'
- end
- local mpool = task:get_mempool()
- for _, u in ipairs(urls) do
- u:add_tag('test1', 'meta1', mpool)
- u:add_tag('test1', 'meta2', mpool)
- u:add_tag('test2', 'http://www.example.com', mpool)
- end
- return true, 'no worry'
- end
-})
-
-rspamd_config:register_symbol({
- name = 'FOUND_TAGS',
- score = 1.0,
- callback = function(task)
- local urls = task:get_urls()
- if not (urls and urls[1]) then
- return true, 'nope! found no urls'
- end
- for _, u in ipairs(urls) do
- local tags = u:get_tags()
- rspamd_logger.debugx(task, 'tags: %1', tags)
- if not tags['test1'] then
- return true, 'no key - test1'
- end
- local found1, found2 = false, false
- for _, e in ipairs(tags['test1']) do
- if e == 'meta1' then found1 = true end
- if e == 'meta2' then found2 = true end
- end
- if not (found1 and found2) then
- return true, 'missing metatags in test1'
- end
- if not tags['test2'] then
- return true, 'no key - test2'
- end
- if not tags['test2'][1] == 'http://www.example.com' then
- return true, 'wrong value in test2 metatag: ' .. tags['test2'][1]
- end
- end
- return true, 'no worry'
- end
-})