]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Unify some configs
authorAndrew Lewis <nerf@judo.za.org>
Thu, 4 Aug 2016 10:29:45 +0000 (11:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 4 Aug 2016 11:22:27 +0000 (12:22 +0100)
test/functional/cases/102_multimap.robot [moved from test/functional/cases/102_maps.robot with 94% similarity]
test/functional/cases/105_mimetypes.robot [moved from test/functional/cases/105_archives.robot with 79% similarity]
test/functional/configs/mime_types.conf [new file with mode: 0644]
test/functional/configs/multimap.conf [moved from test/functional/configs/maps.conf with 65% similarity]
test/functional/configs/plugins.conf

similarity index 94%
rename from test/functional/cases/102_maps.robot
rename to test/functional/cases/102_multimap.robot
index 1c7bcb3bcc23264f98234f33e4bdf51a5176c270..9d02ca666bca86aa27e5c8ba60fddb616feac302 100644 (file)
@@ -1,12 +1,12 @@
 *** Settings ***
-Suite Setup     Generic Setup
+Suite Setup     Multimap Setup
 Suite Teardown  Generic Teardown
 Library         ${TESTDIR}/lib/rspamd.py
 Resource        ${TESTDIR}/lib/rspamd.robot
 Variables       ${TESTDIR}/lib/vars.py
 
 *** Variables ***
-${CONFIG}       ${TESTDIR}/configs/maps.conf
+${CONFIG}       ${TESTDIR}/configs/plugins.conf
 ${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
 ${UTF_MESSAGE}      ${TESTDIR}/messages/utf.eml
 ${RSPAMD_SCOPE}  Suite
@@ -113,3 +113,9 @@ MAP - CDB - HOSTNAME
 MAP - CDB - HOSTNAME MISS
   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --ip  127.0.0.1  --hostname  rspamd.com
   Check Rspamc  ${result}  HOSTNAME_MAP  inverse=1  rc_noinverse=1
+
+*** Keywords ***
+Multimap Setup
+    ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/multimap.conf
+    Set Suite Variable  ${PLUGIN_CONFIG}
+    Generic Setup  PLUGIN_CONFIG
similarity index 79%
rename from test/functional/cases/105_archives.robot
rename to test/functional/cases/105_mimetypes.robot
index 16a14bfda6cf8747e5db6fb9814ccab5c2a6f4a4..c67784f25e8fc9051c47eb3313b44e77246894ef 100644 (file)
@@ -1,5 +1,5 @@
 *** Settings ***
-Suite Setup     Generic Setup
+Suite Setup     MIMETypes Setup
 Suite Teardown  Generic Teardown
 Library         ${TESTDIR}/lib/rspamd.py
 Resource        ${TESTDIR}/lib/rspamd.robot
@@ -21,3 +21,9 @@ Zip Double Bad Extension
 Rar4
   ${result} =  Scan Message With Rspamc  ${TESTDIR}/messages/rar4.eml
   Check Rspamc  ${result}  MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n  re=1
+
+*** Keywords ***
+MIMETypes Setup
+    ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/mime_types.conf
+    Set Suite Variable  ${PLUGIN_CONFIG}
+    Generic Setup  PLUGIN_CONFIG
diff --git a/test/functional/configs/mime_types.conf b/test/functional/configs/mime_types.conf
new file mode 100644 (file)
index 0000000..4aa1ac0
--- /dev/null
@@ -0,0 +1,15 @@
+mime_types {
+    file = "${TESTDIR}/../../../conf/mime_types.inc";
+    extension_map {
+        html = "text/html";
+        txt [
+            "message/disposition-notification",
+            "text/plain",
+            "text/rfc822-headers",
+        ]
+        pdf [
+            "application/octet-stream",
+            "application/pdf",
+        ]
+    }
+}
similarity index 65%
rename from test/functional/configs/maps.conf
rename to test/functional/configs/multimap.conf
index 09a8e8cd789a2e5ad251125a99abb38853e657ed..334b07e02cf78a276f03f00d09b9f1c5e32b65e7 100644 (file)
@@ -1,34 +1,3 @@
-options = {
-       filters = ["spf", "dkim", "regexp"]
-       url_tld = "${TESTDIR}/../lua/unit/test_tld.dat"
-       pidfile = "${TMPDIR}/rspamd.pid"
-       lua_path = "${TESTDIR}/../../contrib/lua-fun/?.lua"
-}
-logging = {
-       type = "file",
-       level = "debug"
-       filename = "${TMPDIR}/rspamd.log"
-}
-metric = {
-       name = "default",
-       actions = {
-               reject = 100500,
-       }
-       unknown_weight = 1
-}
-
-worker {
-       type = normal
-       bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
-       count = 1
-       keypair {
-               pubkey = "${KEY_PUB1}";
-               privkey = "${KEY_PVT1}";
-       }
-}
-modules {
-    path = "${TESTDIR}/../../src/plugins/lua/"
-}
 multimap {
   DNSBL_MAP {
     type = "dnsbl";
index 6eded737ab39a981c1a230cc5111b1120147e4b9..2beb7b764fe708a666c8672d92aafab6e1b77073 100644 (file)
@@ -1,5 +1,8 @@
 options = {
+       filters = ["spf", "dkim", "regexp"]
+       url_tld = "${TESTDIR}/../lua/unit/test_tld.dat"
        pidfile = "${TMPDIR}/rspamd.pid"
+       lua_path = "${TESTDIR}/../../contrib/lua-fun/?.lua"
 }
 logging = {
        type = "file",
@@ -18,21 +21,7 @@ worker {
        bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
        count = 1
 }
-mime_types {
-    file = "${TESTDIR}/../../../conf/mime_types.inc";
-    extension_map {
-        html = "text/html";
-        txt [
-            "message/disposition-notification",
-            "text/plain",
-            "text/rfc822-headers",
-        ]
-        pdf [
-            "application/octet-stream",
-            "application/pdf",
-        ]
-    }
-}
 modules {
     path = "${TESTDIR}/../../src/plugins/lua/"
 }
+${PLUGIN_CONFIG}