-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4612 from fatalbanana/vstakhov-known-senders
[Test] Rudimentary tests for known_senders plugin
- Loading branch information
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*** Settings *** | ||
Suite Setup Rspamd Redis Setup | ||
Suite Teardown Rspamd Redis Teardown | ||
Library ${RSPAMD_TESTDIR}/lib/rspamd.py | ||
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot | ||
Variables ${RSPAMD_TESTDIR}/lib/vars.py | ||
|
||
*** Variables *** | ||
${CONFIG} ${RSPAMD_TESTDIR}/configs/known_senders.conf | ||
${REDIS_SCOPE} Suite | ||
${RSPAMD_SCOPE} Suite | ||
|
||
*** Test Cases *** | ||
UNKNOWN SENDER | ||
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml | ||
... Settings={symbols_enabled [KNOWN_SENDER]} | ||
Do Not Expect Symbol KNOWN_SENDER | ||
Expect Symbol UNKNOWN_SENDER | ||
|
||
UNKNOWN SENDER BECOMES KNOWN | ||
Scan File ${RSPAMD_TESTDIR}/messages/spam_message.eml | ||
... Settings={symbols_enabled [KNOWN_SENDER]} | ||
Expect Symbol KNOWN_SENDER | ||
Do Not Expect Symbol UNKNOWN_SENDER | ||
|
||
UNKNOWN SENDER WRONG DOMAIN | ||
Scan File ${RSPAMD_TESTDIR}/messages/empty_part.eml | ||
... Settings={symbols_enabled [KNOWN_SENDER]} | ||
Do Not Expect Symbol KNOWN_SENDER | ||
Do Not Expect Symbol UNKNOWN_SENDER | ||
|
||
UNKNOWN SENDER WRONG DOMAIN RESCAN | ||
Scan File ${RSPAMD_TESTDIR}/messages/empty_part.eml | ||
... Settings={symbols_enabled [KNOWN_SENDER]} | ||
Do Not Expect Symbol KNOWN_SENDER | ||
Do Not Expect Symbol UNKNOWN_SENDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
known_senders { | ||
enabled = true; | ||
domains = "{= env.TESTDIR =}/configs/maps/known_senders_domains.map"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.include "{= env.TESTDIR =}/../../conf/rspamd.conf" | ||
|
||
lua = "{= env.TESTDIR =}/lua/test_coverage.lua" | ||
|
||
.include(priority=1,duplicate=merge) "{= env.TESTDIR =}/configs/known_senders-local.conf" | ||
.include(priority=1,duplicate=merge) "{= env.TESTDIR =}/configs/merged-local.conf" | ||
.include(priority=2,duplicate=replace) "{= env.TESTDIR =}/configs/merged-override.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
outlook.com | ||
example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters