From 1699cff0048c022c55a47f0812c2907a6bed1fd3 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 5 Apr 2024 22:42:16 +0200 Subject: [PATCH] [Test] Try break greylisting tests --- .../cases/001_merged/290_greylist.robot | 30 +++++++++++++++++-- test/functional/configs/merged-local.conf | 10 +++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/test/functional/cases/001_merged/290_greylist.robot b/test/functional/cases/001_merged/290_greylist.robot index 05ce3d3f0..ece6a9b3f 100644 --- a/test/functional/cases/001_merged/290_greylist.robot +++ b/test/functional/cases/001_merged/290_greylist.robot @@ -4,22 +4,48 @@ Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot Variables ${RSPAMD_TESTDIR}/lib/vars.py *** Variables *** -${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml -${SETTINGS_GREYLIST} {symbols_enabled = [GREYLIST_CHECK, GREYLIST_SAVE], symbols = [FOUR_POINTS]} +${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml +${MESSAGE2} ${RSPAMD_TESTDIR}/messages/spam.eml +${MESSAGE3} ${RSPAMD_TESTDIR}/messages/freemail.eml +${SETTINGS_GREYLIST} {symbols_enabled = [GREYLIST_CHECK, GREYLIST_SAVE], symbols = [FOUR_POINTS]} +${SETTINGS_NOGREYLIST} {symbols_enabled = [GREYLIST_CHECK, GREYLIST_SAVE], symbols = [THREE_POINTS]} +${SETTINGS_RESCORED} {actions { greylist = 3 }, symbols_enabled = [GREYLIST_CHECK, GREYLIST_SAVE], symbols = [THREE_POINTS]} +${SETTINGS_REJECTED} {actions { greylist = 3 }, symbols_enabled = [GREYLIST_CHECK, GREYLIST_SAVE], symbols = [TWENTY_POINTS]} *** Test Cases *** GREYLIST NEW Scan File ${MESSAGE} ... Settings=${SETTINGS_GREYLIST} Expect Symbol With Option GREYLIST greylisted + Expect Action soft reject GREYLIST EARLY Scan File ${MESSAGE} ... Settings=${SETTINGS_GREYLIST} Expect Symbol With Option GREYLIST greylisted + Expect Action soft reject + +GREYLIST NOT GREYLISTED + Scan File ${MESSAGE2} + ... Settings=${SETTINGS_NOGREYLIST} + Do Not Expect Symbol GREYLIST + Expect Action no action + +GREYLIST REJECTED + Scan File ${MESSAGE3} + ... Settings=${SETTINGS_REJECTED} + Do Not Expect Symbol GREYLIST + Expect Action reject + +GREYLIST RESCORED + Scan File ${MESSAGE2} + ... Settings=${SETTINGS_RESCORED} + Expect Symbol With Option GREYLIST greylisted + Expect Action soft reject GREYLIST PASS Sleep 4s Wait greylisting timeout Scan File ${MESSAGE} ... Settings=${SETTINGS_GREYLIST} Expect Symbol With Option GREYLIST pass + Expect Action no action diff --git a/test/functional/configs/merged-local.conf b/test/functional/configs/merged-local.conf index 0708e3c0b..75b9f0554 100644 --- a/test/functional/configs/merged-local.conf +++ b/test/functional/configs/merged-local.conf @@ -947,10 +947,16 @@ spf { symbols { FOUR_POINTS = { - score = 4.0, + score = 4.0 + } + THREE_POINTS = { + score = 3.0 + } + TWENTY_POINTS = { + score = 20.0 } SYM1 = { - score = 1.0, + score = 1.0 } } -- 2.39.5