commit a92c5d4: Add tests for multiple signatures

John McKay adenosine3p at gmail.com
Mon Feb 4 14:35:13 UTC 2019


Author: John McKay
Date: 2019-01-26 06:35:55 +0000
URL: https://github.com/rspamd/rspamd/commit/a92c5d43ef34b657bba4a2e201c3b11ded14e9e9

Add tests for multiple signatures

---
 .../{003_eddsa.robot => 005_multiple.robot}              | 16 +++-------------
 test/functional/configs/dkim_signing/multiple.conf       | 15 +++++++++++++++
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/test/functional/cases/131_dkim_signing/003_eddsa.robot b/test/functional/cases/131_dkim_signing/005_multiple.robot
similarity index 62%
copy from test/functional/cases/131_dkim_signing/003_eddsa.robot
copy to test/functional/cases/131_dkim_signing/005_multiple.robot
index ea2fe03be..4ab5c10a4 100644
--- a/test/functional/cases/131_dkim_signing/003_eddsa.robot
+++ b/test/functional/cases/131_dkim_signing/005_multiple.robot
@@ -14,24 +14,14 @@ ${RSPAMD_SCOPE}  Suite
 ${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
 
 *** Test Cases ***
-TEST SIGNED
+TEST DOUBLE SIGNED
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  -u  bob at cacophony.za.org
-  Check Rspamc  ${result}  DKIM-Signature:
+  Check Rspamc  ${result}  (?s:DKIM-Signature.+DKIM-Signature)  re=1
   Should Contain  ${result.stdout}  DKIM_SIGNED
 
-TEST NOT SIGNED - USERNAME WRONG DOMAIN
-  ${result} =  Scan Message With Rspamc  ${MESSAGE}  -u  bob at example.tk
-  Check Rspamc  ${result}  DKIM-Signature:  inverse=1
-  Should Not Contain  ${result.stdout}  DKIM_SIGNED
-
-TEST NOT SIGNED - USERNAME WRONG PUBKEY
-  ${result} =  Scan Message With Rspamc  ${MESSAGE_FAIL}  -u  bob at invalid.za.org
-  Check Rspamc  ${result}  DKIM-Signature:  inverse=1
-  Should Not Contain  ${result.stdout}  DKIM_SIGNED
-
 *** Keywords ***
 DKIM Signing Setup
-  ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/dkim_signing/eddsa.conf
+  ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/dkim_signing/multiple.conf
   Set Suite Variable  ${PLUGIN_CONFIG}
   Generic Setup  PLUGIN_CONFIG
 
diff --git a/test/functional/configs/dkim_signing/multiple.conf b/test/functional/configs/dkim_signing/multiple.conf
new file mode 100644
index 000000000..072842183
--- /dev/null
+++ b/test/functional/configs/dkim_signing/multiple.conf
@@ -0,0 +1,15 @@
+dkim_signing {
+  domain {
+    cacophony.za.org {
+      selectors = {
+        path: "${TESTDIR}/configs/dkim.key";
+        selector: "dkim";
+      }
+      selectors = {
+        path: "${TESTDIR}/configs/dkim-eddsa.key";
+        selector: "eddsa";
+     }
+   }
+  }
+  allow_pubkey_mismatch: false;
+}


More information about the Commits mailing list