aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2024-04-05 22:42:16 +0200
committerAndrew Lewis <nerf@judo.za.org>2024-04-05 22:42:16 +0200
commit1699cff0048c022c55a47f0812c2907a6bed1fd3 (patch)
tree60273c66936b3c1edde3f543a52086bdb403cf54 /test
parent0f9972509407770891054be33a70c4ff8af96fa3 (diff)
downloadrspamd-1699cff0048c022c55a47f0812c2907a6bed1fd3.tar.gz
rspamd-1699cff0048c022c55a47f0812c2907a6bed1fd3.zip
[Test] Try break greylisting tests
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/001_merged/290_greylist.robot30
-rw-r--r--test/functional/configs/merged-local.conf10
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
}
}