aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-04 11:29:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-04 12:22:27 +0100
commit581db041d2a8506581408c376a6edc37f8d2e9ca (patch)
tree1791dde7508ee68490b64a71ee594773ce4b7e16 /test
parent1d239fd2fd4fb418fde85b3ef5d4648e0fd135cc (diff)
downloadrspamd-581db041d2a8506581408c376a6edc37f8d2e9ca.tar.gz
rspamd-581db041d2a8506581408c376a6edc37f8d2e9ca.zip
[Test] Unify some configs
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/102_multimap.robot (renamed from test/functional/cases/102_maps.robot)10
-rw-r--r--test/functional/cases/105_mimetypes.robot (renamed from test/functional/cases/105_archives.robot)8
-rw-r--r--test/functional/configs/mime_types.conf15
-rw-r--r--test/functional/configs/multimap.conf (renamed from test/functional/configs/maps.conf)31
-rw-r--r--test/functional/configs/plugins.conf19
5 files changed, 34 insertions, 49 deletions
diff --git a/test/functional/cases/102_maps.robot b/test/functional/cases/102_multimap.robot
index 1c7bcb3bc..9d02ca666 100644
--- a/test/functional/cases/102_maps.robot
+++ b/test/functional/cases/102_multimap.robot
@@ -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
diff --git a/test/functional/cases/105_archives.robot b/test/functional/cases/105_mimetypes.robot
index 16a14bfda..c67784f25 100644
--- a/test/functional/cases/105_archives.robot
+++ b/test/functional/cases/105_mimetypes.robot
@@ -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
index 000000000..4aa1ac0ef
--- /dev/null
+++ b/test/functional/configs/mime_types.conf
@@ -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",
+ ]
+ }
+}
diff --git a/test/functional/configs/maps.conf b/test/functional/configs/multimap.conf
index 09a8e8cd7..334b07e02 100644
--- a/test/functional/configs/maps.conf
+++ b/test/functional/configs/multimap.conf
@@ -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";
diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf
index 6eded737a..2beb7b764 100644
--- a/test/functional/configs/plugins.conf
+++ b/test/functional/configs/plugins.conf
@@ -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}