summaryrefslogtreecommitdiffstats
path: root/test/functional/cases
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-23 17:05:28 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-08-23 17:05:28 +0200
commitd003de1435f27c31de78d975ee54e07e7c0c2d20 (patch)
tree66579c9dc1406bdd5fe4f739f73ac24aec27c885 /test/functional/cases
parent305de55ddaf9cd50e77dab247f433bf657f1c98d (diff)
downloadrspamd-d003de1435f27c31de78d975ee54e07e7c0c2d20.tar.gz
rspamd-d003de1435f27c31de78d975ee54e07e7c0c2d20.zip
[Test] Add tests for DMARC
Diffstat (limited to 'test/functional/cases')
-rw-r--r--test/functional/cases/102_multimap.robot1
-rw-r--r--test/functional/cases/105_mimetypes.robot1
-rw-r--r--test/functional/cases/115_dmarc.robot74
-rw-r--r--test/functional/cases/135_spamassassin.robot1
4 files changed, 77 insertions, 0 deletions
diff --git a/test/functional/cases/102_multimap.robot b/test/functional/cases/102_multimap.robot
index abe79f512..22551cba8 100644
--- a/test/functional/cases/102_multimap.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -16,6 +16,7 @@ ${URL2} ${TESTDIR}/messages/url2.eml
${URL3} ${TESTDIR}/messages/url3.eml
${URL4} ${TESTDIR}/messages/url4.eml
${URL5} ${TESTDIR}/messages/url5.eml
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
MAP - DNSBL HIT
diff --git a/test/functional/cases/105_mimetypes.robot b/test/functional/cases/105_mimetypes.robot
index 18eac6289..8e124e3f7 100644
--- a/test/functional/cases/105_mimetypes.robot
+++ b/test/functional/cases/105_mimetypes.robot
@@ -8,6 +8,7 @@ Variables ${TESTDIR}/lib/vars.py
*** Variables ***
${CONFIG} ${TESTDIR}/configs/plugins.conf
${RSPAMD_SCOPE} Suite
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Zip
diff --git a/test/functional/cases/115_dmarc.robot b/test/functional/cases/115_dmarc.robot
new file mode 100644
index 000000000..f2a93db02
--- /dev/null
+++ b/test/functional/cases/115_dmarc.robot
@@ -0,0 +1,74 @@
+*** Settings ***
+Suite Setup DMARC Setup
+Suite Teardown Generic Teardown
+Library ${TESTDIR}/lib/rspamd.py
+Resource ${TESTDIR}/lib/rspamd.robot
+Variables ${TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${TESTDIR}/configs/plugins.conf
+${RSPAMD_SCOPE} Suite
+${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+
+*** Test Cases ***
+DMARC NONE PASS DKIM
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/pass_none.eml
+ Check Rspamc ${result} DMARC_POLICY_ALLOW
+
+DMARC NONE PASS SPF
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/fail_none.eml
+ ... -i 212.47.245.199 --from foo@rspamd.tk
+ Check Rspamc ${result} DMARC_POLICY_ALLOW
+
+DMARC NONE FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/fail_none.eml
+ Check Rspamc ${result} DMARC_POLICY_SOFTFAIL
+
+DMARC REJECT FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/fail_reject.eml
+ Check Rspamc ${result} DMARC_POLICY_REJECT
+
+DMARC QUARANTINE FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/fail_quarantine.eml
+ Check Rspamc ${result} DMARC_POLICY_QUARANTINE
+
+DMARC SP NONE FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/subdomain_fail_none.eml
+ Check Rspamc ${result} DMARC_POLICY_SOFTFAIL
+
+DMARC SP REJECT FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/subdomain_fail_reject.eml
+ Check Rspamc ${result} DMARC_POLICY_REJECT
+
+DMARC SP QUARANTINE FAIL
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/subdomain_fail_quarantine.eml
+ Check Rspamc ${result} DMARC_POLICY_QUARANTINE
+
+DMARC SUBDOMAIN FAIL DKIM STRICT ALIGNMENT
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ Check Rspamc ${result} DMARC_POLICY_REJECT
+
+DMARC SUBDOMAIN PASS DKIM RELAXED ALIGNMENT
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
+ Check Rspamc ${result} DMARC_POLICY_ALLOW
+
+DMARC SUBDOMAIN PASS SPF STRICT ALIGNMENT
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ ... -i 37.48.67.26 --from foo@yo.mom.za.org
+ Check Rspamc ${result} DMARC_POLICY_ALLOW
+
+DMARC SUBDOMAIN FAIL SPF STRICT ALIGNMENT
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ ... -i 37.48.67.26 --from foo@mom.za.org
+ Check Rspamc ${result} DMARC_POLICY_REJECT
+
+DMARC SUBDOMAIN PASS SPF RELAXED ALIGNMENT
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/dmarc/onsubdomain_fail.eml
+ ... -i 37.48.67.26 --from foo@mom.za.org
+ Check Rspamc ${result} DMARC_POLICY_ALLOW
+
+*** Keywords ***
+DMARC Setup
+ ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/dmarc.conf
+ Set Suite Variable ${PLUGIN_CONFIG}
+ Generic Setup PLUGIN_CONFIG
diff --git a/test/functional/cases/135_spamassassin.robot b/test/functional/cases/135_spamassassin.robot
index 2e5c0bb59..d1901068c 100644
--- a/test/functional/cases/135_spamassassin.robot
+++ b/test/functional/cases/135_spamassassin.robot
@@ -8,6 +8,7 @@ Variables ${TESTDIR}/lib/vars.py
*** Variables ***
${CONFIG} ${TESTDIR}/configs/plugins.conf
${RSPAMD_SCOPE} Suite
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Freemail Scan