From d4bab2f70adbabf14e734f4c9bc497843c298f5c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 28 Jul 2016 13:57:55 +0100 Subject: [Test] Reorder tests --- test/functional/cases/100_general.robot | 42 ++++++++++++++++ test/functional/cases/101_lua.robot | 35 +++++++++++++ test/functional/cases/105_archives.robot | 23 +++++++++ .../cases/110_statistics/compat-keyed.robot | 20 ++++++++ .../cases/110_statistics/compat-plain.robot | 19 ++++++++ test/functional/cases/110_statistics/lib.robot | 57 ++++++++++++++++++++++ .../cases/110_statistics/redis-keyed-siphash.robot | 20 ++++++++ .../cases/110_statistics/redis-keyed-xxhash.robot | 20 ++++++++ .../cases/110_statistics/redis-plain-siphash.robot | 19 ++++++++ .../cases/110_statistics/redis-plain-xxhash.robot | 19 ++++++++ .../110_statistics/sqlite-broken-stats-dir.robot | 15 ++++++ .../110_statistics/sqlite-keyed-siphash.robot | 19 ++++++++ .../cases/110_statistics/sqlite-keyed-xxhash.robot | 19 ++++++++ .../110_statistics/sqlite-plain-siphash.robot | 18 +++++++ .../cases/110_statistics/sqlite-plain-xxhash.robot | 18 +++++++ test/functional/cases/120_fuzzy/encrypted.robot | 20 ++++++++ test/functional/cases/120_fuzzy/lib.robot | 48 ++++++++++++++++++ test/functional/cases/120_fuzzy/plain.robot | 18 +++++++ test/functional/cases/archives.robot | 23 --------- test/functional/cases/fuzzy/encrypted.robot | 20 -------- test/functional/cases/fuzzy/lib.robot | 48 ------------------ test/functional/cases/fuzzy/plain.robot | 18 ------- test/functional/cases/general.robot | 42 ---------------- test/functional/cases/lua.robot | 35 ------------- .../functional/cases/statistics/compat-keyed.robot | 20 -------- .../functional/cases/statistics/compat-plain.robot | 19 -------- test/functional/cases/statistics/lib.robot | 57 ---------------------- .../cases/statistics/redis-keyed-siphash.robot | 20 -------- .../cases/statistics/redis-keyed-xxhash.robot | 20 -------- .../cases/statistics/redis-plain-siphash.robot | 19 -------- .../cases/statistics/redis-plain-xxhash.robot | 19 -------- .../cases/statistics/sqlite-broken-stats-dir.robot | 15 ------ .../cases/statistics/sqlite-keyed-siphash.robot | 19 -------- .../cases/statistics/sqlite-keyed-xxhash.robot | 19 -------- .../cases/statistics/sqlite-plain-siphash.robot | 18 ------- .../cases/statistics/sqlite-plain-xxhash.robot | 18 ------- 36 files changed, 449 insertions(+), 449 deletions(-) create mode 100644 test/functional/cases/100_general.robot create mode 100644 test/functional/cases/101_lua.robot create mode 100644 test/functional/cases/105_archives.robot create mode 100644 test/functional/cases/110_statistics/compat-keyed.robot create mode 100644 test/functional/cases/110_statistics/compat-plain.robot create mode 100644 test/functional/cases/110_statistics/lib.robot create mode 100644 test/functional/cases/110_statistics/redis-keyed-siphash.robot create mode 100644 test/functional/cases/110_statistics/redis-keyed-xxhash.robot create mode 100644 test/functional/cases/110_statistics/redis-plain-siphash.robot create mode 100644 test/functional/cases/110_statistics/redis-plain-xxhash.robot create mode 100644 test/functional/cases/110_statistics/sqlite-broken-stats-dir.robot create mode 100644 test/functional/cases/110_statistics/sqlite-keyed-siphash.robot create mode 100644 test/functional/cases/110_statistics/sqlite-keyed-xxhash.robot create mode 100644 test/functional/cases/110_statistics/sqlite-plain-siphash.robot create mode 100644 test/functional/cases/110_statistics/sqlite-plain-xxhash.robot create mode 100644 test/functional/cases/120_fuzzy/encrypted.robot create mode 100644 test/functional/cases/120_fuzzy/lib.robot create mode 100644 test/functional/cases/120_fuzzy/plain.robot delete mode 100644 test/functional/cases/archives.robot delete mode 100644 test/functional/cases/fuzzy/encrypted.robot delete mode 100644 test/functional/cases/fuzzy/lib.robot delete mode 100644 test/functional/cases/fuzzy/plain.robot delete mode 100644 test/functional/cases/general.robot delete mode 100644 test/functional/cases/lua.robot delete mode 100644 test/functional/cases/statistics/compat-keyed.robot delete mode 100644 test/functional/cases/statistics/compat-plain.robot delete mode 100644 test/functional/cases/statistics/lib.robot delete mode 100644 test/functional/cases/statistics/redis-keyed-siphash.robot delete mode 100644 test/functional/cases/statistics/redis-keyed-xxhash.robot delete mode 100644 test/functional/cases/statistics/redis-plain-siphash.robot delete mode 100644 test/functional/cases/statistics/redis-plain-xxhash.robot delete mode 100644 test/functional/cases/statistics/sqlite-broken-stats-dir.robot delete mode 100644 test/functional/cases/statistics/sqlite-keyed-siphash.robot delete mode 100644 test/functional/cases/statistics/sqlite-keyed-xxhash.robot delete mode 100644 test/functional/cases/statistics/sqlite-plain-siphash.robot delete mode 100644 test/functional/cases/statistics/sqlite-plain-xxhash.robot (limited to 'test') diff --git a/test/functional/cases/100_general.robot b/test/functional/cases/100_general.robot new file mode 100644 index 000000000..8876ef980 --- /dev/null +++ b/test/functional/cases/100_general.robot @@ -0,0 +1,42 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/trivial.conf +${GTUBE} ${TESTDIR}/messages/gtube.eml +${RSPAMD_SCOPE} Suite + +*** Test Cases *** +GTUBE + ${result} = Scan Message With Rspamc ${GTUBE} + Check Rspamc ${result} GTUBE ( + +GTUBE - Encrypted + ${result} = Run Rspamc -p -h ${LOCAL_ADDR}:${PORT_NORMAL} --key ${KEY_PUB1} + ... ${GTUBE} + Check Rspamc ${result} GTUBE ( + +GTUBE - Scan File feature + ${result} = Scan File ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} + Follow Rspamd Log + Should Contain ${result} GTUBE + +GTUBE - Scan File feature (encoded) + ${encoded} = Encode Filename ${GTUBE} + ${result} = Scan File ${LOCAL_ADDR} ${PORT_NORMAL} ${encoded} + Follow Rspamd Log + Should Contain ${result} GTUBE + +GTUBE - SPAMC + ${result} = Spamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} + Follow Rspamd Log + Should Contain ${result} GTUBE + +GTUBE - RSPAMC + ${result} = Rspamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} + Follow Rspamd Log + Should Contain ${result} GTUBE diff --git a/test/functional/cases/101_lua.robot b/test/functional/cases/101_lua.robot new file mode 100644 index 000000000..5e5dff6c8 --- /dev/null +++ b/test/functional/cases/101_lua.robot @@ -0,0 +1,35 @@ +*** Settings *** +Test Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/lua_test.conf +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${RSPAMD_SCOPE} Test + +*** Test Cases *** +Flags + [Setup] Lua Setup ${TESTDIR}/lua/flags.lua + ${result} = Scan Message With Rspamc ${MESSAGE} + Follow Rspamd Log + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} stat + Should Contain ${result.stdout} Messages scanned: 0 + +Dependencies + [Setup] Lua Setup ${TESTDIR}/lua/deps.lua + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} DEP10 + +Pre and Post Filters + [Setup] Lua Setup ${TESTDIR}/lua/prepostfilters.lua + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} TEST_PRE + Check Rspamc ${result} TEST_POST rc_nocheck=1 + +*** Keywords *** +Lua Setup + [Arguments] ${LUA_SCRIPT} + Set Test Variable ${LUA_SCRIPT} + Generic Setup diff --git a/test/functional/cases/105_archives.robot b/test/functional/cases/105_archives.robot new file mode 100644 index 000000000..16a14bfda --- /dev/null +++ b/test/functional/cases/105_archives.robot @@ -0,0 +1,23 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/plugins.conf +${RSPAMD_SCOPE} Suite + +*** Test Cases *** +Zip + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/zip.eml + Check Rspamc ${result} MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n re=1 + +Zip Double Bad Extension + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/zip-doublebad.eml + Check Rspamc ${result} MIME_DOUBLE_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[\\.pdf\\.exe\\]\\n re=1 + +Rar4 + ${result} = Scan Message With Rspamc ${TESTDIR}/messages/rar4.eml + Check Rspamc ${result} MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n re=1 diff --git a/test/functional/cases/110_statistics/compat-keyed.robot b/test/functional/cases/110_statistics/compat-keyed.robot new file mode 100644 index 000000000..1242df12c --- /dev/null +++ b/test/functional/cases/110_statistics/compat-keyed.robot @@ -0,0 +1,20 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} mmap +${STATS_HASH} hash = "compat"; +${STATS_KEY} key = "${KEY_PVT1}"; +${STATS_PATH_CACHE} name = "sqlite3"; path = "\${TMPDIR}/learn_cache.db"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/compat-plain.robot b/test/functional/cases/110_statistics/compat-plain.robot new file mode 100644 index 000000000..12bbaedcd --- /dev/null +++ b/test/functional/cases/110_statistics/compat-plain.robot @@ -0,0 +1,19 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} mmap +${STATS_HASH} hash = "compat"; +${STATS_PATH_CACHE} name = "sqlite3"; path = "\${TMPDIR}/learn_cache.db"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/lib.robot b/test/functional/cases/110_statistics/lib.robot new file mode 100644 index 000000000..5f9e96038 --- /dev/null +++ b/test/functional/cases/110_statistics/lib.robot @@ -0,0 +1,57 @@ +*** Settings *** +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/stats.conf +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${REDIS_SCOPE} Suite +${REDIS_SERVER} ${EMPTY} +${RSPAMD_SCOPE} Suite +${STATS_HASH} ${EMPTY} +${STATS_KEY} ${EMPTY} +${STATS_PATH_CACHE} path = "\${TMPDIR}/bayes-cache.sqlite"; +${STATS_PATH_HAM} path = "\${TMPDIR}/bayes-ham.sqlite"; +${STATS_PATH_SPAM} path = "\${TMPDIR}/bayes-spam.sqlite"; + +*** Keywords *** +Broken Learn Test + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} + Check Rspamc ${result} cannot find statfile backend + +Empty Part Test + Set Test Variable ${MESSAGE} ${TESTDIR}/messages/empty_part.eml + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} + Check Rspamc ${result} + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} BAYES_SPAM + +Learn Test + Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 0 + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} + Check Rspamc ${result} + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} BAYES_SPAM + Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 1 + +Relearn Test + Run Keyword If ${RSPAMD_STATS_LEARNTEST} == 0 Fail "Learn test was not run" + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE} + Check Rspamc ${result} + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} BAYES_HAM + +Redis Statistics Setup + Generic Setup + Run Redis + +Redis Statistics Teardown + Generic Teardown + Shutdown Process With Children ${REDIS_PID} + +Statistics Setup + Generic Setup STATS_PATH_CACHE STATS_PATH_HAM STATS_PATH_SPAM + +Statistics Teardown + Generic Teardown diff --git a/test/functional/cases/110_statistics/redis-keyed-siphash.robot b/test/functional/cases/110_statistics/redis-keyed-siphash.robot new file mode 100644 index 000000000..ec95efcd1 --- /dev/null +++ b/test/functional/cases/110_statistics/redis-keyed-siphash.robot @@ -0,0 +1,20 @@ +*** Settings *** +Suite Setup Redis Statistics Setup +Suite Teardown Redis Statistics Teardown +Resource lib.robot + +*** Variables *** +${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" +${STATS_BACKEND} redis +${STATS_HASH} hash = "siphash"; +${STATS_KEY} key = "${KEY_PVT1}"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/redis-keyed-xxhash.robot b/test/functional/cases/110_statistics/redis-keyed-xxhash.robot new file mode 100644 index 000000000..5a7b2daf3 --- /dev/null +++ b/test/functional/cases/110_statistics/redis-keyed-xxhash.robot @@ -0,0 +1,20 @@ +*** Settings *** +Suite Setup Redis Statistics Setup +Suite Teardown Redis Statistics Teardown +Resource lib.robot + +*** Variables *** +${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" +${STATS_BACKEND} redis +${STATS_HASH} hash = "xxhash"; +${STATS_KEY} key = "${KEY_PVT1}"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/redis-plain-siphash.robot b/test/functional/cases/110_statistics/redis-plain-siphash.robot new file mode 100644 index 000000000..d436b1a68 --- /dev/null +++ b/test/functional/cases/110_statistics/redis-plain-siphash.robot @@ -0,0 +1,19 @@ +*** Settings *** +Suite Setup Redis Statistics Setup +Suite Teardown Redis Statistics Teardown +Resource lib.robot + +*** Variables *** +${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" +${STATS_BACKEND} redis +${STATS_HASH} hash = "siphash"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/redis-plain-xxhash.robot b/test/functional/cases/110_statistics/redis-plain-xxhash.robot new file mode 100644 index 000000000..0c45ac16b --- /dev/null +++ b/test/functional/cases/110_statistics/redis-plain-xxhash.robot @@ -0,0 +1,19 @@ +*** Settings *** +Suite Setup Redis Statistics Setup +Suite Teardown Redis Statistics Teardown +Resource lib.robot + +*** Variables *** +${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" +${STATS_BACKEND} redis +${STATS_HASH} hash = "xxhash"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/sqlite-broken-stats-dir.robot b/test/functional/cases/110_statistics/sqlite-broken-stats-dir.robot new file mode 100644 index 000000000..57d75c294 --- /dev/null +++ b/test/functional/cases/110_statistics/sqlite-broken-stats-dir.robot @@ -0,0 +1,15 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Resource ${TESTDIR}/lib/rspamd.robot +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} sqlite3 +${STATS_PATH_CACHE} path = "/does/not/exist/bayes-cache.sqlite"; +${STATS_PATH_HAM} path = "/does/not/exist/bayes-ham.sqlite"; +${STATS_PATH_SPAM} path = "/does/not/exist/bayes-spam.sqlite"; + +*** Test Cases *** +Broken Stats Directory + Broken Learn Test diff --git a/test/functional/cases/110_statistics/sqlite-keyed-siphash.robot b/test/functional/cases/110_statistics/sqlite-keyed-siphash.robot new file mode 100644 index 000000000..8b9661a9a --- /dev/null +++ b/test/functional/cases/110_statistics/sqlite-keyed-siphash.robot @@ -0,0 +1,19 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} sqlite3 +${STATS_HASH} hash = "siphash"; +${STATS_KEY} key = "${KEY_PVT1}"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/sqlite-keyed-xxhash.robot b/test/functional/cases/110_statistics/sqlite-keyed-xxhash.robot new file mode 100644 index 000000000..7a51e93ae --- /dev/null +++ b/test/functional/cases/110_statistics/sqlite-keyed-xxhash.robot @@ -0,0 +1,19 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} sqlite3 +${STATS_HASH} hash = "xxhash"; +${STATS_KEY} key = "${KEY_PVT1}"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/sqlite-plain-siphash.robot b/test/functional/cases/110_statistics/sqlite-plain-siphash.robot new file mode 100644 index 000000000..2f88e0a95 --- /dev/null +++ b/test/functional/cases/110_statistics/sqlite-plain-siphash.robot @@ -0,0 +1,18 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} sqlite3 +${STATS_HASH} hash = "siphash"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/110_statistics/sqlite-plain-xxhash.robot b/test/functional/cases/110_statistics/sqlite-plain-xxhash.robot new file mode 100644 index 000000000..dd8198222 --- /dev/null +++ b/test/functional/cases/110_statistics/sqlite-plain-xxhash.robot @@ -0,0 +1,18 @@ +*** Settings *** +Suite Setup Statistics Setup +Suite Teardown Statistics Teardown +Resource lib.robot + +*** Variables *** +${STATS_BACKEND} sqlite3 +${STATS_HASH} hash = "xxhash"; + +*** Test Cases *** +Learn + Learn Test + +Relearn + Relearn Test + +Empty Part + Empty Part Test diff --git a/test/functional/cases/120_fuzzy/encrypted.robot b/test/functional/cases/120_fuzzy/encrypted.robot new file mode 100644 index 000000000..45408d7f8 --- /dev/null +++ b/test/functional/cases/120_fuzzy/encrypted.robot @@ -0,0 +1,20 @@ +*** Settings *** +Suite Setup Encrypted Fuzzy Setup +Suite Teardown Generic Teardown +Resource lib.robot + +*** Test Cases *** +Fuzzy Add + Fuzzy Add Test + +Fuzzy Delete + Fuzzy Delete Test + +Fuzzy Overwrite + Fuzzy Overwrite Test + +*** Keywords *** +Encrypted Fuzzy Setup + Set Suite Variable ${SETTINGS_FUZZY_WORKER} "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true; + Set Suite Variable ${SETTINGS_FUZZY_CHECK} encryption_key = "${KEY_PUB1}"; + Generic Setup diff --git a/test/functional/cases/120_fuzzy/lib.robot b/test/functional/cases/120_fuzzy/lib.robot new file mode 100644 index 000000000..e5e9cbcb7 --- /dev/null +++ b/test/functional/cases/120_fuzzy/lib.robot @@ -0,0 +1,48 @@ +*** Settings *** +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/fuzzy.conf +${FLAG1_NUMBER} 50 +${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED +${FLAG2_NUMBER} 51 +${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE +${MESSAGE} ${TESTDIR}/messages/bad_message.eml +${RSPAMD_SCOPE} Suite + +*** Keywords *** +Fuzzy Add Test + Set Suite Variable ${RSPAMD_FUZZY_ADD} 0 + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 -f + ... ${FLAG1_NUMBER} fuzzy_add ${MESSAGE} + Check Rspamc ${result} + Sync Fuzzy Storage + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} ${FLAG1_SYMBOL} + Set Suite Variable ${RSPAMD_FUZZY_ADD} 1 + +Fuzzy Delete Test + Run Keyword If ${RSPAMD_FUZZY_ADD} == 0 Fail "Fuzzy Add was not run" + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -f ${FLAG1_NUMBER} fuzzy_del + ... ${MESSAGE} + Check Rspamc ${result} + Sync Fuzzy Storage + ${result} = Scan Message With Rspamc ${MESSAGE} + Follow Rspamd Log + Should Not Contain ${result.stdout} ${FLAG1_SYMBOL} + Should Be Equal As Integers ${result.rc} 0 + +Fuzzy Overwrite Test + ${flag_numbers} = Create List ${FLAG1_NUMBER} ${FLAG2_NUMBER} + : FOR ${i} IN @{flag_numbers} + \ ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 + \ ... -f ${i} fuzzy_add ${MESSAGE} + \ Check Rspamc ${result} + Sync Fuzzy Storage + ${result} = Scan Message With Rspamc ${MESSAGE} + Follow Rspamd Log + Should Not Contain ${result.stdout} ${FLAG1_SYMBOL} + Should Contain ${result.stdout} ${FLAG2_SYMBOL} + Should Be Equal As Integers ${result.rc} 0 diff --git a/test/functional/cases/120_fuzzy/plain.robot b/test/functional/cases/120_fuzzy/plain.robot new file mode 100644 index 000000000..2fc2fd5ef --- /dev/null +++ b/test/functional/cases/120_fuzzy/plain.robot @@ -0,0 +1,18 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Resource lib.robot + +*** Variables *** +${SETTINGS_FUZZY_WORKER} ${EMPTY} +${SETTINGS_FUZZY_CHECK} ${EMPTY} + +*** Test Cases *** +Fuzzy Add + Fuzzy Add Test + +Fuzzy Delete + Fuzzy Delete Test + +Fuzzy Overwrite + Fuzzy Overwrite Test diff --git a/test/functional/cases/archives.robot b/test/functional/cases/archives.robot deleted file mode 100644 index 16a14bfda..000000000 --- a/test/functional/cases/archives.robot +++ /dev/null @@ -1,23 +0,0 @@ -*** Settings *** -Suite Setup Generic Setup -Suite Teardown Generic Teardown -Library ${TESTDIR}/lib/rspamd.py -Resource ${TESTDIR}/lib/rspamd.robot -Variables ${TESTDIR}/lib/vars.py - -*** Variables *** -${CONFIG} ${TESTDIR}/configs/plugins.conf -${RSPAMD_SCOPE} Suite - -*** Test Cases *** -Zip - ${result} = Scan Message With Rspamc ${TESTDIR}/messages/zip.eml - Check Rspamc ${result} MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n re=1 - -Zip Double Bad Extension - ${result} = Scan Message With Rspamc ${TESTDIR}/messages/zip-doublebad.eml - Check Rspamc ${result} MIME_DOUBLE_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[\\.pdf\\.exe\\]\\n re=1 - -Rar4 - ${result} = Scan Message With Rspamc ${TESTDIR}/messages/rar4.eml - Check Rspamc ${result} MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n re=1 diff --git a/test/functional/cases/fuzzy/encrypted.robot b/test/functional/cases/fuzzy/encrypted.robot deleted file mode 100644 index 45408d7f8..000000000 --- a/test/functional/cases/fuzzy/encrypted.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Suite Setup Encrypted Fuzzy Setup -Suite Teardown Generic Teardown -Resource lib.robot - -*** Test Cases *** -Fuzzy Add - Fuzzy Add Test - -Fuzzy Delete - Fuzzy Delete Test - -Fuzzy Overwrite - Fuzzy Overwrite Test - -*** Keywords *** -Encrypted Fuzzy Setup - Set Suite Variable ${SETTINGS_FUZZY_WORKER} "keypair": {"pubkey": "${KEY_PUB1}", "privkey": "${KEY_PVT1}"}; "encrypted_only": true; - Set Suite Variable ${SETTINGS_FUZZY_CHECK} encryption_key = "${KEY_PUB1}"; - Generic Setup diff --git a/test/functional/cases/fuzzy/lib.robot b/test/functional/cases/fuzzy/lib.robot deleted file mode 100644 index e5e9cbcb7..000000000 --- a/test/functional/cases/fuzzy/lib.robot +++ /dev/null @@ -1,48 +0,0 @@ -*** Settings *** -Library ${TESTDIR}/lib/rspamd.py -Resource ${TESTDIR}/lib/rspamd.robot -Variables ${TESTDIR}/lib/vars.py - -*** Variables *** -${CONFIG} ${TESTDIR}/configs/fuzzy.conf -${FLAG1_NUMBER} 50 -${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED -${FLAG2_NUMBER} 51 -${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE -${MESSAGE} ${TESTDIR}/messages/bad_message.eml -${RSPAMD_SCOPE} Suite - -*** Keywords *** -Fuzzy Add Test - Set Suite Variable ${RSPAMD_FUZZY_ADD} 0 - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 -f - ... ${FLAG1_NUMBER} fuzzy_add ${MESSAGE} - Check Rspamc ${result} - Sync Fuzzy Storage - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} ${FLAG1_SYMBOL} - Set Suite Variable ${RSPAMD_FUZZY_ADD} 1 - -Fuzzy Delete Test - Run Keyword If ${RSPAMD_FUZZY_ADD} == 0 Fail "Fuzzy Add was not run" - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -f ${FLAG1_NUMBER} fuzzy_del - ... ${MESSAGE} - Check Rspamc ${result} - Sync Fuzzy Storage - ${result} = Scan Message With Rspamc ${MESSAGE} - Follow Rspamd Log - Should Not Contain ${result.stdout} ${FLAG1_SYMBOL} - Should Be Equal As Integers ${result.rc} 0 - -Fuzzy Overwrite Test - ${flag_numbers} = Create List ${FLAG1_NUMBER} ${FLAG2_NUMBER} - : FOR ${i} IN @{flag_numbers} - \ ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 - \ ... -f ${i} fuzzy_add ${MESSAGE} - \ Check Rspamc ${result} - Sync Fuzzy Storage - ${result} = Scan Message With Rspamc ${MESSAGE} - Follow Rspamd Log - Should Not Contain ${result.stdout} ${FLAG1_SYMBOL} - Should Contain ${result.stdout} ${FLAG2_SYMBOL} - Should Be Equal As Integers ${result.rc} 0 diff --git a/test/functional/cases/fuzzy/plain.robot b/test/functional/cases/fuzzy/plain.robot deleted file mode 100644 index 2fc2fd5ef..000000000 --- a/test/functional/cases/fuzzy/plain.robot +++ /dev/null @@ -1,18 +0,0 @@ -*** Settings *** -Suite Setup Generic Setup -Suite Teardown Generic Teardown -Resource lib.robot - -*** Variables *** -${SETTINGS_FUZZY_WORKER} ${EMPTY} -${SETTINGS_FUZZY_CHECK} ${EMPTY} - -*** Test Cases *** -Fuzzy Add - Fuzzy Add Test - -Fuzzy Delete - Fuzzy Delete Test - -Fuzzy Overwrite - Fuzzy Overwrite Test diff --git a/test/functional/cases/general.robot b/test/functional/cases/general.robot deleted file mode 100644 index 8876ef980..000000000 --- a/test/functional/cases/general.robot +++ /dev/null @@ -1,42 +0,0 @@ -*** Settings *** -Suite Setup Generic Setup -Suite Teardown Generic Teardown -Library ${TESTDIR}/lib/rspamd.py -Resource ${TESTDIR}/lib/rspamd.robot -Variables ${TESTDIR}/lib/vars.py - -*** Variables *** -${CONFIG} ${TESTDIR}/configs/trivial.conf -${GTUBE} ${TESTDIR}/messages/gtube.eml -${RSPAMD_SCOPE} Suite - -*** Test Cases *** -GTUBE - ${result} = Scan Message With Rspamc ${GTUBE} - Check Rspamc ${result} GTUBE ( - -GTUBE - Encrypted - ${result} = Run Rspamc -p -h ${LOCAL_ADDR}:${PORT_NORMAL} --key ${KEY_PUB1} - ... ${GTUBE} - Check Rspamc ${result} GTUBE ( - -GTUBE - Scan File feature - ${result} = Scan File ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} - Follow Rspamd Log - Should Contain ${result} GTUBE - -GTUBE - Scan File feature (encoded) - ${encoded} = Encode Filename ${GTUBE} - ${result} = Scan File ${LOCAL_ADDR} ${PORT_NORMAL} ${encoded} - Follow Rspamd Log - Should Contain ${result} GTUBE - -GTUBE - SPAMC - ${result} = Spamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} - Follow Rspamd Log - Should Contain ${result} GTUBE - -GTUBE - RSPAMC - ${result} = Rspamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE} - Follow Rspamd Log - Should Contain ${result} GTUBE diff --git a/test/functional/cases/lua.robot b/test/functional/cases/lua.robot deleted file mode 100644 index 5e5dff6c8..000000000 --- a/test/functional/cases/lua.robot +++ /dev/null @@ -1,35 +0,0 @@ -*** Settings *** -Test Teardown Generic Teardown -Library ${TESTDIR}/lib/rspamd.py -Resource ${TESTDIR}/lib/rspamd.robot -Variables ${TESTDIR}/lib/vars.py - -*** Variables *** -${CONFIG} ${TESTDIR}/configs/lua_test.conf -${MESSAGE} ${TESTDIR}/messages/spam_message.eml -${RSPAMD_SCOPE} Test - -*** Test Cases *** -Flags - [Setup] Lua Setup ${TESTDIR}/lua/flags.lua - ${result} = Scan Message With Rspamc ${MESSAGE} - Follow Rspamd Log - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} stat - Should Contain ${result.stdout} Messages scanned: 0 - -Dependencies - [Setup] Lua Setup ${TESTDIR}/lua/deps.lua - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} DEP10 - -Pre and Post Filters - [Setup] Lua Setup ${TESTDIR}/lua/prepostfilters.lua - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} TEST_PRE - Check Rspamc ${result} TEST_POST rc_nocheck=1 - -*** Keywords *** -Lua Setup - [Arguments] ${LUA_SCRIPT} - Set Test Variable ${LUA_SCRIPT} - Generic Setup diff --git a/test/functional/cases/statistics/compat-keyed.robot b/test/functional/cases/statistics/compat-keyed.robot deleted file mode 100644 index 1242df12c..000000000 --- a/test/functional/cases/statistics/compat-keyed.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} mmap -${STATS_HASH} hash = "compat"; -${STATS_KEY} key = "${KEY_PVT1}"; -${STATS_PATH_CACHE} name = "sqlite3"; path = "\${TMPDIR}/learn_cache.db"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/compat-plain.robot b/test/functional/cases/statistics/compat-plain.robot deleted file mode 100644 index 12bbaedcd..000000000 --- a/test/functional/cases/statistics/compat-plain.robot +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} mmap -${STATS_HASH} hash = "compat"; -${STATS_PATH_CACHE} name = "sqlite3"; path = "\${TMPDIR}/learn_cache.db"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/lib.robot b/test/functional/cases/statistics/lib.robot deleted file mode 100644 index 5f9e96038..000000000 --- a/test/functional/cases/statistics/lib.robot +++ /dev/null @@ -1,57 +0,0 @@ -*** Settings *** -Library ${TESTDIR}/lib/rspamd.py -Resource ${TESTDIR}/lib/rspamd.robot -Variables ${TESTDIR}/lib/vars.py - -*** Variables *** -${CONFIG} ${TESTDIR}/configs/stats.conf -${MESSAGE} ${TESTDIR}/messages/spam_message.eml -${REDIS_SCOPE} Suite -${REDIS_SERVER} ${EMPTY} -${RSPAMD_SCOPE} Suite -${STATS_HASH} ${EMPTY} -${STATS_KEY} ${EMPTY} -${STATS_PATH_CACHE} path = "\${TMPDIR}/bayes-cache.sqlite"; -${STATS_PATH_HAM} path = "\${TMPDIR}/bayes-ham.sqlite"; -${STATS_PATH_SPAM} path = "\${TMPDIR}/bayes-spam.sqlite"; - -*** Keywords *** -Broken Learn Test - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} - Check Rspamc ${result} cannot find statfile backend - -Empty Part Test - Set Test Variable ${MESSAGE} ${TESTDIR}/messages/empty_part.eml - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} - Check Rspamc ${result} - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} BAYES_SPAM - -Learn Test - Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 0 - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} - Check Rspamc ${result} - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} BAYES_SPAM - Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 1 - -Relearn Test - Run Keyword If ${RSPAMD_STATS_LEARNTEST} == 0 Fail "Learn test was not run" - ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE} - Check Rspamc ${result} - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} BAYES_HAM - -Redis Statistics Setup - Generic Setup - Run Redis - -Redis Statistics Teardown - Generic Teardown - Shutdown Process With Children ${REDIS_PID} - -Statistics Setup - Generic Setup STATS_PATH_CACHE STATS_PATH_HAM STATS_PATH_SPAM - -Statistics Teardown - Generic Teardown diff --git a/test/functional/cases/statistics/redis-keyed-siphash.robot b/test/functional/cases/statistics/redis-keyed-siphash.robot deleted file mode 100644 index ec95efcd1..000000000 --- a/test/functional/cases/statistics/redis-keyed-siphash.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Suite Setup Redis Statistics Setup -Suite Teardown Redis Statistics Teardown -Resource lib.robot - -*** Variables *** -${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" -${STATS_BACKEND} redis -${STATS_HASH} hash = "siphash"; -${STATS_KEY} key = "${KEY_PVT1}"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/redis-keyed-xxhash.robot b/test/functional/cases/statistics/redis-keyed-xxhash.robot deleted file mode 100644 index 5a7b2daf3..000000000 --- a/test/functional/cases/statistics/redis-keyed-xxhash.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Suite Setup Redis Statistics Setup -Suite Teardown Redis Statistics Teardown -Resource lib.robot - -*** Variables *** -${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" -${STATS_BACKEND} redis -${STATS_HASH} hash = "xxhash"; -${STATS_KEY} key = "${KEY_PVT1}"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/redis-plain-siphash.robot b/test/functional/cases/statistics/redis-plain-siphash.robot deleted file mode 100644 index d436b1a68..000000000 --- a/test/functional/cases/statistics/redis-plain-siphash.robot +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Suite Setup Redis Statistics Setup -Suite Teardown Redis Statistics Teardown -Resource lib.robot - -*** Variables *** -${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" -${STATS_BACKEND} redis -${STATS_HASH} hash = "siphash"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/redis-plain-xxhash.robot b/test/functional/cases/statistics/redis-plain-xxhash.robot deleted file mode 100644 index 0c45ac16b..000000000 --- a/test/functional/cases/statistics/redis-plain-xxhash.robot +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Suite Setup Redis Statistics Setup -Suite Teardown Redis Statistics Teardown -Resource lib.robot - -*** Variables *** -${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}" -${STATS_BACKEND} redis -${STATS_HASH} hash = "xxhash"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/sqlite-broken-stats-dir.robot b/test/functional/cases/statistics/sqlite-broken-stats-dir.robot deleted file mode 100644 index 57d75c294..000000000 --- a/test/functional/cases/statistics/sqlite-broken-stats-dir.robot +++ /dev/null @@ -1,15 +0,0 @@ -*** Settings *** -Suite Setup Generic Setup -Suite Teardown Generic Teardown -Resource ${TESTDIR}/lib/rspamd.robot -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} sqlite3 -${STATS_PATH_CACHE} path = "/does/not/exist/bayes-cache.sqlite"; -${STATS_PATH_HAM} path = "/does/not/exist/bayes-ham.sqlite"; -${STATS_PATH_SPAM} path = "/does/not/exist/bayes-spam.sqlite"; - -*** Test Cases *** -Broken Stats Directory - Broken Learn Test diff --git a/test/functional/cases/statistics/sqlite-keyed-siphash.robot b/test/functional/cases/statistics/sqlite-keyed-siphash.robot deleted file mode 100644 index 8b9661a9a..000000000 --- a/test/functional/cases/statistics/sqlite-keyed-siphash.robot +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} sqlite3 -${STATS_HASH} hash = "siphash"; -${STATS_KEY} key = "${KEY_PVT1}"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/sqlite-keyed-xxhash.robot b/test/functional/cases/statistics/sqlite-keyed-xxhash.robot deleted file mode 100644 index 7a51e93ae..000000000 --- a/test/functional/cases/statistics/sqlite-keyed-xxhash.robot +++ /dev/null @@ -1,19 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} sqlite3 -${STATS_HASH} hash = "xxhash"; -${STATS_KEY} key = "${KEY_PVT1}"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/sqlite-plain-siphash.robot b/test/functional/cases/statistics/sqlite-plain-siphash.robot deleted file mode 100644 index 2f88e0a95..000000000 --- a/test/functional/cases/statistics/sqlite-plain-siphash.robot +++ /dev/null @@ -1,18 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} sqlite3 -${STATS_HASH} hash = "siphash"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test diff --git a/test/functional/cases/statistics/sqlite-plain-xxhash.robot b/test/functional/cases/statistics/sqlite-plain-xxhash.robot deleted file mode 100644 index dd8198222..000000000 --- a/test/functional/cases/statistics/sqlite-plain-xxhash.robot +++ /dev/null @@ -1,18 +0,0 @@ -*** Settings *** -Suite Setup Statistics Setup -Suite Teardown Statistics Teardown -Resource lib.robot - -*** Variables *** -${STATS_BACKEND} sqlite3 -${STATS_HASH} hash = "xxhash"; - -*** Test Cases *** -Learn - Learn Test - -Relearn - Relearn Test - -Empty Part - Empty Part Test -- cgit v1.2.3