]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add SpamAssassin metas/foreign dependencies test 811/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 5 Aug 2016 10:35:02 +0000 (11:35 +0100)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 5 Aug 2016 10:35:02 +0000 (11:35 +0100)
test/functional/cases/135_spamassassin.robot
test/functional/configs/spamassassin.conf
test/functional/configs/spamassassin.rules
test/functional/lua/simple.lua [new file with mode: 0644]
test/functional/messages/freemail.eml

index 31082c96d618765635d0e936c3a223afe3cb1101..09904651d53805a39343ce75dfde20c9aaa7107a 100644 (file)
@@ -26,6 +26,9 @@ Freemail From Enddigit
 Freemail Subject
   Should Contain  ${FREEMAIL_RESULT}  FREEMAIL_SUBJECT
 
+Metas
+  Should Contain  ${FREEMAIL_RESULT}  TEST_META3
+
 *** Keywords ***
 SpamAssassin Setup
   ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/spamassassin.conf
index ddd65b95e5f82a1c761c9301394ef3a96a7895dc..eabefea2c8e8d9debb8593ba73591630df7c3db2 100644 (file)
@@ -1,3 +1,4 @@
 spamassassin {
        rules = "${TESTDIR}/configs/spamassassin.rules"
 }
+lua = "${TESTDIR}/lua/simple.lua"
index e020fe7b9d32b1e204e4dff08c75de6a28596d9d..201dd1ae5e45b38768cf74087b777cf1f11ab27c 100644 (file)
@@ -32,3 +32,13 @@ describe FREEMAIL_SUBJECT  Subject contains freemail
 score    FREEMAIL_SUBJECT  1.0
 
 endif
+
+# These rules are /not/ from SpamAssassin project
+
+header TEST_XFOO       X-Foo =~ /.{1,50}/
+score  TEST_XFOO       1
+header TEST_XBAR       X-Bar =~ /.{1,50}/
+score  TEST_XBAR       1
+meta   TEST_META1      TEST_XFOO && TEST_XBAR
+meta   TEST_META2      TEST_META1 && SIMPLE_TEST
+meta   TEST_META3      TEST_META1 && TEST_META2
diff --git a/test/functional/lua/simple.lua b/test/functional/lua/simple.lua
new file mode 100644 (file)
index 0000000..51a1f8b
--- /dev/null
@@ -0,0 +1,7 @@
+rspamd_config:register_symbol({
+  name = 'SIMPLE_TEST',
+  score = 1.0,
+  callback = function(task)
+    return true, 'Fires always'
+  end
+})
index a64094b74d648048891154497c94abe961a3789a..ab1b90ee9361e7b39aa13f5697bd3da81b428f98 100644 (file)
@@ -1,6 +1,8 @@
 From: <faked.asdfjisiwosp372@outlook.com>
 Subject: Reply me at faked.asdfjisiwosp372@hotmail.com
 Date: Sun, 31 Jul 2016 11:40:08 +0100
+X-Foo: 1
+X-Bar: 1
 Content-type: text/plain
 MIME-Version: 1.0