commit b7f5a57: [TEST] FNames
korgoth1
vladislav.stakhov at gmail.com
Thu Sep 3 12:07:07 UTC 2020
Author: korgoth1
Date: 2020-09-02 22:07:15 +0300
URL: https://github.com/rspamd/rspamd/commit/b7f5a57f6fe0705ed1e21fbdbaa9ca4992daecce (refs/pull/3483/head)
[TEST] FNames
---
test/functional/cases/280_rules.robot | 6 ------
test/functional/cases/281_fnames.robot | 30 ++++++++++++++++++++++++++++++
test/functional/configs/plugins.conf | 1 -
3 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/test/functional/cases/280_rules.robot b/test/functional/cases/280_rules.robot
index a9cf70533..72393677d 100644
--- a/test/functional/cases/280_rules.robot
+++ b/test/functional/cases/280_rules.robot
@@ -7,7 +7,6 @@ Variables ${TESTDIR}/lib/vars.py
*** Variables ***
${CONFIG} ${TESTDIR}/configs/plugins.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/test_fname.lua
${MESSAGE} ${TESTDIR}/messages/newlines.eml
${MESSAGE1} ${TESTDIR}/messages/fws_fn.eml
${MESSAGE2} ${TESTDIR}/messages/fws_fp.eml
@@ -111,11 +110,6 @@ PHISH_SENDER_ROUTING_PART
${result} = Scan Message With Rspamc ${TESTDIR}/messages/phish_sender6.eml
Should Contain ${result.stdout} FROM_INVALID
-FILE NAMES
- ${result} = Scan Message With Rspamc ${TESTDIR}/messages/fname.eml
- Should Contain ${result.stdout} TEST_FNAME
- Should Contain ${result.stdout} [삼성생명]2020.08.14 데일리 경제뉴스.pdf, 01029_402110_10620_RGT06902_PRT180ML_20200803_101820.pdf
-
*** Keywords ***
Rules Setup
diff --git a/test/functional/cases/281_fnames.robot b/test/functional/cases/281_fnames.robot
new file mode 100644
index 000000000..9e3d37b57
--- /dev/null
+++ b/test/functional/cases/281_fnames.robot
@@ -0,0 +1,30 @@
+*** Settings ***
+Suite Setup Fnames Setup
+Suite Teardown Fnames Teardown
+Library ${TESTDIR}/lib/rspamd.py
+Resource ${TESTDIR}/lib/rspamd.robot
+Variables ${TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${TESTDIR}/configs/lua_script.conf
+${LUA_SCRIPT} ${TESTDIR}/lua/test_fname.lua
+${RSPAMD_SCOPE} Suite
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+
+
+*** Test Cases ***
+FILE NAMES
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/fname.eml
+ Should Contain ${result.stdout} TEST_FNAME
+ Should Contain ${result.stdout} [삼성생명]2020.08.14 데일리 경제뉴스.pdf, 01029_402110_10620_RGT06902_PRT180ML_20200803_101820.pdf
+
+
+*** Keywords ***
+Fnames Setup
+ ${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/regexp.conf
+ Set Suite Variable ${PLUGIN_CONFIG}
+ Generic Setup PLUGIN_CONFIG
+
+Fnames Teardown
+ Normal Teardown
+ Terminate All Processes kill=True
\ No newline at end of file
diff --git a/test/functional/configs/plugins.conf b/test/functional/configs/plugins.conf
index 7688a5f8a..b1885eeb6 100644
--- a/test/functional/configs/plugins.conf
+++ b/test/functional/configs/plugins.conf
@@ -746,6 +746,5 @@ modules {
}
spf {}
lua = "${TESTDIR}/lua/test_coverage.lua";
-lua = ${LUA_SCRIPT};
lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
${PLUGIN_CONFIG}
More information about the Commits
mailing list