diff options
Diffstat (limited to 'test/functional/cases')
-rw-r--r-- | test/functional/cases/001_merged/101_lua.robot | 46 | ||||
-rw-r--r-- | test/functional/cases/550_milter_headers.robot | 39 |
2 files changed, 84 insertions, 1 deletions
diff --git a/test/functional/cases/001_merged/101_lua.robot b/test/functional/cases/001_merged/101_lua.robot index 2cfc03677..51d5b4b23 100644 --- a/test/functional/cases/001_merged/101_lua.robot +++ b/test/functional/cases/001_merged/101_lua.robot @@ -52,4 +52,48 @@ External Maps Simple Task Inject Url Scan File ${URL_ICS} Settings={symbols_enabled = [TEST_INJECT_URL]} - Expect Symbol TEST_INJECT_URL
\ No newline at end of file + Expect Symbol TEST_INJECT_URL + +Group Score Positive + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_POSITIVE1, GR_POSITIVE2, GR_POSITIVE4, GR_POSITIVE8, GR_POSITIVE16]} + Expect Symbol With Score GR_POSITIVE1 1 + Expect Symbol With Score GR_POSITIVE2 2 + Expect Symbol With Score GR_POSITIVE4 4 + Expect Symbol With Score GR_POSITIVE8 3 + Expect Symbol With Score GR_POSITIVE16 0 + +Group Score Negative + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_NEGATIVE1, GR_NEGATIVE2, GR_NEGATIVE4, GR_NEGATIVE8]} + Expect Symbol With Score GR_NEGATIVE1 -1 + Expect Symbol With Score GR_NEGATIVE2 -2 + Expect Symbol With Score GR_NEGATIVE4 -4 + Expect Symbol With Score GR_NEGATIVE8 -3 + +Group Score Mix 1 + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_POSITIVE1, GR_POSITIVE2, GR_POSITIVE4, GR_POSITIVE8, GR_NEGATIVE1, GR_NEGATIVE2, GR_NEGATIVE4, GR_NEGATIVE8]} + Expect Symbol With Score GR_POSITIVE1 1 + Expect Symbol With Score GR_POSITIVE2 2 + Expect Symbol With Score GR_POSITIVE4 4 + Expect Symbol With Score GR_POSITIVE8 3 + Expect Symbol With Score GR_NEGATIVE1 -1 + Expect Symbol With Score GR_NEGATIVE2 -2 + Expect Symbol With Score GR_NEGATIVE4 -4 + Expect Symbol With Score GR_NEGATIVE8 -8 + +Group Score Mix 2 + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_POSITIVE1, GR_POSITIVE2, GR_POSITIVE4, GR_POSITIVE8, GR_NEGATIVE16]} + Expect Symbol With Score GR_POSITIVE1 1 + Expect Symbol With Score GR_POSITIVE2 2 + Expect Symbol With Score GR_POSITIVE4 4 + Expect Symbol With Score GR_POSITIVE8 3 + Expect Symbol With Score GR_NEGATIVE16 -16 + +Group Score Mix 3 + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_POSITIVE1, GR_NEGATIVE16]} + Expect Symbol With Score GR_POSITIVE1 1 + Expect Symbol With Score GR_NEGATIVE16 -11 + +Group Score Mix 4 + Scan File ${MESSAGE} Settings={symbols_enabled = [GR_POSITIVE16, GR_NEGATIVE16]} + Expect Symbol With Score GR_POSITIVE16 10 + Expect Symbol With Score GR_NEGATIVE16 -16
\ No newline at end of file diff --git a/test/functional/cases/550_milter_headers.robot b/test/functional/cases/550_milter_headers.robot new file mode 100644 index 000000000..80471b83c --- /dev/null +++ b/test/functional/cases/550_milter_headers.robot @@ -0,0 +1,39 @@ +*** Settings *** +Suite Setup Rspamd Setup +Suite Teardown Rspamd Teardown +Library ${RSPAMD_TESTDIR}/lib/rspamd.py +Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot +Variables ${RSPAMD_TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${RSPAMD_TESTDIR}/configs/milter_headers.conf +${MESSAGE} ${RSPAMD_TESTDIR}/messages/zip.eml +${RSPAMD_SCOPE} Suite +${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat +${SETTINGS_NOSYMBOLS} {symbols_enabled = []} +${SETTINGS_TEST} {SIMPLE_TEST = 2.0, symbols_enabled = [SIMPLE_TEST]} + +*** Test Cases *** +CHECK HEADERS WITH TEST SYMBOL + Scan File ${MESSAGE} Settings=${SETTINGS_TEST} + # Check X-Virus header + Expect Removed Header X-Virus + Expect Added Header X-Virus Fires always + # Check My-Spamd-Bar header + Expect Added Header My-Spamd-Bar ++ + Do Not Expect Removed Header My-Spamd-Bar + # Check X-Spam-Level header + Expect Added Header X-Spam-Level ** + Expect Removed Header X-Spam-Level + +CHECK HEADERS WITHOUT TEST SYMBOL + Scan File ${MESSAGE} Settings=${SETTINGS_NOSYMBOLS} + # Check X-Virus header + Expect Removed Header X-Virus + Do Not Expect Added Header X-Virus + # Check My-Spamd-Bar header + Expect Added Header My-Spamd-Bar / + Do Not Expect Removed Header My-Spamd-Bar + # Check X-Spam-Level header + Do Not Expect Added Header X-Spam-Level + Expect Removed Header X-Spam-Level |