From: Andrew Lewis Date: Fri, 5 Aug 2016 10:35:02 +0000 (+0100) Subject: [Test] Add SpamAssassin metas/foreign dependencies test X-Git-Tag: 1.3.2~28^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=35b17f0600cefe0537b0e775e9db0ccb34f89721;p=rspamd.git [Test] Add SpamAssassin metas/foreign dependencies test --- diff --git a/test/functional/cases/135_spamassassin.robot b/test/functional/cases/135_spamassassin.robot index 31082c96d..09904651d 100644 --- a/test/functional/cases/135_spamassassin.robot +++ b/test/functional/cases/135_spamassassin.robot @@ -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 diff --git a/test/functional/configs/spamassassin.conf b/test/functional/configs/spamassassin.conf index ddd65b95e..eabefea2c 100644 --- a/test/functional/configs/spamassassin.conf +++ b/test/functional/configs/spamassassin.conf @@ -1,3 +1,4 @@ spamassassin { rules = "${TESTDIR}/configs/spamassassin.rules" } +lua = "${TESTDIR}/lua/simple.lua" diff --git a/test/functional/configs/spamassassin.rules b/test/functional/configs/spamassassin.rules index e020fe7b9..201dd1ae5 100644 --- a/test/functional/configs/spamassassin.rules +++ b/test/functional/configs/spamassassin.rules @@ -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 index 000000000..51a1f8b27 --- /dev/null +++ b/test/functional/lua/simple.lua @@ -0,0 +1,7 @@ +rspamd_config:register_symbol({ + name = 'SIMPLE_TEST', + score = 1.0, + callback = function(task) + return true, 'Fires always' + end +}) diff --git a/test/functional/messages/freemail.eml b/test/functional/messages/freemail.eml index a64094b74..ab1b90ee9 100644 --- a/test/functional/messages/freemail.eml +++ b/test/functional/messages/freemail.eml @@ -1,6 +1,8 @@ From: 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