Browse Source
[Test] Add & rework functional tests
[Test] Add & rework functional tests
- Machine formatted test data - More idiomatic use of test framework - Added tests for fuzzy & redis statisticspull/693/head
26 changed files with 521 additions and 165 deletions
-
22test/functional/cases/__init__.robot
-
20test/functional/cases/fuzzy/encrypted.robot
-
48test/functional/cases/fuzzy/lib.robot
-
18test/functional/cases/fuzzy/plain.robot
-
15test/functional/cases/general.robot
-
21test/functional/cases/lua.robot
-
83test/functional/cases/statistics.robot
-
19test/functional/cases/statistics/compat-keyed.robot
-
18test/functional/cases/statistics/compat-plain.robot
-
59test/functional/cases/statistics/lib.robot
-
20test/functional/cases/statistics/redis-keyed-siphash.robot
-
20test/functional/cases/statistics/redis-keyed-xxhash.robot
-
19test/functional/cases/statistics/redis-plain-siphash.robot
-
19test/functional/cases/statistics/redis-plain-xxhash.robot
-
15test/functional/cases/statistics/sqlite-broken-stats-dir.robot
-
19test/functional/cases/statistics/sqlite-keyed-siphash.robot
-
19test/functional/cases/statistics/sqlite-keyed-xxhash.robot
-
18test/functional/cases/statistics/sqlite-plain-siphash.robot
-
18test/functional/cases/statistics/sqlite-plain-xxhash.robot
-
74test/functional/configs/fuzzy.conf
-
4test/functional/configs/redis-server.conf
-
24test/functional/configs/stats.conf
-
4test/functional/configs/trivial.conf
-
8test/functional/lib/rspamd.py
-
80test/functional/lib/rspamd.robot
-
2test/functional/lib/vars.py
@ -1,18 +1,12 @@ |
|||
*** Settings *** |
|||
Suite Setup Export Global Variables |
|||
Library ../lib/rspamd.py |
|||
Variables ../lib/vars.py |
|||
Suite Setup Export Global Variables |
|||
Library ../lib/rspamd.py |
|||
Variables ../lib/vars.py |
|||
|
|||
*** Keywords *** |
|||
Export Global Variables |
|||
${TESTDIR} = Get Test Directory |
|||
Set Global Variable ${KEY_PUB1} |
|||
Set Global Variable ${KEY_PVT1} |
|||
Set Global Variable ${LOCAL_ADDR} |
|||
Set Global Variable ${PORT_CONTROLLER} |
|||
Set Global Variable ${PORT_NORMAL} |
|||
Set Global Variable ${RSPAMC} ${TESTDIR}/../../src/client/rspamc |
|||
Set Global Variable ${RSPAMD} ${TESTDIR}/../../src/rspamd |
|||
Set Global Variable ${RSPAMD_GROUP} |
|||
Set Global Variable ${RSPAMD_USER} |
|||
Set Global Variable ${TESTDIR} |
|||
${TESTDIR} = Get Test Directory |
|||
Set Global Variable ${RSPAMADM} ${TESTDIR}/../../src/rspamadm/rspamadm |
|||
Set Global Variable ${RSPAMC} ${TESTDIR}/../../src/client/rspamc |
|||
Set Global Variable ${RSPAMD} ${TESTDIR}/../../src/rspamd |
|||
Set Global Variable ${TESTDIR} |
|||
@ -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 |
|||
@ -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 |
|||
@ -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 |
|||
@ -1,83 +0,0 @@ |
|||
*** Settings *** |
|||
Library ${TESTDIR}/lib/rspamd.py |
|||
Resource ${TESTDIR}/lib/rspamd.robot |
|||
|
|||
*** Variables *** |
|||
@{ALIASES} STATSDIR |
|||
${CONFIG} ${TESTDIR}/configs/stats.conf |
|||
${MESSAGE} ${TESTDIR}/messages/spam_message.eml |
|||
${RSPAMD_SCOPE} Test |
|||
|
|||
*** Keywords *** |
|||
Statistics Setup |
|||
[Arguments] @{aliases} &{kw} |
|||
&{RSPAMD_KEYWORDS} = Create Dictionary KEY_PRIVATE=${KEY_PVT1} KEY_PUBLIC=${KEY_PUB1} LOCAL_ADDR=${LOCAL_ADDR} PORT_CONTROLLER=${PORT_CONTROLLER} PORT_NORMAL=${PORT_NORMAL} TESTDIR=${TESTDIR} |
|||
Update Dictionary ${RSPAMD_KEYWORDS} ${kw} |
|||
Set Test Variable &{RSPAMD_KEYWORDS} |
|||
${TMPDIR} ${RSPAMD_PID} ${RSPAMD_LOGPOS} = Run Rspamd @{aliases} &{RSPAMD_KEYWORDS} |
|||
Export Rspamd Vars To Test ${TMPDIR} ${RSPAMD_LOGPOS} ${RSPAMD_PID} |
|||
|
|||
*** Test Cases *** |
|||
Sqlite Learn - Keyed, siphash |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=sqlite3 STATS_HASH=siphash STATS_KEY=${KEY_PVT1} |
|||
${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 |
|||
[Teardown] Generic Teardown |
|||
|
|||
Sqlite Learn - Keyed, xxhash |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=sqlite3 STATS_HASH=xxh STATS_KEY=${KEY_PVT1} |
|||
${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 |
|||
[Teardown] Generic Teardown |
|||
|
|||
Sqlite Learn - Broken Stats Directory |
|||
[Setup] Statistics Setup @{EMPTY} STATS_BACKEND=sqlite3 STATS_HASH=xxh STATS_KEY=${KEY_PVT1} STATSDIR=/does/not/exist |
|||
${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE} |
|||
Follow Rspamd Log |
|||
Should Not Contain ${result.stdout} success = true |
|||
[Teardown] Generic Teardown |
|||
|
|||
Sqlite Learn - Empty part |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=sqlite3 STATS_HASH=xxh STATS_KEY=${KEY_PVT1} |
|||
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 |
|||
[Teardown] Generic Teardown |
|||
|
|||
Sqlite Relearn |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=sqlite3 STATS_HASH=xxh STATS_KEY=${KEY_PVT1} |
|||
${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 |
|||
${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 |
|||
[Teardown] Generic Teardown |
|||
|
|||
Mmap Learn |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=mmap STATS_HASH=compat STATS_KEY=${KEY_PVT1} |
|||
${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 |
|||
[Teardown] Generic Teardown |
|||
|
|||
Mmap Relearn |
|||
[Setup] Statistics Setup @{ALIASES} STATS_BACKEND=mmap STATS_HASH=compat STATS_KEY=${KEY_PVT1} |
|||
${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 |
|||
${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 |
|||
[Teardown] Generic Teardown |
|||
@ -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_KEY} key = "${KEY_PVT1}"; |
|||
|
|||
*** Test Cases *** |
|||
Learn |
|||
Learn Test |
|||
|
|||
Relearn |
|||
Relearn Test |
|||
|
|||
Empty Part |
|||
Empty Part Test |
|||
@ -0,0 +1,18 @@ |
|||
*** Settings *** |
|||
Suite Setup Statistics Setup |
|||
Suite Teardown Statistics Teardown |
|||
Resource lib.robot |
|||
|
|||
*** Variables *** |
|||
${STATS_BACKEND} mmap |
|||
${STATS_HASH} hash = "compat"; |
|||
|
|||
*** Test Cases *** |
|||
Learn |
|||
Learn Test |
|||
|
|||
Relearn |
|||
Relearn Test |
|||
|
|||
Empty Part |
|||
Empty Part Test |
|||
@ -0,0 +1,59 @@ |
|||
*** 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} |
|||
Follow Rspamd Log |
|||
Should Not Contain ${result.stdout} success = true |
|||
Should Not Equal As Integers ${result.rc} 0 |
|||
|
|||
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 ${REDIS_PID} |
|||
|
|||
Statistics Setup |
|||
Generic Setup STATS_PATH_CACHE STATS_PATH_HAM STATS_PATH_SPAM |
|||
|
|||
Statistics Teardown |
|||
Generic Teardown |
|||
@ -0,0 +1,20 @@ |
|||
*** Settings *** |
|||
Suite Setup Redis Statistics Setup |
|||
Suite Teardown Redis Statistics Teardown |
|||
Resource lib.robot |
|||
|
|||
*** Variables *** |
|||
${REDIS_SERVER} servers = "${LOCAL_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 |
|||
@ -0,0 +1,20 @@ |
|||
*** Settings *** |
|||
Suite Setup Redis Statistics Setup |
|||
Suite Teardown Redis Statistics Teardown |
|||
Resource lib.robot |
|||
|
|||
*** Variables *** |
|||
${REDIS_SERVER} servers = "${LOCAL_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 |
|||
@ -0,0 +1,19 @@ |
|||
*** Settings *** |
|||
Suite Setup Redis Statistics Setup |
|||
Suite Teardown Redis Statistics Teardown |
|||
Resource lib.robot |
|||
|
|||
*** Variables *** |
|||
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}" |
|||
${STATS_BACKEND} redis |
|||
${STATS_HASH} hash = "siphash"; |
|||
|
|||
*** Test Cases *** |
|||
Learn |
|||
Learn Test |
|||
|
|||
Relearn |
|||
Relearn Test |
|||
|
|||
Empty Part |
|||
Empty Part Test |
|||
@ -0,0 +1,19 @@ |
|||
*** Settings *** |
|||
Suite Setup Redis Statistics Setup |
|||
Suite Teardown Redis Statistics Teardown |
|||
Resource lib.robot |
|||
|
|||
*** Variables *** |
|||
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}" |
|||
${STATS_BACKEND} redis |
|||
${STATS_HASH} hash = "xxhash"; |
|||
|
|||
*** Test Cases *** |
|||
Learn |
|||
Learn Test |
|||
|
|||
Relearn |
|||
Relearn Test |
|||
|
|||
Empty Part |
|||
Empty Part Test |
|||
@ -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 |
|||
@ -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 |
|||
@ -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 |
|||
@ -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 |
|||
@ -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 |
|||
@ -0,0 +1,74 @@ |
|||
options = { |
|||
filters = "fuzzy_check"; |
|||
pidfile = "${TMPDIR}/rspamd.pid" |
|||
control_socket = "${TMPDIR}/rspamd.sock mode=0600"; |
|||
} |
|||
logging = { |
|||
type = "file", |
|||
level = "debug" |
|||
filename = "${TMPDIR}/rspamd.log" |
|||
} |
|||
metric = { |
|||
name = "default", |
|||
actions = { |
|||
reject = 100500, |
|||
} |
|||
unknown_weight = 1 |
|||
symbol { |
|||
weight = 0.0; |
|||
name = "R_TEST_FUZZY_UNKNOWN"; |
|||
} |
|||
symbol { |
|||
weight = 10.0; |
|||
name = "${FLAG1_SYMBOL}"; |
|||
} |
|||
symbol { |
|||
weight = -1.0; |
|||
name = "${FLAG2_SYMBOL}"; |
|||
} |
|||
} |
|||
|
|||
worker { |
|||
type = normal |
|||
bind_socket = "${LOCAL_ADDR}:${PORT_NORMAL}"; |
|||
count = 1 |
|||
} |
|||
|
|||
worker { |
|||
type = controller |
|||
bind_socket = "${LOCAL_ADDR}:${PORT_CONTROLLER}"; |
|||
count = 1 |
|||
secure_ip = ["${LOCAL_ADDR}"]; |
|||
} |
|||
|
|||
worker { |
|||
bind_socket = "${LOCAL_ADDR}:${PORT_FUZZY}"; |
|||
type = "fuzzy"; |
|||
hashfile = "${TMPDIR}/fuzzy.db"; |
|||
allow_update = ["${LOCAL_ADDR}"]; |
|||
${SETTINGS_FUZZY_WORKER} |
|||
} |
|||
|
|||
fuzzy_check { |
|||
min_bytes = 100; |
|||
|
|||
rule { |
|||
servers = "${LOCAL_ADDR}:${PORT_FUZZY}"; |
|||
symbol = "R_TEST_FUZZY"; |
|||
max_score = 10.0; |
|||
mime_types = ["application/*"]; |
|||
read_only = false; |
|||
skip_unknown = true; |
|||
${SETTINGS_FUZZY_CHECK} |
|||
fuzzy_map = { |
|||
${FLAG1_SYMBOL} { |
|||
max_score = 10.0; |
|||
flag = ${FLAG1_NUMBER}; |
|||
} |
|||
${FLAG2_SYMBOL} { |
|||
max_score = 1.0; |
|||
flag = ${FLAG2_NUMBER}; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
bind ${LOCAL_ADDR} |
|||
daemonize yes |
|||
pidfile ${TMPDIR}/redis.pid |
|||
port ${REDIS_PORT} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue