aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/123_whitelist.robot
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2020-09-07 15:14:22 +0200
committerAndrew Lewis <nerf@judo.za.org>2020-09-07 15:14:22 +0200
commitc07cb6a8c4f45d0cf35baacf539d5c78145fe1de (patch)
treeb67b987e045203d927aa87c1982dc43ea6fda5e6 /test/functional/cases/123_whitelist.robot
parent27ad207da620685499aa04c8e9c7d4e4eafa11dc (diff)
downloadrspamd-c07cb6a8c4f45d0cf35baacf539d5c78145fe1de.tar.gz
rspamd-c07cb6a8c4f45d0cf35baacf539d5c78145fe1de.zip
[Test] Use HTTP & simplified test style
Diffstat (limited to 'test/functional/cases/123_whitelist.robot')
-rw-r--r--test/functional/cases/123_whitelist.robot102
1 files changed, 48 insertions, 54 deletions
diff --git a/test/functional/cases/123_whitelist.robot b/test/functional/cases/123_whitelist.robot
index 83b652b19..6482793a3 100644
--- a/test/functional/cases/123_whitelist.robot
+++ b/test/functional/cases/123_whitelist.robot
@@ -20,68 +20,62 @@ ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
WHITELISTS
- ${result} = Scan Message With Rspamc ${M_DMARC_OK} -i 8.8.4.4 -F foo@spf.cacophony.za.org
- Check Rspamc ${result} WHITELIST_DKIM (-
- Should Contain ${result.stdout} STRICT_DMARC (-
- Should Contain ${result.stdout} WHITELIST_SPF_DKIM (-
- Should Contain ${result.stdout} WHITELIST_DDS (-
- Should Contain ${result.stdout} WHITELIST_DMARC (-
- Should Contain ${result.stdout} WHITELIST_DMARC_DKIM (-
- Should Contain ${result.stdout} WHITELIST_SPF (-
- Should Not Contain ${result.stdout} BLACKLIST_SPF (
- Should Not Contain ${result.stdout} BLACKLIST_DKIM (
- Should Not Contain ${result.stdout} BLACKLIST_DMARC (
+ Scan File ${M_DMARC_OK} IP=8.8.4.4 From=foo@spf.cacophony.za.org
+ Expect Symbol With Score WHITELIST_DKIM -1
+ Expect Symbol With Score STRICT_DMARC -3
+ Expect Symbol With Score WHITELIST_SPF_DKIM -3
+ Expect Symbol With Score WHITELIST_DDS -3
+ Expect Symbol With Score WHITELIST_DMARC -2
+ Expect Symbol With Score WHITELIST_DMARC_DKIM -2
+ Expect Symbol With Score WHITELIST_SPF -1
+ Do Not Expect Symbol BLACKLIST_SPF
+ Do Not Expect Symbol BLACKLIST_DKIM
+ Do Not Expect Symbol BLACKLIST_DMARC
BLACKLIST SHOULD FIRE IF ANY CONSTRAINT FAILED
- ${result} = Scan Message With Rspamc ${M_DMARC_OK} -i 9.8.4.4 -F foo@spf.cacophony.za.org
- Check Rspamc ${result} BLACKLIST_DDS (3
- Should Not Contain ${result.stdout} WHITELIST_DDS (
- Should Not Contain ${result.stdout} WHITELIST_SPF (
+ Scan File ${M_DMARC_OK} IP=9.8.4.4 From=foo@spf.cacophony.za.org
+ Expect Symbol With Score BLACKLIST_DDS 3
+ Do Not Expect Symbol WHITELIST_DDS
+ Do Not Expect Symbol WHITELIST_SPF
BLACKLISTS
- ${result} = Scan Message With Rspamc ${M_DMARC_BAD} -i 9.8.4.4 -F foo@cacophony.za.org
- Check Rspamc ${result} BLACKLIST_SPF (3
- Should Contain ${result.stdout} BLACKLIST_SPF (3
- Should Contain ${result.stdout} STRICT_DMARC (3
- Should Contain ${result.stdout} BLACKLIST_DDS (3
- Should Contain ${result.stdout} BLACKLIST_DMARC (2
- Should Not Contain ${result.stdout} WHITELIST_DDS (
- Should Not Contain ${result.stdout} WHITELIST_SPF (
- Should Not Contain ${result.stdout} WHITELIST_DKIM (
- Should Not Contain ${result.stdout} WHITELIST_DMARC (
- Should Not Contain ${result.stdout} WHITELIST_DMARC_DKIM (
+ Scan File ${M_DMARC_BAD} IP=9.8.4.4 From=foo@cacophony.za.org
+ Expect Symbol With Score BLACKLIST_SPF 3
+ Expect Symbol With Score BLACKLIST_SPF 3
+ Expect Symbol With Score STRICT_DMARC 3
+ Expect Symbol With Score BLACKLIST_DDS 3
+ Expect Symbol With Score BLACKLIST_DMARC 2
+ Do Not Expect Symbol WHITELIST_DDS
+ Do Not Expect Symbol WHITELIST_SPF
+ Do Not Expect Symbol WHITELIST_DKIM
+ Do Not Expect Symbol WHITELIST_DMARC
+ Do Not Expect Symbol WHITELIST_DMARC_DKIM
-WHITELIST_WL_ONLY
- ${result} = Scan Message With Rspamc ${M_DKIM_RSPAMD_OK}
- Check Rspamc ${result} WHITELIST_DKIM (-2
- Should Not Contain ${result.stdout} BLACKLIST_DKIM (
+WHITELIST_WL_ONLY - VALID SPF AND VALID DKIM
+ Scan File ${M_DKIM_RSPAMD_OK}
+ Expect Symbol With Score WHITELIST_DKIM -2
+ Do Not Expect Symbol BLACKLIST_DKIM
+ Expect Symbol With Score R_SPF_ALLOW 1
+ Expect Symbol With Score R_DKIM_ALLOW 1
+ Expect Symbol With Score WHITELIST_SPF_DKIM -6
-BLACKLISTS_WL_ONLY
- ${result} = Scan Message With Rspamc ${M_DKIM_RSPAMD_BAD}
- Check Rspamc ${result} DKIM_REJECT (
- Should Not Contain ${result.stdout} WHITELIST_DKIM (
- Should Not Contain ${result.stdout} BLACKLIST_DKIM (
-
-VALID SPF and VALID DKIM
- ${result} = Scan Message With Rspamc ${M_DKIM_RSPAMD_OK}
- Should Contain ${result.stdout} R_SPF_ALLOW (
- Should Contain ${result.stdout} R_DKIM_ALLOW (
- Should Contain ${result.stdout} WHITELIST_SPF_DKIM (
-
-VALID SPF and NOT VALID DKIM
- ${result} = Scan Message With Rspamc ${M_DKIM_RSPAMD_BAD}
- Should Contain ${result.stdout} R_SPF_ALLOW (
- Should Contain ${result.stdout} R_DKIM_REJECT (
- Should Not Contain ${result.stdout} WHITELIST_SPF_DKIM (
- Should Not Contain ${result.stdout} R_DKIM_ALLOW (
+BLACKLISTS_WL_ONLY - VALID SPF AND INVALID DKIM
+ Scan File ${M_DKIM_RSPAMD_BAD}
+ Expect Symbol With Score R_DKIM_REJECT 1
+ Do Not Expect Symbol WHITELIST_DKIM
+ Do Not Expect Symbol BLACKLIST_DKIM
+ Expect Symbol With Score R_SPF_ALLOW 1
+ Expect Symbol With Score R_DKIM_REJECT 1
+ Do Not Expect Symbol WHITELIST_SPF_DKIM
+ Do Not Expect Symbol R_DKIM_ALLOW
VALID SPF and NO DKIM
- ${result} = Scan Message With Rspamc ${M_NO_DKIM_VALID_SPF}
- Should Contain ${result.stdout} R_SPF_ALLOW (
- Should Contain ${result.stdout} R_DKIM_NA (
- Should Not Contain ${result.stdout} R_DKIM_REJECT (
- Should Not Contain ${result.stdout} WHITELIST_SPF_DKIM (
- Should Not Contain ${result.stdout} R_DKIM_ALLOW (
+ Scan File ${M_NO_DKIM_VALID_SPF}
+ Expect Symbol With Score R_SPF_ALLOW 1
+ Expect Symbol With Score R_DKIM_NA 1
+ Do Not Expect Symbol R_DKIM_REJECT
+ Do Not Expect Symbol WHITELIST_SPF_DKIM
+ Do Not Expect Symbol R_DKIM_ALLOW
*** Keywords ***
Whitelist Setup