From: Andrew Lewis Date: Thu, 4 Aug 2016 10:29:45 +0000 (+0100) Subject: [Test] Unify some configs X-Git-Tag: 1.3.2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=581db041d2a8506581408c376a6edc37f8d2e9ca;p=thirdparty%2Frspamd.git [Test] Unify some configs --- diff --git a/test/functional/cases/102_maps.robot b/test/functional/cases/102_multimap.robot similarity index 94% rename from test/functional/cases/102_maps.robot rename to test/functional/cases/102_multimap.robot index 1c7bcb3bcc..9d02ca666b 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 similarity index 79% rename from test/functional/cases/105_archives.robot rename to test/functional/cases/105_mimetypes.robot index 16a14bfda6..c67784f25e 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 0000000000..4aa1ac0efc --- /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 similarity index 65% rename from test/functional/configs/maps.conf rename to test/functional/configs/multimap.conf index 09a8e8cd78..334b07e02c 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 6eded737ab..2beb7b764f 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}