]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Basic tests for DKIM signing module 1488/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 6 Mar 2017 16:41:34 +0000 (18:41 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 6 Mar 2017 16:41:34 +0000 (18:41 +0200)
test/functional/cases/131_dkim_signing.robot [new file with mode: 0644]
test/functional/configs/dkim_signing.conf [new file with mode: 0644]

diff --git a/test/functional/cases/131_dkim_signing.robot b/test/functional/cases/131_dkim_signing.robot
new file mode 100644 (file)
index 0000000..58f608b
--- /dev/null
@@ -0,0 +1,33 @@
+*** Settings ***
+Suite Setup     DKIM Signing Setup
+Suite Teardown  DKIM Signing Teardown
+Library         ${TESTDIR}/lib/rspamd.py
+Resource        ${TESTDIR}/lib/rspamd.robot
+Variables       ${TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG}       ${TESTDIR}/configs/plugins.conf
+${MESSAGE}      ${TESTDIR}/messages/dmarc/fail_none.eml
+${REDIS_SCOPE}  Suite
+${RSPAMD_SCOPE}  Suite
+${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
+
+*** Test Cases ***
+TEST SIGNED
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  -u  bob@rspamd.tk
+  Check Rspamc  ${result}  DKIM-Signature:
+  Should Contain  ${result.stdout}  DKIM_SIGNED (1.00)
+
+TEST NOT SIGNED - USERNAME WRONG DOMAIN
+  ${result} =  Scan Message With Rspamc  ${MESSAGE}  -u  bob@example.tk
+  Check Rspamc  ${result}  DKIM-Signature:  inverse=1
+  Should Not Contain  ${result.stdout}  DKIM_SIGNED (1.00)
+
+*** Keywords ***
+DKIM Signing Setup
+  ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/dkim_signing.conf
+  Set Suite Variable  ${PLUGIN_CONFIG}
+  Generic Setup  PLUGIN_CONFIG
+
+DKIM Signing Teardown
+  Normal Teardown
diff --git a/test/functional/configs/dkim_signing.conf b/test/functional/configs/dkim_signing.conf
new file mode 100644 (file)
index 0000000..d233bef
--- /dev/null
@@ -0,0 +1,3 @@
+dkim_signing {
+  path = "${TESTDIR}/configs/dkim.key";
+}