*** Settings ***
Suite Setup New Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/trivial.conf
-${GTUBE} ${TESTDIR}/messages/gtube.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/trivial.conf
+${GTUBE} ${RSPAMD_TESTDIR}/messages/gtube.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
GTUBE
Expect Symbol GTUBE
GTUBE - Encrypted
- ${result} = Run Rspamc -p -h ${LOCAL_ADDR}:${PORT_NORMAL} --key ${KEY_PUB1}
+ ${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} --key ${RSPAMD_KEY_PUB1}
... ${GTUBE}
Check Rspamc ${result} GTUBE (
Expect Symbol GTUBE
GTUBE - SPAMC
- ${result} = Spamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE}
+ ${result} = Spamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${GTUBE}
Should Contain ${result} GTUBE
GTUBE - RSPAMC
- ${result} = Rspamc ${LOCAL_ADDR} ${PORT_NORMAL} ${GTUBE}
+ ${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${GTUBE}
Should Contain ${result} GTUBE
EMAILS DETECTION 1
- Scan File ${TESTDIR}/messages/emails1.eml URL-Format=Extended
+ Scan File ${RSPAMD_TESTDIR}/messages/emails1.eml URL-Format=Extended
Expect Email jim@example.net
Expect Email bob@example.net
Expect Email rupert@example.net
EMAILS DETECTION ZEROFONT
- Scan File ${TESTDIR}/messages/zerofont.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/zerofont.eml
Expect Symbol MANY_INVISIBLE_PARTS
Expect Symbol ZERO_FONT
*** Settings ***
Test Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MAP_MAP} ${TESTDIR}/configs/maps/map.list
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${RADIX_MAP} ${TESTDIR}/configs/maps/ip2.list
-${REGEXP_MAP} ${TESTDIR}/configs/maps/regexp.list
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MAP_MAP} ${RSPAMD_TESTDIR}/configs/maps/map.list
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RADIX_MAP} ${RSPAMD_TESTDIR}/configs/maps/ip2.list
+${REGEXP_MAP} ${RSPAMD_TESTDIR}/configs/maps/regexp.list
${RSPAMD_SCOPE} Test
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Flags
- [Setup] Lua Setup ${TESTDIR}/lua/flags.lua
+ [Setup] Lua Setup ${RSPAMD_TESTDIR}/lua/flags.lua
Scan File ${MESSAGE}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} stat
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} stat
Should Contain ${result.stdout} Messages scanned: 0
Dependencies
- [Setup] Lua Setup ${TESTDIR}/lua/deps.lua
+ [Setup] Lua Setup ${RSPAMD_TESTDIR}/lua/deps.lua
Scan File ${MESSAGE}
Expect Symbol DEP10
Pre and Post Filters
- [Setup] Lua Setup ${TESTDIR}/lua/prepostfilters.lua
+ [Setup] Lua Setup ${RSPAMD_TESTDIR}/lua/prepostfilters.lua
Scan File ${MESSAGE}
Expect Symbol TEST_PRE
Expect Symbol TEST_POST
Recipient Parsing Sanity
- [Setup] Lua Setup ${TESTDIR}/lua/recipients.lua
+ [Setup] Lua Setup ${RSPAMD_TESTDIR}/lua/recipients.lua
Scan File ${MESSAGE} Rcpt=rcpt1@foobar,rcpt2@foobar,rcpt3@foobar,rcpt4@foobar
Expect Symbol With Exact Options TEST_RCPT rcpt1@foobar,rcpt2@foobar,rcpt3@foobar,rcpt4@foobar
TLD parts
- [Setup] TLD Setup ${TESTDIR}/lua/tlds.lua
+ [Setup] TLD Setup ${RSPAMD_TESTDIR}/lua/tlds.lua
Scan File ${MESSAGE}
Expect Symbol With Exact Options TEST_TLD no worry
Hashes
- [Setup] Lua Setup ${TESTDIR}/lua/hashes.lua
+ [Setup] Lua Setup ${RSPAMD_TESTDIR}/lua/hashes.lua
Scan File ${MESSAGE}
Expect Symbol With Exact Options TEST_HASHES no worry
Maps Key Values
- [Setup] Lua Replace Setup ${TESTDIR}/lua/maps_kv.lua
+ [Setup] Lua Replace Setup ${RSPAMD_TESTDIR}/lua/maps_kv.lua
[Teardown] Lua Replace Teardown
Scan File ${MESSAGE}
Expect Symbol With Exact Options RADIX_KV no worry
Expect Symbol With Exact Options MAP_KV no worry
Option Order
- [Setup] Lua Replace Setup ${TESTDIR}/lua/option_order.lua
+ [Setup] Lua Replace Setup ${RSPAMD_TESTDIR}/lua/option_order.lua
[Teardown] Lua Replace Teardown
Scan File ${MESSAGE}
Expect Symbol With Exact Options OPTION_ORDER one two three 4 5 a
Expect Symbol With Exact Options TBL_OPTION_ORDER one two three 4 5 a
Rule conditions
- [Setup] Lua Replace Setup ${TESTDIR}/lua/conditions.lua
+ [Setup] Lua Replace Setup ${RSPAMD_TESTDIR}/lua/conditions.lua
[Teardown] Lua Replace Teardown
Scan File ${MESSAGE}
Expect Symbol With Option ANY_A hello3
*** Keywords ***
Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Test Variable ${LUA_SCRIPT}
- New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+ [Arguments] ${RSPAMD_LUA_SCRIPT}
+ Set Test Variable ${RSPAMD_LUA_SCRIPT}
+ New Setup
Lua Replace Setup
[Arguments] ${LUA_SCRIPT_UNESC}
- ${LUA_SCRIPT} = Make Temporary File
+ ${RSPAMD_LUA_SCRIPT} = Make Temporary File
${lua} = Get File ${LUA_SCRIPT_UNESC}
${lua} = Replace Variables ${lua}
- Create File ${LUA_SCRIPT} ${lua}
- Lua Setup ${LUA_SCRIPT}
+ Create File ${RSPAMD_LUA_SCRIPT} ${lua}
+ Lua Setup ${RSPAMD_LUA_SCRIPT}
Lua Replace Teardown
- Remove File ${LUA_SCRIPT}
+ Remove File ${RSPAMD_LUA_SCRIPT}
Normal Teardown
TLD Setup
- [Arguments] ${LUA_SCRIPT}
- Set Test Variable ${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
- Lua Setup ${LUA_SCRIPT}
+ [Arguments] ${RSPAMD_LUA_SCRIPT}
+ Set Test Variable ${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+ Lua Setup ${RSPAMD_LUA_SCRIPT}
*** Settings ***
Suite Setup Multimap Setup
Suite Teardown Multimap Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/multimap.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/multimap.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${UTF_MESSAGE} ${RSPAMD_TESTDIR}/messages/utf.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${RCVD1} ${TESTDIR}/messages/received1.eml
-${RCVD2} ${TESTDIR}/messages/received2.eml
-${RCVD3} ${TESTDIR}/messages/received3.eml
-${RCVD4} ${TESTDIR}/messages/received4.eml
-${URL1} ${TESTDIR}/messages/url1.eml
-${URL2} ${TESTDIR}/messages/url2.eml
-${URL3} ${TESTDIR}/messages/url3.eml
-${URL4} ${TESTDIR}/messages/url4.eml
-${URL5} ${TESTDIR}/messages/url5.eml
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${FREEMAIL_CC} ${TESTDIR}/messages/freemailcc.eml
-${URL_ICS} ${TESTDIR}/messages/ics.eml
+${RCVD1} ${RSPAMD_TESTDIR}/messages/received1.eml
+${RCVD2} ${RSPAMD_TESTDIR}/messages/received2.eml
+${RCVD3} ${RSPAMD_TESTDIR}/messages/received3.eml
+${RCVD4} ${RSPAMD_TESTDIR}/messages/received4.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${URL1} ${RSPAMD_TESTDIR}/messages/url1.eml
+${URL2} ${RSPAMD_TESTDIR}/messages/url2.eml
+${URL3} ${RSPAMD_TESTDIR}/messages/url3.eml
+${URL4} ${RSPAMD_TESTDIR}/messages/url4.eml
+${URL5} ${RSPAMD_TESTDIR}/messages/url5.eml
+${FREEMAIL_CC} ${RSPAMD_TESTDIR}/messages/freemailcc.eml
+${URL_ICS} ${RSPAMD_TESTDIR}/messages/ics.eml
*** Test Cases ***
URL_ICS
*** Keywords ***
Multimap Setup
Run Redis
- New Setup REDIS_ADDR=${REDIS_ADDR} REDIS_PORT=${REDIS_PORT} URL_TLD=${URL_TLD}
+ New Setup
Multimap Teardown
Normal Teardown
*** Settings ***
Test Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/password.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/password.conf
${CONTROLLER_ERRORS} False
${RSPAMD_SCOPE} Test
-${PBKDF_PASSWORD} "$1$rhzzahtm8a5homdhh7z4qiiy7j8pzp4u$k5toro136brshjjuy9t39r785td69qodmd39qzygxuyehn9tqauy"
-${CATENA_PASSWORD} "$2$xu1581gidj5cyp4yjgo68qbj6jz1j8o3$j9yg4k58jy3fj8suijxx9d7pea6a6obtufq9kfenosyq8erm87ky"
+${RSPAMD_PBKDF_PASSWORD} "$1$rhzzahtm8a5homdhh7z4qiiy7j8pzp4u$k5toro136brshjjuy9t39r785td69qodmd39qzygxuyehn9tqauy"
+${RSPAMD_CATENA_PASSWORD} "$2$xu1581gidj5cyp4yjgo68qbj6jz1j8o3$j9yg4k58jy3fj8suijxx9d7pea6a6obtufq9kfenosyq8erm87ky"
*** Test Cases ***
PASSWORD - PBKDF
- [Setup] Password Setup ${PBKDF_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P nq1 stat
+ [Setup] Password Setup ${RSPAMD_PBKDF_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat
Check Rspamc ${result} Messages scanned:
PASSWORD - PBKDF WRONG
- [Setup] Password Setup ${PBKDF_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q1q1 stat
+ [Setup] Password Setup ${RSPAMD_PBKDF_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q1q1 stat
Should Be Equal As Integers ${result.rc} 1
PASSWORD - CATENA
- [Setup] Password Setup ${CATENA_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P nq1 stat
+ [Setup] Password Setup ${RSPAMD_CATENA_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat
Check Rspamc ${result} Messages scanned:
PASSWORD - CATENA WRONG
- [Setup] Password Setup ${CATENA_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q stat
+ [Setup] Password Setup ${RSPAMD_CATENA_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q stat
Should Be Equal As Integers ${result.rc} 1
PASSWORD - ENABLE
- [Setup] Password Setup ${CATENA_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P nq2 stat_reset
+ [Setup] Password Setup ${RSPAMD_CATENA_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq2 stat_reset
Check Rspamc ${result} Messages scanned:
PASSWORD - ENABLE WITH NORMAL
- [Setup] Password Setup ${CATENA_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P nq1 stat_reset
+ [Setup] Password Setup ${RSPAMD_CATENA_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat_reset
Should Be Equal As Integers ${result.rc} 1
PASSWORD - ENABLE INCORRECT
- [Setup] Password Setup ${CATENA_PASSWORD}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q2q2 stat_reset
+ [Setup] Password Setup ${RSPAMD_CATENA_PASSWORD}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q2q2 stat_reset
Should Be Equal As Integers ${result.rc} 1
*** Keywords ***
Password Setup
- [Arguments] ${PASSWORD} ${ENABLE_PASSWORD}=nq2
- Set Test Variable ${PASSWORD}
- Set Test Variable ${ENABLE_PASSWORD}
- New Setup PASSWORD=${PASSWORD} ENABLE_PASSWORD=${ENABLE_PASSWORD}
+ [Arguments] ${RSPAMD_PASSWORD} ${RSPAMD_ENABLE_PASSWORD}=nq2
+ Set Test Variable ${RSPAMD_PASSWORD}
+ Set Test Variable ${RSPAMD_ENABLE_PASSWORD}
+ New Setup
*** Settings ***
Suite Setup GetFrom Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_script.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/get_from.lua
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_script.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/get_from.lua
${RSPAMD_SCOPE} Suite
${SYMBOL} GET_FROM
*** Test Cases ***
task:get_from('mime') - address only
- Scan File ${TESTDIR}/messages/from/from.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from.eml
Expect Symbol ${SYMBOL}
task:get_from('mime') - comment
- Scan File ${TESTDIR}/messages/from/from_comment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_comment.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS1}
task:get_from('mime') - display name
- Scan File ${TESTDIR}/messages/from/from_dn.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS2}
task:get_from('mime') - display name Base64
- Scan File ${TESTDIR}/messages/from/from_dn_base64.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn_base64.eml
Expect Symbol With Exact Options ${SYMBOL} Кириллица,user@example.org,user,example.org
task:get_from('mime') - display name and comment
- Scan File ${TESTDIR}/messages/from/from_dn_comment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_dn_comment.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS2}
task:get_from('mime') - quoted display name
- Scan File ${TESTDIR}/messages/from/from_quoted_dn.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
task:get_from('mime') - quoted display name and comment
- Scan File ${TESTDIR}/messages/from/from_quoted_dn_comment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_comment.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
task:get_from('mime') - quoted in the middle of DN (outer spaces)
- Scan File ${TESTDIR}/messages/from/from_quoted_dn_middle.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
task:get_from('mime') - quoted in the middle of DN (inner spaces)
- Scan File ${TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
Expect Symbol With Exact Options ${SYMBOL} ${OPTIONS3}
*** Keywords ***
GetFrom Setup
- New Setup LUA_SCRIPT=${LUA_SCRIPT}
+ New Setup
*** Settings ***
Suite Setup MIMETypes Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/mime_types.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/mime_types.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Zip
- Scan File ${TESTDIR}/messages/zip.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/zip.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION exe
Zip Double Bad Extension
- Scan File ${TESTDIR}/messages/zip-doublebad.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/zip-doublebad.eml
Expect Symbol With Exact Options MIME_DOUBLE_BAD_EXTENSION .pdf.exe
Next-to-last Double Bad Extension
- Scan File ${TESTDIR}/messages/next2last-doublebad.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/next2last-doublebad.eml
Expect Symbol With Exact Options MIME_DOUBLE_BAD_EXTENSION .scr.xz
Date is followed by Bad Extension
- Scan File ${TESTDIR}/messages/rar-date-bad-ext.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/rar-date-bad-ext.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION scr
Do Not Expect Symbol MIME_DOUBLE_BAD_EXTENSION
Dotted file name is followed by Bad Extension
- Scan File ${TESTDIR}/messages/bad_ext.dotted_file_name.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/bad_ext.dotted_file_name.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION exe
Do Not Expect Symbol MIME_DOUBLE_BAD_EXTENSION
Dotted numbers in parentheses is followed by Bad Extension
- Scan File ${TESTDIR}/messages/next2last-digits_in_parens.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/next2last-digits_in_parens.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION msi
Do Not Expect Symbol MIME_DOUBLE_BAD_EXTENSION
Dotted numbers in square brackets is followed by Bad Extension
- Scan File ${TESTDIR}/messages/next2last-digits_in_brackets.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/next2last-digits_in_brackets.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION msi
Do Not Expect Symbol MIME_DOUBLE_BAD_EXTENSION
Rar4
- Scan File ${TESTDIR}/messages/rar4.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/rar4.eml
Expect Symbol With Exact Options MIME_BAD_EXTENSION exe
Cloaked Archive Extension
- Scan File ${TESTDIR}/messages/f.zip.gz.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/f.zip.gz.eml
Expect Symbol With Exact Options MIME_ARCHIVE_IN_ARCHIVE .zip.gz zip
Multipart Archive Extension
- Scan File ${TESTDIR}/messages/f.zip.001.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/f.zip.001.eml
Do Not Expect Symbol MIME_ARCHIVE_IN_ARCHIVE
Exe file, but name in filename_whitelist
- Scan File ${TESTDIR}/messages/exe_attm.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/exe_attm.eml
Do Not Expect Symbol MIME_BAD_EXTENSION
Do Not Expect Symbol MIME_BAD_ATTACHMENT
Do Not Expect Symbol MIME_DOUBLE_BAD_EXTENSION
Empty text part should not be treat as html
- Scan File ${TESTDIR}/messages/empty-plain-text.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/empty-plain-text.eml
Do Not Expect Symbol FORGED_OUTLOOK_HTML
*** Keywords ***
MIMETypes Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/mid.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/mid.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
MID - invalid Message-ID
- Scan File ${TESTDIR}/messages/fws_fp.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/fws_fp.eml
Expect Symbol With Score INVALID_MSGID 1.70
Do Not Expect Symbol MISSING_MID
Do Not Expect Symbol INVALID_MSGID_ALLOWED
MID - invalid Message-ID allowed
- Scan File ${TESTDIR}/messages/invalid_mid_allowed.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/invalid_mid_allowed.eml
Expect Symbol With Score INVALID_MSGID_ALLOWED 1.00
Do Not Expect Symbol MISSING_MID
Do Not Expect Symbol INVALID_MSGID
MID - missing Message-ID
- Scan File ${TESTDIR}/messages/freemail.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/freemail.eml
Expect Symbol With Score MISSING_MID 2.50
Do Not Expect Symbol MISSING_MID_ALLOWED
Do Not Expect Symbol INVALID_MSGID
MID - missing Message-ID allowed
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
Expect Symbol With Score MISSING_MID_ALLOWED 1.00
Do Not Expect Symbol MISSING_MID
Do Not Expect Symbol INVALID_MSGID
*** Settings ***
Suite Setup Settings Setup
Suite Teardown Settings Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/settings.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/settings.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${MESSAGE_PRIORITY} ${TESTDIR}/messages/priority.eml
-${MESSAGE_7BIT} ${TESTDIR}/messages/utf.eml
-${MESSAGE_CUSTOM_HDR} ${TESTDIR}/messages/empty-plain-text.eml
-${MESSAGE_ABSENT_MIME} ${TESTDIR}/messages/ed25519.eml
-${SPAM_MESSAGE} ${TESTDIR}/messages/spam.eml
-${HAM_MESSAGE} ${TESTDIR}/messages/ham.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/settings.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/settings.lua
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${MESSAGE_PRIORITY} ${RSPAMD_TESTDIR}/messages/priority.eml
+${MESSAGE_7BIT} ${RSPAMD_TESTDIR}/messages/utf.eml
+${MESSAGE_CUSTOM_HDR} ${RSPAMD_TESTDIR}/messages/empty-plain-text.eml
+${MESSAGE_ABSENT_MIME} ${RSPAMD_TESTDIR}/messages/ed25519.eml
+${SPAM_MESSAGE} ${RSPAMD_TESTDIR}/messages/spam.eml
+${HAM_MESSAGE} ${RSPAMD_TESTDIR}/messages/ham.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
Check Everything Disabled
*** Keywords ***
Settings Setup
- Copy File ${TESTDIR}/data/bayes.spam.sqlite3 /tmp/bayes.spam.sqlite3
- Copy File ${TESTDIR}/data/bayes.ham.sqlite3 /tmp/bayes.ham.sqlite3
- New Setup LUA_SCRIPT=${LUA_SCRIPT}
+ Copy File ${RSPAMD_TESTDIR}/data/bayes.spam.sqlite3 /tmp/bayes.spam.sqlite3
+ Copy File ${RSPAMD_TESTDIR}/data/bayes.ham.sqlite3 /tmp/bayes.ham.sqlite3
+ New Setup
Settings Teardown
Normal Teardown
*** Settings ***
Suite Setup Composites Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/composites.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/composites.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/composites.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/composites.lua
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
*** Test Cases ***
*** Keywords ***
Composites Setup
- New Setup LUA_SCRIPT=${LUA_SCRIPT}
+ New Setup
*** Settings ***
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/stats.conf
-${MESSAGE_SPAM} ${TESTDIR}/messages/spam_message.eml
-${MESSAGE_HAM} ${TESTDIR}/messages/ham.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/stats.conf
+${MESSAGE_SPAM} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${MESSAGE_HAM} ${RSPAMD_TESTDIR}/messages/ham.eml
${REDIS_SCOPE} Suite
-${REDIS_SERVER} null
+${RSPAMD_REDIS_SERVER} null
${RSPAMD_SCOPE} Suite
-${STATS_BACKEND} redis
-${STATS_HASH} null
-${STATS_KEY} null
+${RSPAMD_STATS_BACKEND} redis
+${RSPAMD_STATS_HASH} null
+${RSPAMD_STATS_KEY} null
*** Keywords ***
Broken Learn Test
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM}
Check Rspamc ${result} Unknown statistics error
Empty Part Test
- Set Test Variable ${MESSAGE} ${TESTDIR}/messages/empty_part.eml
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE}
+ Set Test Variable ${MESSAGE} ${RSPAMD_TESTDIR}/messages/empty_part.eml
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_spam ${MESSAGE}
Check Rspamc ${result}
Scan File ${MESSAGE}
Expect Symbol BAYES_SPAM
Learn Test
Set Suite Variable ${RSPAMD_STATS_LEARNTEST} 0
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_ham ${MESSAGE_HAM}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_spam ${MESSAGE_SPAM}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_ham ${MESSAGE_HAM}
Check Rspamc ${result}
Scan File ${MESSAGE_SPAM}
Expect Symbol BAYES_SPAM
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_SPAM}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} learn_ham ${MESSAGE_SPAM}
Check Rspamc ${result}
Scan File ${MESSAGE_SPAM}
${pass} = Run Keyword And Return Status Expect Symbol BAYES_HAM
Redis Statistics Setup
Run Redis
- New Setup STATS_BACKEND=${STATS_BACKEND} STATS_HASH=${STATS_HASH} STATS_KEY=${STATS_KEY} REDIS_SERVER=${REDIS_SERVER}
+ New Setup
Redis Statistics Teardown
Normal Teardown
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
-${STATS_HASH} siphash
-${STATS_KEY} ${KEY_PVT1}
+${RSPAMD_REDIS_SERVER} ${RSPAMD_REDIS_ADDR}:${RSPAMD_REDIS_PORT}
+${RSPAMD_STATS_HASH} siphash
+${RSPAMD_STATS_KEY} ${RSPAMD_KEY_PVT1}
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
-${STATS_HASH} xxhash
-${STATS_KEY} ${KEY_PVT1}
+${RSPAMD_REDIS_SERVER} ${RSPAMD_REDIS_ADDR}:${RSPAMD_REDIS_PORT}
+${RSPAMD_STATS_HASH} xxhash
+${RSPAMD_STATS_KEY} ${RSPAMD_KEY_PVT1}
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
-${STATS_HASH} siphash
+${RSPAMD_REDIS_SERVER} ${RSPAMD_REDIS_ADDR}:${RSPAMD_REDIS_PORT}
+${RSPAMD_STATS_HASH} siphash
*** Test Cases ***
Learn
Resource lib.robot
*** Variables ***
-${REDIS_SERVER} ${REDIS_ADDR}:${REDIS_PORT}
-${STATS_HASH} xxhash
+${RSPAMD_REDIS_SERVER} ${RSPAMD_REDIS_ADDR}:${RSPAMD_REDIS_PORT}
+${RSPAMD_STATS_HASH} xxhash
*** Test Cases ***
Learn
*** Settings ***
Suite Setup Phishing Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/phishing.conf
-${MESSAGE1} ${TESTDIR}/messages/phishing1.eml
-${MESSAGE2} ${TESTDIR}/messages/phishing2.eml
-${MESSAGE3} ${TESTDIR}/messages/phishing3.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/phishing.conf
+${MESSAGE1} ${RSPAMD_TESTDIR}/messages/phishing1.eml
+${MESSAGE2} ${RSPAMD_TESTDIR}/messages/phishing2.eml
+${MESSAGE3} ${RSPAMD_TESTDIR}/messages/phishing3.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
TEST PHISHING
*** Keywords ***
Phishing Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
*** Settings ***
Suite Setup DMARC Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dmarc.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
DMARC NONE PASS DKIM
- Scan File ${TESTDIR}/messages/dmarc/pass_none.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/pass_none.eml
Expect Symbol DMARC_POLICY_ALLOW
DMARC NONE PASS SPF
- Scan File ${TESTDIR}/messages/dmarc/fail_none.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
... IP=8.8.4.4 From=foo@spf.cacophony.za.org
Expect Symbol DMARC_POLICY_ALLOW
DMARC NONE FAIL
- Scan File ${TESTDIR}/messages/dmarc/fail_none.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
Expect Symbol DMARC_POLICY_SOFTFAIL
DMARC REJECT FAIL
- Scan File ${TESTDIR}/messages/dmarc/fail_reject.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/fail_reject.eml
Expect Symbol DMARC_POLICY_REJECT
DMARC QUARANTINE FAIL
- Scan File ${TESTDIR}/messages/dmarc/fail_quarantine.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/fail_quarantine.eml
Expect Symbol DMARC_POLICY_QUARANTINE
DMARC SP NONE FAIL
- Scan File ${TESTDIR}/messages/dmarc/subdomain_fail_none.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/subdomain_fail_none.eml
Expect Symbol DMARC_POLICY_SOFTFAIL
DMARC SP REJECT FAIL
- Scan File ${TESTDIR}/messages/dmarc/subdomain_fail_reject.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/subdomain_fail_reject.eml
Expect Symbol DMARC_POLICY_REJECT
DMARC SP QUARANTINE FAIL
- Scan File ${TESTDIR}/messages/dmarc/subdomain_fail_quarantine.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/subdomain_fail_quarantine.eml
Expect Symbol DMARC_POLICY_QUARANTINE
DMARC SUBDOMAIN FAIL DKIM STRICT ALIGNMENT
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
Expect Symbol DMARC_POLICY_REJECT
DMARC SUBDOMAIN PASS DKIM RELAXED ALIGNMENT
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_pass_relaxed.eml
Expect Symbol DMARC_POLICY_ALLOW
DMARC SUBDOMAIN PASS SPF STRICT ALIGNMENT
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
... IP=37.48.67.26 From=foo@yo.mom.za.org
Expect Symbol DMARC_POLICY_ALLOW
DMARC SUBDOMAIN FAIL SPF STRICT ALIGNMENT
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_fail_alignment.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_POLICY_REJECT
DMARC SUBDOMAIN PASS SPF RELAXED ALIGNMENT
- Scan File ${TESTDIR}/messages/dmarc/onsubdomain_fail.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/onsubdomain_fail.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_POLICY_ALLOW
DMARC DNSFAIL
- Scan File ${TESTDIR}/messages/dmarc/dmarc_tmpfail.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/dmarc_tmpfail.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_DNSFAIL
DMARC NA NXDOMAIN
- Scan File ${TESTDIR}/messages/utf.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/utf.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_NA
DMARC PCT ZERO REJECT
- Scan File ${TESTDIR}/messages/dmarc/pct_none.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/pct_none.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_POLICY_QUARANTINE
DMARC PCT ZERO SP QUARANTINE
- Scan File ${TESTDIR}/messages/dmarc/pct_none1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/pct_none1.eml
... IP=37.48.67.26 From=foo@mom.za.org
Expect Symbol DMARC_POLICY_SOFTFAIL
*** Keywords ***
DMARC Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
*** Settings ***
Suite Setup DKIM Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
DKIM PERMFAIL NXDOMAIN
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim2.eml
... IP=37.48.67.26
Expect Symbol R_DKIM_PERMFAIL
DKIM PERMFAIL BAD RECORD
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=37.48.67.26
Expect Symbol R_DKIM_PERMFAIL
DKIM TEMPFAIL SERVFAIL UNALIGNED
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim3.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim3.eml
... IP=37.48.67.26
Expect Symbol R_DKIM_TEMPFAIL
DKIM NA NOSIG
- Scan File ${TESTDIR}/messages/utf.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/utf.eml
... IP=37.48.67.26
Expect Symbol R_DKIM_NA
DKIM Sign
Set Suite Variable ${RAN_SIGNTEST} 0
- ${result} = Scan Message With Rspamc ${TESTDIR}/messages/spam_message.eml --mime --header=dodkim=1
+ ${result} = Scan Message With Rspamc ${RSPAMD_TESTDIR}/messages/spam_message.eml --mime --header=dodkim=1
Check Rspamc ${result} DKIM-Signature
- Set Suite Variable ${SIGNED_MESSAGE} ${TMPDIR}/dkim_sign_test.eml
+ Set Suite Variable ${SIGNED_MESSAGE} ${RSPAMD_TMPDIR}/dkim_sign_test.eml
Create File ${SIGNED_MESSAGE} ${result.stdout}
Set Suite Variable ${RAN_SIGNTEST} 1
Expect Symbol R_DKIM_ALLOW
DKIM Verify ED25519 PASS
- Scan File ${TESTDIR}/messages/ed25519.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/ed25519.eml
Expect Symbol R_DKIM_ALLOW
DKIM Verify ED25519 REJECT
- Scan File ${TESTDIR}/messages/ed25519-broken.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/ed25519-broken.eml
Expect Symbol R_DKIM_REJECT
*** Keywords ***
*** Settings ***
Suite Setup SPF Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dmarc.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dmarc.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
SPF FAIL UNRESOLVEABLE INCLUDE
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=37.48.67.26 From=x@fail3.org.org.za
Expect Symbol R_SPF_FAIL
SPF DNSFAIL FAILED INCLUDE UNALIGNED
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail2.org.org.za
Expect Symbol R_SPF_DNSFAIL
Expect Symbol DMARC_POLICY_SOFTFAIL
SPF ALLOW UNRESOLVEABLE INCLUDE
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail3.org.org.za
Expect Symbol R_SPF_ALLOW
SPF ALLOW FAILED INCLUDE
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.4.4 From=x@fail2.org.org.za
Expect Symbol R_SPF_ALLOW
SPF NA NA
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@za
Expect Symbol R_SPF_NA
SPF NA NOREC
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@co.za
Expect Symbol R_SPF_NA
SPF NA NXDOMAIN
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@zzzzaaaa
Expect Symbol R_SPF_NA
SPF PERMFAIL UNRESOLVEABLE REDIRECT
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail4.org.org.za
Expect Symbol R_SPF_PERMFAIL
SPF REDIRECT NO USEABLE ELEMENTS
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail10.org.org.za
Expect Symbol R_SPF_PERMFAIL
SPF DNSFAIL FAILED REDIRECT
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail1.org.org.za
Expect Symbol R_SPF_DNSFAIL
SPF PERMFAIL NO USEABLE ELEMENTS
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail5.org.org.za
Expect Symbol R_SPF_PERMFAIL
SPF FAIL
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@example.net
Expect Symbol R_SPF_FAIL
SPF FAIL UNRESOLVEABLE MX
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=1.2.3.4 From=x@fail6.org.org.za
Expect Symbol R_SPF_FAIL
SPF FAIL UNRESOLVEABLE A
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=1.2.3.4 From=x@fail7.org.org.za
Expect Symbol R_SPF_FAIL
SPF DNSFAIL FAILED A
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=1.2.3.4 From=x@fail8.org.org.za
Expect Symbol R_SPF_DNSFAIL
SPF DNSFAIL FAILED MX
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=1.2.3.4 From=x@fail9.org.org.za
Expect Symbol R_SPF_DNSFAIL
SPF DNSFAIL FAILED RECORD
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=1.2.3.4 From=x@www.dnssec-failed.org
Expect Symbol R_SPF_DNSFAIL
SPF PASS INCLUDE
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@pass1.org.org.za
Expect Symbol R_SPF_ALLOW
#Expect Symbol R_SPF_ALLOW
SPF PERMFAIL REDIRECT WITHOUT SPF
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim4.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim4.eml
... IP=192.0.2.1 From=a@fail1.org.org.za
Expect Symbol R_SPF_DNSFAIL
SPF EXTERNAL RELAY
- Scan File ${TESTDIR}/messages/external_relay.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/external_relay.eml
Expect Symbol With Score And Exact Options R_SPF_ALLOW 1.0 +ip4:37.48.67.26
SPF UPPERCASE
- Scan File ${TESTDIR}/messages/dmarc/bad_dkim1.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim1.eml
... IP=8.8.8.8 From=x@fail11.org.org.za
Expect Symbol R_SPF_ALLOW
*** Keywords ***
SPF Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
*** Settings ***
Library OperatingSystem
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
${ALGORITHM} ${EMPTY}
-${CONFIG} ${TESTDIR}/configs/fuzzy.conf
-${FLAG1_NUMBER} 50
+${CONFIG} ${RSPAMD_TESTDIR}/configs/fuzzy.conf
+${RSPAMD_FLAG1_NUMBER} 50
${FLAG1_SYMBOL} R_TEST_FUZZY_DENIED
-${FLAG2_NUMBER} 51
+${RSPAMD_FLAG2_NUMBER} 51
${FLAG2_SYMBOL} R_TEST_FUZZY_WHITE
-${FUZZY_ENCRYPTED_ONLY} false
-${FUZZY_ENCRYPTION_KEY} null
-${FUZZY_KEY} null
-${FUZZY_INCLUDE} ${TESTDIR}/configs/empty.conf
-${FUZZY_SHINGLES_KEY} null
-@{MESSAGES} ${TESTDIR}/messages/spam_message.eml ${TESTDIR}/messages/zip.eml
-@{MESSAGES_SKIP} ${TESTDIR}/messages/priority.eml
-@{RANDOM_MESSAGES} ${TESTDIR}/messages/bad_message.eml ${TESTDIR}/messages/zip-doublebad.eml
+${RSPAMD_FUZZY_BACKEND} redis
+${RSPAMD_FUZZY_ENCRYPTED_ONLY} false
+${RSPAMD_FUZZY_ENCRYPTION_KEY} null
+${RSPAMD_FUZZY_KEY} null
+${RSPAMD_FUZZY_INCLUDE} ${RSPAMD_TESTDIR}/configs/empty.conf
+${RSPAMD_FUZZY_SHINGLES_KEY} null
+@{MESSAGES} ${RSPAMD_TESTDIR}/messages/spam_message.eml ${RSPAMD_TESTDIR}/messages/zip.eml
+@{MESSAGES_SKIP} ${RSPAMD_TESTDIR}/messages/priority.eml
+@{RANDOM_MESSAGES} ${RSPAMD_TESTDIR}/messages/bad_message.eml ${RSPAMD_TESTDIR}/messages/zip-doublebad.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
${SETTINGS_FUZZY_WORKER} ${EMPTY}
Fuzzy Skip Add Test Base
[Arguments] ${message}
Set Suite Variable ${RSPAMD_FUZZY_ADD_${message}} 0
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 -f
- ... ${FLAG1_NUMBER} fuzzy_add ${message}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -w 10 -f
+ ... ${RSPAMD_FLAG1_NUMBER} fuzzy_add ${message}
Check Rspamc ${result}
Sync Fuzzy Storage
Scan File ${message}
Expect Symbol R_TEST_FUZZY_DENIED
- Create File ${TMPDIR}/skip_hash.map.tmp 2d875d4737c59c4822fd01dadeba52a329de3933f766c6f167904c6a426bbfa7ea63a66bf807b25c5ee853baee58bfb18d3b423fcd13cfa7c3d77a840039a1ea
- Move File ${TMPDIR}/skip_hash.map.tmp ${TMPDIR}/skip_hash.map
+ Create File ${RSPAMD_TMPDIR}/skip_hash.map.tmp 2d875d4737c59c4822fd01dadeba52a329de3933f766c6f167904c6a426bbfa7ea63a66bf807b25c5ee853baee58bfb18d3b423fcd13cfa7c3d77a840039a1ea
+ Move File ${RSPAMD_TMPDIR}/skip_hash.map.tmp ${RSPAMD_TMPDIR}/skip_hash.map
Sleep 1s Wait for reload
Scan File ${message}
Do Not Expect Symbol R_TEST_FUZZY_DENIED
Fuzzy Add Test
[Arguments] ${message}
Set Suite Variable ${RSPAMD_FUZZY_ADD_${message}} 0
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10 -f
- ... ${FLAG1_NUMBER} fuzzy_add ${message}
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -w 10 -f
+ ... ${RSPAMD_FLAG1_NUMBER} fuzzy_add ${message}
Check Rspamc ${result}
Sync Fuzzy Storage
Scan File ${message}
Fuzzy Delete Test
[Arguments] ${message}
Run Keyword If ${RSPAMD_FUZZY_ADD_${message}} == 0 Fail "Fuzzy Add was not run"
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -f ${FLAG1_NUMBER} fuzzy_del
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -f ${RSPAMD_FLAG1_NUMBER} fuzzy_del
... ${message}
Check Rspamc ${result}
Sync Fuzzy Storage
Fuzzy Overwrite Test
[Arguments] ${message}
- ${flag_numbers} = Create List ${FLAG1_NUMBER} ${FLAG2_NUMBER}
+ ${flag_numbers} = Create List ${RSPAMD_FLAG1_NUMBER} ${RSPAMD_FLAG2_NUMBER}
FOR ${i} IN @{flag_numbers}
- ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10
+ ${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -w 10
... -f ${i} fuzzy_add ${message}
Check Rspamc ${result}
END
Fuzzy Setup Encrypted
[Arguments] ${algorithm}
- Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
- Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
- Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
- Set Suite Variable ${FUZZY_INCLUDE} ${TESTDIR}/configs/fuzzy-encryption-key.conf
+ Set Suite Variable ${RSPAMD_FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} ${RSPAMD_KEY_PUB1}
+ Set Suite Variable ${RSPAMD_FUZZY_INCLUDE} ${RSPAMD_TESTDIR}/configs/fuzzy-encryption-key.conf
Fuzzy Setup Generic
Fuzzy Setup Encrypted Keyed
[Arguments] ${algorithm}
- Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
- Set Suite Variable ${FUZZY_ENCRYPTED_ONLY} true
- Set Suite Variable ${FUZZY_ENCRYPTION_KEY} ${KEY_PUB1}
+ Set Suite Variable ${RSPAMD_FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTED_ONLY} true
+ Set Suite Variable ${RSPAMD_FUZZY_ENCRYPTION_KEY} ${RSPAMD_KEY_PUB1}
- Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
- Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Set Suite Variable ${RSPAMD_FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${RSPAMD_FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
Fuzzy Setup Generic
Fuzzy Setup Plain
[Arguments] ${algorithm}
- Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${RSPAMD_FUZZY_ALGORITHM} ${algorithm}
Fuzzy Setup Generic
Fuzzy Setup Keyed
[Arguments] ${algorithm}
- Set Suite Variable ${FUZZY_ALGORITHM} ${algorithm}
- Set Suite Variable ${FUZZY_KEY} mYN888sydwLTfE32g2hN
- Set Suite Variable ${FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
+ Set Suite Variable ${RSPAMD_FUZZY_ALGORITHM} ${algorithm}
+ Set Suite Variable ${RSPAMD_FUZZY_KEY} mYN888sydwLTfE32g2hN
+ Set Suite Variable ${RSPAMD_FUZZY_SHINGLES_KEY} hXUCgul9yYY3Zlk1QIT2
Fuzzy Setup Generic
Fuzzy Setup Generic
Run Redis
- Generic Setup FUZZY_ALGORITHM=${FUZZY_ALGORITHM} FUZZY_ENCRYPTED_ONLY=${FUZZY_ENCRYPTED_ONLY}
- ... FUZZY_KEY=${FUZZY_KEY} FUZZY_SHINGLES_KEY=${FUZZY_SHINGLES_KEY}
- ... FUZZY_ENCRYPTION_KEY=${FUZZY_ENCRYPTION_KEY} FLAG1_NUMBER=${FLAG1_NUMBER}
- ... FLAG2_NUMBER=${FLAG2_NUMBER} FUZZY_BACKEND=redis PORT_FUZZY=${PORT_FUZZY}
- ... FUZZY_INCLUDE=${FUZZY_INCLUDE}
+ New Setup
Fuzzy Setup Plain Fasthash
Fuzzy Setup Plain fasthash
*** Settings ***
Suite Setup JSON Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Resource lib.robot
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/preresult.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/preresult.lua
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
*** Test Cases ***
*** Settings ***
Suite Setup JSON Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Resource lib.robot
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/simple.lua
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
*** Test Cases ***
*** Variables ***
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Keywords ***
JSON Setup
- New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+ New Setup
Stat Test
- @{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /stat
+ @{result} = HTTP GET ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_CONTROLLER} /stat
Check JSON ${result}[1]
Should Be Equal As Integers ${result}[0] 200
[Arguments] ${rspamc_expected_result}
${result} = Scan Message With Rspamc ${MESSAGE}
Check Rspamc ${result} ${rspamc_expected_result}
- @{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /history
+ @{result} = HTTP GET ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_CONTROLLER} /history
Check JSON ${result}[1]
Should Be Equal As Integers ${result}[0] 200
Scan Test
${content} = Get File ${MESSAGE}
- @{result} = HTTP POST ${LOCAL_ADDR} ${PORT_NORMAL} /check ${content}
+ @{result} = HTTP POST ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} /check ${content}
Check JSON ${result}[1]
Should Be Equal As Integers ${result}[0] 200
*** Settings ***
Suite Setup Whitelist Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/whitelist.conf
-${M_DMARC_OK} ${TESTDIR}/messages/dmarc/pass_none.eml
-${M_DMARC_BAD} ${TESTDIR}/messages/dmarc/fail_none.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/whitelist.conf
+${M_DMARC_OK} ${RSPAMD_TESTDIR}/messages/dmarc/pass_none.eml
+${M_DMARC_BAD} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
-${M_DKIM_RSPAMD_OK} ${TESTDIR}/messages/dmarc/good_dkim_rspamd.eml
-${M_DKIM_RSPAMD_BAD} ${TESTDIR}/messages/dmarc/bad_dkim_rspamd.eml
-${M_NO_DKIM_VALID_SPF} ${TESTDIR}/messages/dmarc/no_dkim_valid_spf.eml
+${M_DKIM_RSPAMD_OK} ${RSPAMD_TESTDIR}/messages/dmarc/good_dkim_rspamd.eml
+${M_DKIM_RSPAMD_BAD} ${RSPAMD_TESTDIR}/messages/dmarc/bad_dkim_rspamd.eml
+${M_NO_DKIM_VALID_SPF} ${RSPAMD_TESTDIR}/messages/dmarc/no_dkim_valid_spf.eml
-${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
+${UTF_MESSAGE} ${RSPAMD_TESTDIR}/messages/utf.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
WHITELISTS
*** Settings ***
Suite Setup Map Reload Setup
Suite Teardown Map Reload Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
${MAP_WATCH_INTERVAL} 0.5s
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
CHECK HIT AND MISS
WRITE NEW MAP
${TMP_FILE} = Make Temporary File
- Copy File ${TESTDIR}/configs/maps/domains.list.2 ${TMP_FILE}
+ Copy File ${RSPAMD_TESTDIR}/configs/maps/domains.list.2 ${TMP_FILE}
Move File ${TMP_FILE} ${MAP_FILE}
CHECK HIT AND MISS AFTER RELOAD
*** Keywords ***
Map Reload Setup
- ${MAP1} = Get File ${TESTDIR}/configs/maps/domains.list
+ ${MAP1} = Get File ${RSPAMD_TESTDIR}/configs/maps/domains.list
${MAP_FILE} = Make Temporary File
- ${LUA_SCRIPT} = Make Temporary File
- Set Suite Variable ${LUA_SCRIPT}
+ ${RSPAMD_LUA_SCRIPT} = Make Temporary File
+ Set Suite Variable ${RSPAMD_LUA_SCRIPT}
Set Suite Variable ${MAP_FILE}
Set Suite Variable ${MAP1}
- ${lua} = Get File ${TESTDIR}/lua/mapreload.lua
+ ${lua} = Get File ${RSPAMD_TESTDIR}/lua/mapreload.lua
${lua} = Replace Variables ${lua}
- Create File ${LUA_SCRIPT} ${lua}
+ Create File ${RSPAMD_LUA_SCRIPT} ${lua}
Create File ${MAP_FILE} ${MAP1}
- New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+ New Setup
Map Reload Teardown
Remove File ${MAP_FILE}
- Remove File ${LUA_SCRIPT}
+ Remove File ${RSPAMD_LUA_SCRIPT}
Normal Teardown
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/simple.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
-${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/simple.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
+${MESSAGE_FAIL} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
*** Settings ***
Suite Setup DKIM Signing Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/redis.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/redis.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
DKIM Signing Setup
Run Redis
Redis HSET TEST_DKIM_SELECTORS cacophony.za.org dkim
- ${key} = Get File ${TESTDIR}/configs/dkim.key
+ ${key} = Get File ${RSPAMD_TESTDIR}/configs/dkim.key
Redis HSET TEST_DKIM_KEYS dkim.cacophony.za.org ${key}
New Setup
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/eddsa.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
-${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/eddsa.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
+${MESSAGE_FAIL} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
Force Tags isbroken
Suite Setup Key Invalidation Setup
Suite Teardown Key Invalidation Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/invalidate.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/invalidate.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
*** Keywords ***
Key Invalidation Setup
${key_dir} Make Temporary Directory
- Set Suite Variable ${KEY_DIR} ${key_dir}
- Copy File ${TESTDIR}/configs/dkim-eddsa.key ${KEY_DIR}/dkim-eddsa.key
+ Set Suite Variable ${RSPAMD_KEY_DIR} ${key_dir}
+ Copy File ${RSPAMD_TESTDIR}/configs/dkim-eddsa.key ${RSPAMD_KEY_DIR}/dkim-eddsa.key
New Setup
Delete Key
- Remove File ${KEY_DIR}/dkim-eddsa.key
+ Remove File ${RSPAMD_KEY_DIR}/dkim-eddsa.key
Move Key
- Copy File ${TESTDIR}/configs/dkim.key ${KEY_DIR}/dkim-eddsa.key
- Set Modified Time ${KEY_DIR}/dkim-eddsa.key NOW + 3s
+ Copy File ${RSPAMD_TESTDIR}/configs/dkim.key ${RSPAMD_KEY_DIR}/dkim-eddsa.key
+ Set Modified Time ${RSPAMD_KEY_DIR}/dkim-eddsa.key NOW + 3s
Key Invalidation Teardown
- Cleanup Temporary Directory ${KEY_DIR}
+ Cleanup Temporary Directory ${RSPAMD_KEY_DIR}
Normal Teardown
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/multiple.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
-${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/multiple.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
+${MESSAGE_FAIL} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST DOUBLE SIGNED
Suite Setup New Setup
Suite Teardown Generic Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/milter.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/milter.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
SINGLE SIGNATURE
*** Keywords ***
Milter Test
[Arguments] ${mtlua}
- ${result} = Run Process miltertest -Dport\=${PORT_PROXY} -Dhost\=${LOCAL_ADDR} -s ${TESTDIR}/lua/miltertest/${mtlua}
- ... cwd=${TESTDIR}/lua/miltertest
+ ${result} = Run Process miltertest -Dport\=${RSPAMD_PORT_PROXY} -Dhost\=${RSPAMD_LOCAL_ADDR} -s ${RSPAMD_TESTDIR}/lua/miltertest/${mtlua}
+ ... cwd=${RSPAMD_TESTDIR}/lua/miltertest
Should Match Regexp ${result.stderr} ^$
Log ${result.rc}
Log ${result.stdout}
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/dkim_signing/sign_maps.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
-${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/dkim_signing/sign_maps.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
+${MESSAGE_FAIL} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
*** Settings ***
Suite Setup New Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/spamassassin.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/spamassassin.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
FREEMAIL
- Scan File ${TESTDIR}/messages/freemail.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/freemail.eml
... From=faked.asdfjisiwosp372@outlook.com
Expect Symbol FREEMAIL_FROM
Expect Symbol FREEMAIL_ENVFROM_END_DIGIT
Expect Symbol TEST_META4
WLBL WHITELIST
- Scan File ${TESTDIR}/messages/bad_message.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/bad_message.eml
Expect Symbol USER_IN_WHITELIST
Expect Symbol USER_IN_WHITELIST_TO
Do Not Expect Symbol USER_IN_BLACKLIST_TO
Do Not Expect Symbol USER_IN_BLACKLIST
WLBL BLACKLIST
- Scan File ${TESTDIR}/messages/utf.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/utf.eml
Expect Symbol USER_IN_BLACKLIST
Expect Symbol USER_IN_BLACKLIST_TO
Do Not Expect Symbol USER_IN_WHITELIST_TO
*** Settings ***
Suite Setup Proxy Setup
Suite Teardown Proxy Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/simple.lua
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
HTTP PROTOCOL
- Set Test Variable ${PORT_NORMAL} ${PORT_PROXY}
+ Set Test Variable ${RSPAMD_PORT_NORMAL} ${RSPAMD_PORT_PROXY}
Scan File ${MESSAGE}
Expect Symbol SIMPLE_TEST
SPAMC
- ${result} = Spamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
+ ${result} = Spamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_PROXY} ${MESSAGE}
Should Contain ${result} SPAMD/1.1 0 EX_OK
RSPAMC Legacy Protocol
- ${result} = Rspamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
+ ${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_PROXY} ${MESSAGE}
Should Contain ${result} RSPAMD/1.3 0 EX_OK
*** Keywords ***
Proxy Setup
# Run slave & copy variables
- Set Suite Variable ${CONFIG} ${TESTDIR}/configs/lua_test.conf
- New Setup LUA_SCRIPT=${LUA_SCRIPT} URL_TLD=${URL_TLD}
+ Set Suite Variable ${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+ New Setup
Set Suite Variable ${SLAVE_PID} ${RSPAMD_PID}
- Set Suite Variable ${SLAVE_TMPDIR} ${TMPDIR}
+ Set Suite Variable ${SLAVE_TMPDIR} ${RSPAMD_TMPDIR}
# Run proxy & copy variables
- Set Suite Variable ${CONFIG} ${TESTDIR}/configs/proxy.conf
+ Set Suite Variable ${CONFIG} ${RSPAMD_TESTDIR}/configs/proxy.conf
New Setup
Set Suite Variable ${PROXY_PID} ${RSPAMD_PID}
- Set Suite Variable ${PROXY_TMPDIR} ${TMPDIR}
+ Set Suite Variable ${PROXY_TMPDIR} ${RSPAMD_TMPDIR}
Proxy Teardown
# Restore variables & run normal teardown
Set Suite Variable ${RSPAMD_PID} ${PROXY_PID}
- Set Suite Variable ${TMPDIR} ${PROXY_TMPDIR}
+ Set Suite Variable ${RSPAMD_TMPDIR} ${PROXY_TMPDIR}
Normal Teardown
# Do it again for slave
Set Suite Variable ${RSPAMD_PID} ${SLAVE_PID}
- Set Suite Variable ${TMPDIR} ${SLAVE_TMPDIR}
+ Set Suite Variable ${RSPAMD_TMPDIR} ${SLAVE_TMPDIR}
Normal Teardown
Process message callback
${handle} = Start Process ${RSPAMADM} lua
- ${result} = Write to stdin ${handle} .load ${TESTDIR}/lua/rspamadm/test_message_callback.lua\n.message message_callback ${TESTDIR}/messages/empty_part.eml
+ ${result} = Write to stdin ${handle} .load ${RSPAMD_TESTDIR}/lua/rspamadm/test_message_callback.lua\n.message message_callback ${RSPAMD_TESTDIR}/messages/empty_part.eml
Should Contain ${result} n parts = 2
Should Contain ${result} 1\n2\n4\n6
Lua batch mode
- ${result} = Run Process ${RSPAMADM} lua -b ${TESTDIR}/lua/rspamadm/test_batch.lua
+ ${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_batch.lua
Should Match Regexp ${result.stderr} ^$
Should Be Equal As Integers ${result.rc} 0
Should Be Equal ${result.stdout} hello world
Test Setup Rspamadm test Setup
Test Teardown Rspamadm test Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
Suite Teardown Terminate All Processes kill=True
*** Variables ***
${REDIS_SCOPE} Test
-${CONFIG} ${TESTDIR}/configs/plugins.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/plugins.conf
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
${PLUGIN_CONFIG}
*** Test Cases ***
Tcp client
- ${result} = Run Process ${RSPAMADM} lua -b ${TESTDIR}/lua/rspamadm/test_tcp_client.lua
+ ${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_tcp_client.lua
Should Match Regexp ${result.stderr} ^$
Should Be Equal As Integers ${result.rc} 0
Should Be Equal ${result.stdout} hello post
Redis client
- ${result} = Run Process ${RSPAMADM} lua -b ${TESTDIR}/lua/rspamadm/test_redis_client.lua
+ ${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_redis_client.lua
Should Match Regexp ${result.stderr} ^$
Should Be Equal As Integers ${result.rc} 0
Should Be Equal ${result.stdout} true\thello from lua on redis
DNS client
${tmpdir} = Prepare temp directory ${CONFIG}
Set test variable ${tmpdir}
- ${result} = Run Process ${RSPAMADM} --var\=CONFDIR\=${tmpdir} lua -b ${TESTDIR}/lua/rspamadm/test_dns_client.lua
+ ${result} = Run Process ${RSPAMADM} --var\=CONFDIR\=${tmpdir} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_dns_client.lua
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Rspamadm test Setup
${tmpdir} = Make Temporary Directory
- Set Suite Variable ${TMPDIR} ${tmpdir}
+ Set Suite Variable ${RSPAMD_TMPDIR} ${tmpdir}
Run Dummy Http
Run Redis
Run Dummy Http
[Arguments]
- ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
Wait Until Created /tmp/dummy_http.pid
Prepare temp directory
Suite Setup Antivirus Setup
Suite Teardown Antivirus Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/antivirus.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${MESSAGE2} ${TESTDIR}/messages/freemail.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/antivirus.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${MESSAGE2} ${RSPAMD_TESTDIR}/messages/freemail.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
CLAMAV MISS
- Run Dummy Clam ${PORT_CLAM}
+ Run Dummy Clam ${RSPAMD_PORT_CLAM}
Scan File ${MESSAGE}
Do Not Expect Symbol CLAM_VIRUS
Shutdown clamav
CLAMAV HIT
- Run Dummy Clam ${PORT_CLAM} 1
+ Run Dummy Clam ${RSPAMD_PORT_CLAM} 1
Scan File ${MESSAGE2}
Expect Symbol CLAM_VIRUS
Do Not Expect Symbol CLAMAV_VIRUS_FAIL
Do Not Expect Symbol CLAMAV_VIRUS_FAIL
FPROT MISS
- Run Dummy Fprot ${PORT_FPROT}
+ Run Dummy Fprot ${RSPAMD_PORT_FPROT}
Scan File ${MESSAGE2}
Do Not Expect Symbol FPROT_VIRUS
Do Not Expect Symbol FPROT_EICAR
Shutdown fport
FPROT HIT - PATTERN
- Run Dummy Fprot ${PORT_FPROT} 1
- Run Dummy Fprot ${PORT_FPROT2_DUPLICATE} 1 /tmp/dummy_fprot_dupe.pid
+ Run Dummy Fprot ${RSPAMD_PORT_FPROT} 1
+ Run Dummy Fprot ${RSPAMD_PORT_FPROT2_DUPLICATE} 1 /tmp/dummy_fprot_dupe.pid
Scan File ${MESSAGE}
Expect Symbol FPROT_EICAR
Do Not Expect Symbol CLAMAV_VIRUS
Do Not Expect Symbol FPROT_VIRUS
AVAST MISS
- Run Dummy Avast ${PORT_AVAST}
+ Run Dummy Avast ${RSPAMD_PORT_AVAST}
Scan File ${MESSAGE}
Do Not Expect Symbol AVAST_VIRUS
Shutdown avast
AVAST HIT
- Run Dummy Avast ${PORT_AVAST} 1
+ Run Dummy Avast ${RSPAMD_PORT_AVAST} 1
Scan File ${MESSAGE2}
Expect Symbol AVAST_VIRUS
Do Not Expect Symbol AVAST_VIRUS_FAIL
*** Keywords ***
Antivirus Setup
- New Setup PORT_CLAM=${PORT_CLAM} PORT_FPROT=${PORT_FPROT} PORT_AVAST=${PORT_AVAST}
- ... PORT_FPROT2_DUPLICATE=${PORT_FPROT2_DUPLICATE}
+ New Setup
Run Redis
Antivirus Teardown
Run Dummy Clam
[Arguments] ${port} ${found}= ${pid}=/tmp/dummy_clamav.pid
- Run Dummy ${TESTDIR}/util/dummy_clam.py ${port} ${found} ${pid}
+ Run Dummy ${RSPAMD_TESTDIR}/util/dummy_clam.py ${port} ${found} ${pid}
Run Dummy Fprot
[Arguments] ${port} ${found}= ${pid}=/tmp/dummy_fprot.pid
- Run Dummy ${TESTDIR}/util/dummy_fprot.py ${port} ${found} ${pid}
+ Run Dummy ${RSPAMD_TESTDIR}/util/dummy_fprot.py ${port} ${found} ${pid}
Run Dummy Avast
[Arguments] ${port} ${found}= ${pid}=/tmp/dummy_avast.pid
- Run Dummy ${TESTDIR}/util/dummy_avast.py ${port} ${found} ${pid}
+ Run Dummy ${RSPAMD_TESTDIR}/util/dummy_avast.py ${port} ${found} ${pid}
Suite Setup p0f Setup
Suite Teardown p0f Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/p0f.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
-${MESSAGE2} ${TESTDIR}/messages/freemail.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/p0f.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${MESSAGE2} ${RSPAMD_TESTDIR}/messages/freemail.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
p0f MISS
Shutdown p0f
p0f HIT
- Run Dummy p0f ${P0F_SOCKET} windows
+ Run Dummy p0f ${RSPAMD_P0F_SOCKET} windows
Scan File ${MESSAGE} IP=1.1.1.2
Do Not Expect Symbol P0F_FAIL
Expect Symbol With Exact Options P0F link=Ethernet or modem distance=10
Do Not Expect Symbol P0F_FAIL
p0f HIT CACHE
- Run Dummy p0f ${P0F_SOCKET} windows
+ Run Dummy p0f ${RSPAMD_P0F_SOCKET} windows
Scan File ${MESSAGE} IP=1.1.1.4
Expect Symbol WINDOWS
Shutdown p0f
Shutdown p0f
p0f NO MATCH
- Run Dummy p0f ${P0F_SOCKET} windows no_match
+ Run Dummy p0f ${RSPAMD_P0F_SOCKET} windows no_match
Scan File ${MESSAGE} IP=1.1.1.6
Do Not Expect Symbol P0F
Do Not Expect Symbol WINDOWS
Shutdown p0f
p0f BAD QUERY
- Run Dummy p0f ${P0F_SOCKET} windows bad_query
+ Run Dummy p0f ${RSPAMD_P0F_SOCKET} windows bad_query
Scan File ${MESSAGE} IP=1.1.1.7
Expect Symbol With Exact Options P0F_FAIL Malformed Query: /tmp/p0f.sock
Do Not Expect Symbol WINDOWS
Shutdown p0f
p0f BAD RESPONSE
- Run Dummy p0f ${P0F_SOCKET} windows bad_response
+ Run Dummy p0f ${RSPAMD_P0F_SOCKET} windows bad_response
Scan File ${MESSAGE} IP=1.1.1.8
Expect Symbol With Exact Options P0F_FAIL Error getting result: IO read error: connection terminated
Do Not Expect Symbol WINDOWS
*** Keywords ***
p0f Setup
- New Setup P0F_SOCKET=${P0F_SOCKET} URL_TLD=${URL_TLD}
+ New Setup
Run Redis
p0f Teardown
Run Keyword if ${p0f_pid} Shutdown Process With Children ${p0f_pid}
Run Dummy p0f
- [Arguments] ${socket}=${P0F_SOCKET} ${os}=linux ${status}=ok
- ${result} = Start Process ${TESTDIR}/util/dummy_p0f.py ${socket} ${os} ${status}
+ [Arguments] ${socket}=${RSPAMD_P0F_SOCKET} ${os}=linux ${status}=ok
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_p0f.py ${socket} ${os} ${status}
Wait Until Created /tmp/dummy_p0f.pid
Suite Setup Urlredirector Setup
Suite Teardown Urlredirector Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/url_redirector.conf
-${MESSAGE} ${TESTDIR}/messages/redir.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/url_redirector.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/redir.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
${SETTINGS} {symbols_enabled=[URL_REDIRECTOR_CHECK]}
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
RESOLVE URLS
*** Keywords ***
Urlredirector Setup
- ${TMPDIR} = Make Temporary Directory
- Set Suite Variable ${TMPDIR}
- Set Suite Variable ${REDIS_TMPDIR} ${TMPDIR}
+ ${RSPAMD_TMPDIR} = Make Temporary Directory
+ Set Suite Variable ${RSPAMD_TMPDIR}
+ Set Suite Variable ${REDIS_TMPDIR} ${RSPAMD_TMPDIR}
Run Redis
Run Dummy Http
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Urlredirector Teardown
Normal Teardown
Shutdown Process With Children ${http_pid}
Run Dummy Http
- ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
Wait Until Created /tmp/dummy_http.pid
Suite Setup Milter Setup
Suite Teardown Generic Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/milter.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/milter.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
ACCEPT
*** Keywords ***
Milter Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Milter Test
[Arguments] ${mtlua}
- ${result} = Run Process miltertest -Dport\=${PORT_PROXY} -Dhost\=${LOCAL_ADDR} -s ${TESTDIR}/lua/miltertest/${mtlua}
- ... cwd=${TESTDIR}/lua/miltertest
+ ${result} = Run Process miltertest -Dport\=${RSPAMD_PORT_PROXY} -Dhost\=${RSPAMD_LOCAL_ADDR} -s ${RSPAMD_TESTDIR}/lua/miltertest/${mtlua}
+ ... cwd=${RSPAMD_TESTDIR}/lua/miltertest
Should Match Regexp ${result.stderr} ^$
Log ${result.rc}
Log ${result.stdout}
Documentation Checks if rspamd is able to upgrade migration schema from v0 (very initial) to v2
Test Setup Clickhouse Setup
Test Teardown Clickhosue Teardown
-Variables ${TESTDIR}/lib/vars.py
-Library ${TESTDIR}/lib/rspamd.py
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Library clickhouse.py
-Resource ${TESTDIR}/lib/rspamd.robot
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/clickhouse.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/clickhouse.conf
${RSPAMD_SCOPE} Suite
${CLICKHOUSE_PORT} ${18123}
# Column should exist rspamd Attachments.Digest
# Column should exist rspamd Symbols.Scores
# Schema version should be 3
-# Upload new schema ${TESTDIR}/data/initial_schema/schema.sql
-# Insert data rspamd ${TESTDIR}/data/initial_schema/data.rspamd.sql
-# Insert data rspamd_asn ${TESTDIR}/data/initial_schema/data.rspamd_asn.sql
-# Insert data rspamd_urls ${TESTDIR}/data/initial_schema/data.rspamd_urls.sql
-# Insert data rspamd_emails ${TESTDIR}/data/initial_schema/data.rspamd_emails.sql
-# Insert data rspamd_symbols ${TESTDIR}/data/initial_schema/data.rspamd_symbols.sql
-# Insert data rspamd_attachments ${TESTDIR}/data/initial_schema/data.rspamd_attachments.sql
+# Upload new schema ${RSPAMD_TESTDIR}/data/initial_schema/schema.sql
+# Insert data rspamd ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd.sql
+# Insert data rspamd_asn ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd_asn.sql
+# Insert data rspamd_urls ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd_urls.sql
+# Insert data rspamd_emails ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd_emails.sql
+# Insert data rspamd_symbols ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd_symbols.sql
+# Insert data rspamd_attachments ${RSPAMD_TESTDIR}/data/initial_schema/data.rspamd_attachments.sql
# Prepare rspamd
# Sleep 2 #TODO: replace this check with waiting until migration finishes
# Column should exist rspamd Symbols.Scores
# Eventually broken
#Retention
-# Upload new schema ${TESTDIR}/data/schema_2/schema.sql
-# Insert data rspamd ${TESTDIR}/data/schema_2/data.rspamd.sql
+# Upload new schema ${RSPAMD_TESTDIR}/data/schema_2/schema.sql
+# Insert data rspamd ${RSPAMD_TESTDIR}/data/schema_2/data.rspamd.sql
# Assert rows count rspamd 56
# Prepare rspamd
# Sleep 2 #TODO: replace this check with waiting until migration finishes
*** Keywords ***
Clickhouse Setup
- ${TMPDIR} = Make Temporary Directory
- Set Suite Variable ${TMPDIR}
- Set Directory Ownership ${TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
- ${template} = Get File ${TESTDIR}/configs/clickhouse-config.xml
+ ${RSPAMD_TMPDIR} = Make Temporary Directory
+ Set Suite Variable ${RSPAMD_TMPDIR}
+ Set Directory Ownership ${RSPAMD_TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
+ ${template} = Get File ${RSPAMD_TESTDIR}/configs/clickhouse-config.xml
${config} = Replace Variables ${template}
- Create File ${TMPDIR}/clickhouse-config.xml ${config}
- Copy File ${TESTDIR}/configs/clickhouse-users.xml ${TMPDIR}/users.xml
- Create Directory ${TMPDIR}/clickhouse
- Set Directory Ownership ${TMPDIR}/clickhouse clickhouse clickhouse
+ Create File ${RSPAMD_TMPDIR}/clickhouse-config.xml ${config}
+ Copy File ${RSPAMD_TESTDIR}/configs/clickhouse-users.xml ${RSPAMD_TMPDIR}/users.xml
+ Create Directory ${RSPAMD_TMPDIR}/clickhouse
+ Set Directory Ownership ${RSPAMD_TMPDIR}/clickhouse clickhouse clickhouse
${result} = Run Process su -s /bin/sh clickhouse -c
- ... clickhouse-server --daemon --config-file\=${TMPDIR}/clickhouse-config.xml --pid-file\=${TMPDIR}/clickhouse/clickhouse.pid
+ ... clickhouse-server --daemon --config-file\=${RSPAMD_TMPDIR}/clickhouse-config.xml --pid-file\=${RSPAMD_TMPDIR}/clickhouse/clickhouse.pid
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Wait Until Keyword Succeeds 5 sec 50 ms TCP Connect localhost ${CLICKHOUSE_PORT}
- Set Suite Variable ${TMPDIR} ${TMPDIR}
+ Set Suite Variable ${RSPAMD_TMPDIR} ${RSPAMD_TMPDIR}
Clickhosue Teardown
# Sleep 30
- ${clickhouse_pid} = Get File ${TMPDIR}/clickhouse/clickhouse.pid
+ ${clickhouse_pid} = Get File ${RSPAMD_TMPDIR}/clickhouse/clickhouse.pid
Shutdown Process With Children ${clickhouse_pid}
- Log File ${TMPDIR}/clickhouse/clickhouse-server.err.log
+ Log File ${RSPAMD_TMPDIR}/clickhouse/clickhouse-server.err.log
Simple Teardown
Prepare rspamd
- &{d} = Run Rspamd CONFIG=${TESTDIR}/configs/clickhouse.conf TMPDIR=${TMPDIR}
+ &{d} = Run Rspamd CONFIG=${RSPAMD_TESTDIR}/configs/clickhouse.conf TMPDIR=${RSPAMD_TMPDIR}
${keys} = Get Dictionary Keys ${d}
FOR ${i} IN @{keys}
Run Keyword If '${RSPAMD_SCOPE}' == 'Suite' Set Suite Variable ${${i}} ${d}[${i}]
Test Setup Http Setup
Test Teardown Http Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-# ${CONFIG} ${TESTDIR}/configs/http.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/http.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Test
*** Test Cases ***
Http Setup
Run Dummy Http
Run Dummy Https
- New Setup LUA_SCRIPT=${TESTDIR}/lua/http.lua URL_TLD=${URL_TLD}
+ New Setup
Http Teardown
${http_pid} = Get File /tmp/dummy_http.pid
Normal Teardown
Run Dummy Http
- ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
Wait Until Created /tmp/dummy_http.pid
Run Dummy Https
- ${result} = Start Process ${TESTDIR}/util/dummy_https.py ${TESTDIR}/util/server.pem
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_https.py ${RSPAMD_TESTDIR}/util/server.pem
Wait Until Created /tmp/dummy_https.pid
Check url
Suite Setup Servers Setup
Suite Teardown Servers Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-# ${CONFIG} ${TESTDIR}/configs/http.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/tcp.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
*** Test Cases ***
Check url /content-length post HTTP_SYNC_CONTENT_post hello post
*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- Generic Setup
-
Servers Setup
Run Dummy Http
Run Dummy Ssl
- New Setup LUA_SCRIPT=${TESTDIR}/lua/tcp.lua URL_TLD=${URL_TLD}
+ New Setup
Servers Teardown
${http_pid} = Get File /tmp/dummy_http.pid
Run Dummy Http
[Arguments]
- ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
Wait Until Created /tmp/dummy_http.pid timeout=2 second
Run Dummy Ssl
[Arguments]
- ${result} = Start Process ${TESTDIR}/util/dummy_ssl.py ${TESTDIR}/util/server.pem
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_ssl.py ${RSPAMD_TESTDIR}/util/server.pem
Wait Until Created /tmp/dummy_ssl.pid timeout=2 second
Check url
*** Settings ***
-Test Setup Http Setup
-Test Teardown Http Teardown
+Test Setup New Setup
+Test Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-# ${CONFIG} ${TESTDIR}/configs/http.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/tcp.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Test
*** Test Cases ***
*** Keywords ***
-Http Setup
- New Setup LUA_SCRIPT=${TESTDIR}/lua/tcp.lua URL_TLD=${URL_TLD}
-
-Http Teardown
- Normal Teardown
-
Check url
[Arguments] ${url} ${method} @{expect_results}
${result} = Scan Message With Rspamc --header=url:${url} --header=method:${method} ${MESSAGE}
Test Setup Redis Setup
Test Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
Suite Teardown Terminate All Processes kill=True
*** Variables ***
${REDIS_SCOPE} Test
${RSPAMD_SCOPE} Test
-${CONFIG} ${TESTDIR}/configs/redis.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/redis.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/redis.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
*** Test Cases ***
*** Keywords ***
Redis Setup
- New Setup LUA_SCRIPT=${TESTDIR}/lua/redis.lua
Run Redis
+ New Setup
*** Settings ***
Documentation Test the case when trying to connect to nowhere
... (i.e. redis is not running)
-Test Setup Dead Redis Setup
+Test Setup New Setup
Test Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
Suite Teardown Terminate All Processes kill=True
*** Variables ***
${REDIS_SCOPE} Test
${RSPAMD_SCOPE} Test
-${CONFIG} ${TESTDIR}/configs/redis.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/redis.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/redis.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
*** Test Cases ***
Expect Symbol With Exact Options REDIS_ERROR_3 Connection refused
Expect Symbol With Exact Options REDIS_ASYNC201809_ERROR Connection refused
Expect Symbol With Exact Options REDIS_ASYNC_ERROR Connection refused
-
-*** Keywords ***
-Dead Redis Setup
- New Setup LUA_SCRIPT=${TESTDIR}/lua/redis.lua
*** Settings ***
-Test Setup Http Setup
-Test Teardown Http Teardown
+Test Setup New Setup
+Test Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/dns.lua
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Test
*** Test Cases ***
Scan File ${MESSAGE} To-Resolve=not-resolvable.com
Expect Symbol With Exact Options DNS_SYNC_ERROR requested record is not found
Expect Symbol With Exact Options DNS_ERROR requested record is not found
-
-*** Keywords ***
-Lua Setup
- [Arguments] ${LUA_SCRIPT}
- Set Suite Variable ${LUA_SCRIPT}
- Generic Setup
-
-Http Setup
- New Setup LUA_SCRIPT=${TESTDIR}/lua/dns.lua URL_TLD=${URL_TLD}
-
-Http Teardown
- Normal Teardown
*** Settings ***
Test Setup New Setup
Test Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/regexp.conf
-${MESSAGE} ${TESTDIR}/messages/newlines.eml
-${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/regexp.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/newlines.eml
+${UTF_MESSAGE} ${RSPAMD_TESTDIR}/messages/utf.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
${RSPAMD_SCOPE} Test
*** Settings ***
Test Setup Regex Setup
Test Teardown Regex Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/selector.conf
-${MESSAGE} ${TESTDIR}/messages/subject1.eml
-${UTF_MESSAGE} ${TESTDIR}/messages/utf.eml
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/selector.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/subject1.eml
+${UTF_MESSAGE} ${RSPAMD_TESTDIR}/messages/utf.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
${RSPAMD_SCOPE} Suite
*** Keywords ***
Regex Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Regex Teardown
Normal Teardown
*** Settings ***
Suite Setup Rules Setup
Suite Teardown Rules Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/regexp.conf
-${MESSAGE} ${TESTDIR}/messages/newlines.eml
-${MESSAGE1} ${TESTDIR}/messages/fws_fn.eml
-${MESSAGE2} ${TESTDIR}/messages/fws_fp.eml
-${MESSAGE3} ${TESTDIR}/messages/fws_tp.eml
-${MESSAGE4} ${TESTDIR}/messages/broken_richtext.eml
-${MESSAGE5} ${TESTDIR}/messages/badboundary.eml
-${MESSAGE6} ${TESTDIR}/messages/pdf_encrypted.eml
-${MESSAGE7} ${TESTDIR}/messages/pdf_js.eml
-${MESSAGE8} ${TESTDIR}/messages/yand_forward.eml
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/regexp.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/newlines.eml
+${MESSAGE1} ${RSPAMD_TESTDIR}/messages/fws_fn.eml
+${MESSAGE2} ${RSPAMD_TESTDIR}/messages/fws_fp.eml
+${MESSAGE3} ${RSPAMD_TESTDIR}/messages/fws_tp.eml
+${MESSAGE4} ${RSPAMD_TESTDIR}/messages/broken_richtext.eml
+${MESSAGE5} ${RSPAMD_TESTDIR}/messages/badboundary.eml
+${MESSAGE6} ${RSPAMD_TESTDIR}/messages/pdf_encrypted.eml
+${MESSAGE7} ${RSPAMD_TESTDIR}/messages/pdf_js.eml
+${MESSAGE8} ${RSPAMD_TESTDIR}/messages/yand_forward.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
${RSPAMD_SCOPE} Suite
Expect Symbol PDF_JAVASCRIPT
BITCOIN ADDR
- Scan File ${TESTDIR}/messages/btc.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/btc.eml
Expect Symbol BITCOIN_ADDR
BITCOIN ADDR 2
- Scan File ${TESTDIR}/messages/btc2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/btc2.eml
Expect Symbol BITCOIN_ADDR
BITCOIN ADDR 3
- Scan File ${TESTDIR}/messages/btc3.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/btc3.eml
Expect Symbol BITCOIN_ADDR
RCVD_COUNT_ONE
- Scan File ${TESTDIR}/messages/btc.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/btc.eml
Expect Symbol RCVD_COUNT_ONE
RCVD_COUNT_FIVE
- Scan File ${TESTDIR}/messages/yand_forward.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/yand_forward.eml
Expect Symbol RCVD_COUNT_FIVE
RCVD_COUNT_SEVEN
- Scan File ${TESTDIR}/messages/rcvd7.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/rcvd7.eml
Expect Symbol RCVD_COUNT_SEVEN
FROM_NEQ_ENVFROM
Expect Symbol FROM_NEQ_ENVFROM
PHISH_SENDER_A
- Scan File ${TESTDIR}/messages/phish_sender.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender.eml
Expect Symbol With Score And Exact Options MULTIPLE_FROM 9.0 <any@attack.com> <admin@legitimate.com>
Expect Symbol With Score And Exact Options MULTIPLE_UNIQUE_HEADERS 7.0 From
PHISH_SENDER_B
- Scan File ${TESTDIR}/messages/phish_sender2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender2.eml
Expect Symbol BROKEN_HEADERS
PHISH_SENDER_C
- Scan File ${TESTDIR}/messages/phish_sender3.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender3.eml
Expect Symbol BROKEN_HEADERS
PHISH_SENDER_D
- Scan File ${TESTDIR}/messages/phish_sender4.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender4.eml
Expect Symbol BROKEN_HEADERS
PHISH_SENDER_E
- Scan File ${TESTDIR}/messages/phish_sender5.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender5.eml
Expect Symbol MULTIPLE_FROM
Expect Symbol With Exact Options DMARC_NA Duplicate From header
PHISH_SENDER_ROUTING_PART
- Scan File ${TESTDIR}/messages/phish_sender6.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/phish_sender6.eml
Expect Symbol FROM_INVALID
REPLYTO_ADDR_EQ_FROM
- Scan File ${TESTDIR}/messages/replyto_addr_eq_from.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto_addr_eq_from.eml
Expect Symbol REPLYTO_ADDR_EQ_FROM
*** Keywords ***
Rules Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Rules Teardown
Normal Teardown
*** Settings ***
-Suite Setup FNames Setup
+Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_script.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/test_fname.lua
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_script.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/test_fname.lua
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
FILE NAMES
- Scan File ${TESTDIR}/messages/fname.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/fname.eml
Expect Symbol With Option TEST_FNAME [삼성생명]2020.08.14 데일리 경제뉴스.pdf
Expect Symbol With Option TEST_FNAME 01029_402110_10620_RGT06902_PRT180ML_20200803_101820.pdf
-
-*** Keyword ***
-FNames Setup
- New Setup LUA_SCRIPT=${LUA_SCRIPT}
*** Settings ***
Suite Setup Greylist Setup
Suite Teardown Greylist Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/greylist.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/greylist.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
GREYLIST NEW
*** Keywords ***
Greylist Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Run Redis
Greylist Teardown
*** Settings ***
Suite Setup Rbl Setup
Suite Teardown Rbl Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/rbl.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/rbl.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
RBL FROM MISS
Expect Symbol With Exact Options FAKE_WL_RBL_CODE_2 4.3.2.4:from
EMAILBL Compose Map 1
- Scan File ${TESTDIR}/messages/url14.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url14.eml
Expect Symbol With Exact Options RSPAMD_EMAILBL dirty.sanchez.com:email
EMAILBL Compose Map 2
- Scan File ${TESTDIR}/messages/url15.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url15.eml
Expect Symbol With Exact Options RSPAMD_EMAILBL very.dirty.sanchez.com:email
EMAILBL Compose Map 3
- Scan File ${TESTDIR}/messages/url16.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url16.eml
Expect Symbol With Exact Options RSPAMD_EMAILBL 41.black.sanchez.com:email
CONTENT URLS
- Scan File ${TESTDIR}/messages/content_url.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/content_url.eml
Expect Symbol With Exact Options URIBL_NOCONTENT example.org:url
Expect Symbol With Option URIBL_WITHCONTENT example.com:url
Expect Symbol With Option URIBL_WITHCONTENT example.org:url
Expect Symbol With Exact Options URIBL_CONTENTONLY example.com:url
SELECTORS
- Scan File ${TESTDIR}/messages/btc.eml From=user@example.com Helo=example.org
+ Scan File ${RSPAMD_TESTDIR}/messages/btc.eml From=user@example.com Helo=example.org
Expect Symbol With Exact Options RBL_SELECTOR_SINGLE example.org:selector
Expect Symbol With Option RBL_SELECTOR_MULTIPLE example.com:sel_from
Expect Symbol With Option RBL_SELECTOR_MULTIPLE example.org:sel_helo
SELECTORS COMBINED
- Scan File ${TESTDIR}/messages/btc.eml From=user@example.org Helo=example.org
+ Scan File ${RSPAMD_TESTDIR}/messages/btc.eml From=user@example.org Helo=example.org
Expect Symbol With Option RBL_SELECTOR_MULTIPLE example.org:sel_from
Expect Symbol With Option RBL_SELECTOR_MULTIPLE example.org:sel_helo
*** Keywords ***
Rbl Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Rbl Teardown
Normal Teardown
Test Setup UDP Setup
Test Teardown UDP Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/lua_test.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE} Test
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/udp.lua
*** Test Cases ***
Simple UDP request
*** Keywords ***
UDP Setup
Run Dummy UDP
- New Setup LUA_SCRIPT=${TESTDIR}/lua/udp.lua URL_TLD=${URL_TLD}
+ New Setup
UDP Teardown
${udp_pid} = Get File /tmp/dummy_udp.pid
Run Dummy UDP
[Arguments]
- ${result} = Start Process ${TESTDIR}/util/dummy_udp.py 5005
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_udp.py 5005
Wait Until Created /tmp/dummy_udp.pid
*** Settings ***
Suite Setup New Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/arc_signing/simple.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
-${MESSAGE_FAIL} ${TESTDIR}/messages/dmarc/fail_none1.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/arc_signing/simple.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
+${MESSAGE_FAIL} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none1.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
*** Settings ***
Suite Setup ARC Signing Setup
Suite Teardown Normal Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/arc_signing/redis.conf
-${MESSAGE} ${TESTDIR}/messages/dmarc/fail_none.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/arc_signing/redis.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/dmarc/fail_none.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
TEST SIGNED
ARC Signing Setup
Run Redis
Redis HSET TEST_DKIM_SELECTORS cacophony.za.org arc
- ${key} = Get File ${TESTDIR}/configs/dkim.key
+ ${key} = Get File ${RSPAMD_TESTDIR}/configs/dkim.key
Redis HSET TEST_DKIM_KEYS arc.cacophony.za.org ${key}
New Setup
*** Settings ***
Suite Setup ARC Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/arc.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/arc.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../../contrib/publicsuffix/effective_tld_names.dat
*** Test Cases ***
ARC ALLOW CHECK
- Scan File ${TESTDIR}/messages/arcallow.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/arcallow.eml
Expect Symbol ARC_ALLOW
ARC BAD CHECK
- Scan File ${TESTDIR}/messages/arcbad.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/arcbad.eml
Expect Symbol ARC_INVALID
*** Keywords ***
ARC Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Suite Setup Neural Setup
Suite Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/neural.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/neural.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
*** Keywords ***
Neural Setup
Run Redis
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Suite Setup Neural Setup
Suite Teardown Normal Teardown
Library Process
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${CONFIG} ${TESTDIR}/configs/neural_noauto.conf
-${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${RSPAMD_TESTDIR}/configs/neural_noauto.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${REDIS_SCOPE} Suite
${RSPAMD_SCOPE} Suite
# Save neural inputs for later
${HAM_ROW} = Get File ${SCAN_RESULT}[symbols][SAVE_NN_ROW][options][0]
Remove File ${SCAN_RESULT}[symbols][SAVE_NN_ROW][options][0]
- ${HAM_ROW} = Run ${RSPAMADM} lua -a ${HAM_ROW} ${TESTDIR}/util/nn_unpack.lua
+ ${HAM_ROW} = Run ${RSPAMADM} lua -a ${HAM_ROW} ${RSPAMD_TESTDIR}/util/nn_unpack.lua
${HAM_ROW} = Evaluate json.loads("${HAM_ROW}")
- ${SPAM_ROW} = Run ${RSPAMADM} lua -a ${SPAM_ROW} ${TESTDIR}/util/nn_unpack.lua
+ ${SPAM_ROW} = Run ${RSPAMADM} lua -a ${SPAM_ROW} ${RSPAMD_TESTDIR}/util/nn_unpack.lua
${SPAM_ROW} = Evaluate json.loads("${SPAM_ROW}")
${HAM_VEC} = Evaluate [${HAM_ROW}] * 10
${SPAM_VEC} = Evaluate [${SPAM_ROW}] * 10
# Save variables for use in inverse training
Set Suite Variable ${HAM_VEC}
Set Suite Variable ${SPAM_VEC}
- HTTP POST ${LOCAL_ADDR} ${PORT_CONTROLLER} /plugins/neural/learn ${json1}
+ HTTP POST ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_CONTROLLER} /plugins/neural/learn ${json1}
Sleep 2s Wait for neural to be loaded
Check Neural HAM
Train inverse
${json2} = Evaluate json.dumps({"spam_vec": ${HAM_VEC}, "ham_vec": ${SPAM_VEC}, "rule": "SHORT"})
- HTTP POST ${LOCAL_ADDR} ${PORT_CONTROLLER} /plugins/neural/learn ${json2}
+ HTTP POST ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_CONTROLLER} /plugins/neural/learn ${json2}
Sleep 2s Wait for neural to be loaded
Check Neural HAM - inverse
*** Keywords ***
Neural Setup
Run Redis
- New Setup URL_TLD=${URL_TLD}
+ New Setup
*** Settings ***
Suite Setup Surbl Setup
Suite Teardown Surbl Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/surbl.conf
+${CONFIG} ${RSPAMD_TESTDIR}/configs/surbl.conf
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
SURBL resolve ip
- Scan File ${TESTDIR}/messages/url7.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url7.eml
Expect Symbol With Exact Options URIBL_SBL_CSS 8.8.8.9:example.ru:url
Expect Symbol With Exact Options URIBL_XBL 8.8.8.8:example.ru:url
Expect Symbol With Exact Options URIBL_PBL 8.8.8.8:example.ru:url
SURBL Example.com domain
- Scan File ${TESTDIR}/messages/url4.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url4.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol DBL_SPAM
Do Not Expect Symbol DBL_PHISH
Do Not Expect Symbol URIBL_BLACK
SURBL Example.net domain
- Scan File ${TESTDIR}/messages/url5.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url5.eml
Expect Symbol DBL_PHISH
Do Not Expect Symbol DBL_SPAM
Do Not Expect Symbol RSPAMD_URIBL
Do Not Expect Symbol URIBL_BLACK
SURBL Example.org domain
- Scan File ${TESTDIR}/messages/url6.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url6.eml
Expect Symbol URIBL_BLACK
Do Not Expect Symbol DBL_SPAM
Do Not Expect Symbol RSPAMD_URIBL
Do Not Expect Symbol DBL_PHISH
SURBL Example.ru domain
- Scan File ${TESTDIR}/messages/url7.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url7.eml
Expect Symbol URIBL_GREY
Expect Symbol URIBL_RED
Do Not Expect Symbol DBL_SPAM
Do Not Expect Symbol URIBL_BLACK
SURBL Example.ru ZEN domain
- Scan File ${TESTDIR}/messages/url7.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url7.eml
Expect Symbol URIBL_SBL_CSS
Expect Symbol URIBL_XBL
Expect Symbol URIBL_PBL
Do Not Expect Symbol URIBL_BLACK
SURBL Example.com domain image false
- Scan File ${TESTDIR}/messages/urlimage.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/urlimage.eml
Expect Symbol RSPAMD_URIBL_IMAGES
Do Not Expect Symbol DBL_SPAM
Do Not Expect Symbol RSPAMD_URIBL
Do Not Expect Symbol URIBL_BLACK
SURBL @example.com mail html
- Scan File ${TESTDIR}/messages/mailadr.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/mailadr.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol With Exact Options DBL_SPAM example.com:email
Do Not Expect Symbol RSPAMD_URIBL_IMAGES
Do Not Expect Symbol URIBL_BLACK
SURBL @example.com mail text
- Scan File ${TESTDIR}/messages/mailadr2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/mailadr2.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol With Exact Options DBL_SPAM example.com:email
Do Not Expect Symbol RSPAMD_URIBL_IMAGES
Do Not Expect Symbol URIBL_BLACK
SURBL example.com not encoded url in subject
- Scan File ${TESTDIR}/messages/urlinsubject.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/urlinsubject.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol DBL_SPAM
Do Not Expect Symbol DBL_PHISH
Do Not Expect Symbol URIBL_BLACK
SURBL example.com encoded url in subject
- Scan File ${TESTDIR}/messages/urlinsubjectencoded.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/urlinsubjectencoded.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol DBL_SPAM
Do Not Expect Symbol DBL_PHISH
Do Not Expect Symbol URIBL_BLACK
WHITELIST
- Scan File ${TESTDIR}/messages/whitelist.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/whitelist.eml
Do Not Expect Symbol RSPAMD_URIBL
Do Not Expect Symbol DBL_SPAM
Do Not Expect Symbol RSPAMD_URIBL_IMAGES
EMAILBL full address & domain only
- Scan File ${TESTDIR}/messages/emailbltext.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/emailbltext.eml
Expect Symbol RSPAMD_EMAILBL_FULL
Expect Symbol RSPAMD_EMAILBL_DOMAINONLY
EMAILBL full subdomain address
- Scan File ${TESTDIR}/messages/emailbltext2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/emailbltext2.eml
Expect Symbol RSPAMD_EMAILBL_FULL
EMAILBL full subdomain address & domain only
- Scan File ${TESTDIR}/messages/emailbltext3.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/emailbltext3.eml
Expect Symbol With Exact Options RSPAMD_EMAILBL_DOMAINONLY baddomain.com:email
Expect Symbol With Exact Options RSPAMD_EMAILBL_FULL user.subdomain.baddomain.com:email
EMAILBL REPLY TO full address
- Scan File ${TESTDIR}/messages/replyto.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto.eml
Expect Symbol RSPAMD_EMAILBL_FULL
Do Not Expect Symbol RSPAMD_EMAILBL_DOMAINONLY
EMAILBL REPLY TO domain only
- Scan File ${TESTDIR}/messages/replyto2.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/replyto2.eml
Expect Symbol RSPAMD_EMAILBL_DOMAINONLY
Do Not Expect Symbol RSPAMD_EMAILBL_FULL
EMAILBL REPLY TO full subdomain address
- Scan File ${TESTDIR}/messages/replytosubdomain.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/replytosubdomain.eml
Expect Symbol RSPAMD_EMAILBL_FULL
Do Not Expect Symbol RSPAMD_EMAILBL_DOMAINONLY
SURBL IDN domain
- Scan File ${TESTDIR}/messages/url8.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url8.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol DBL_SPAM
Do Not Expect Symbol DBL_PHISH
Do Not Expect Symbol URIBL_BLACK
SURBL IDN Punycode domain
- Scan File ${TESTDIR}/messages/url9.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url9.eml
Expect Symbol RSPAMD_URIBL
Expect Symbol DBL_SPAM
Do Not Expect Symbol DBL_PHISH
Do Not Expect Symbol URIBL_BLACK
SURBL html entity­
- Scan File ${TESTDIR}/messages/url10.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url10.eml
Expect Symbol RSPAMD_URIBL
SURBL url compose map 1
- Scan File ${TESTDIR}/messages/url11.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url11.eml
Expect Symbol With Exact Options BAD_SUBDOMAIN clean.dirty.sanchez.com:url
SURBL url compose map 2
- Scan File ${TESTDIR}/messages/url12.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url12.eml
Expect Symbol With Exact Options BAD_SUBDOMAIN 4.very.dirty.sanchez.com:url
SURBL url compose map 3
- Scan File ${TESTDIR}/messages/url13.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/url13.eml
Expect Symbol With Exact Options BAD_SUBDOMAIN 41.black.sanchez.com:url
*** Keywords ***
Surbl Setup
- New Setup URL_TLD=${URL_TLD}
+ New Setup
Surbl Teardown
Normal Teardown
*** Settings ***
Suite Setup Magic Setup
Suite Teardown Simple Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/lua_script.conf
-${LUA_SCRIPT} ${TESTDIR}/lua/magic.lua
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_script.conf
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/magic.lua
${RSPAMD_SCOPE} Suite
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
*** Test Cases ***
Magic detections bundle 1
- Scan File ${TESTDIR}/messages/gargantua.eml
+ Scan File ${RSPAMD_TESTDIR}/messages/gargantua.eml
Expect Symbols MAGIC_SYM_ZIP_2
... MAGIC_SYM_RAR_3
... MAGIC_SYM_EXE_4
*** Keywords ***
Magic Setup
- New Setup LUA_SCRIPT=${LUA_SCRIPT}
+ New Setup
*** Settings ***
Suite Setup Force Actions Setup
Suite Teardown Force Actions Teardown
-Library ${TESTDIR}/lib/rspamd.py
-Resource ${TESTDIR}/lib/rspamd.robot
-Variables ${TESTDIR}/lib/vars.py
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
-${CONFIG} ${TESTDIR}/configs/force_actions.conf
-${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
-${MESSAGE} ${TESTDIR}/messages/url7.eml
+${CONFIG} ${RSPAMD_TESTDIR}/configs/force_actions.conf
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/url7.eml
${RSPAMD_SCOPE} Suite
*** Test Cases ***
*** Keywords ***
Export Global Variables
- ${TESTDIR} = Get Test Directory
+ ${RSPAMD_TESTDIR} = Get Test Directory
${TOPDIR} = Get Top Dir
${RSPAMADM} = Get Rspamadm
${RSPAMC} = Get Rspamc
${RSPAMD} = Get Rspamd
- ${INSTALLROOT} = Get Install Root
- Set Global Variable ${INSTALLROOT}
+ ${RSPAMD_INSTALLROOT} = Get Install Root
+ Set Global Variable ${RSPAMD_INSTALLROOT}
Set Global Variable ${RSPAMADM}
Set Global Variable ${RSPAMC}
Set Global Variable ${RSPAMD}
- Set Global Variable ${TESTDIR}
+ Set Global Variable ${RSPAMD_TESTDIR}
Set Global Variable ${TOPDIR}
<logger>
<!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
<level>debug</level>
- <log>${TMPDIR}/clickhouse/clickhouse-server.log</log>
- <errorlog>${TMPDIR}/clickhouse/clickhouse-server.err.log</errorlog>
+ <log>${RSPAMD_TMPDIR}/clickhouse/clickhouse-server.log</log>
+ <errorlog>${RSPAMD_TMPDIR}/clickhouse/clickhouse-server.err.log</errorlog>
<size>1000M</size>
<count>10</count>
<!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
<http_port>${CLICKHOUSE_PORT}</http_port>
<!-- Path to configuration file with users, access rights, profiles of settings, quotas. -->
- <users_config>${TMPDIR}/users.xml</users_config>
+ <users_config>${RSPAMD_TMPDIR}/users.xml</users_config>
<!-- <listen_reuse_port>0</listen_reuse_port> -->
<mark_cache_size>5368709120</mark_cache_size>
<!-- Path to data directory, with trailing slash. -->
- <path>${TMPDIR}/clickhouse/</path>
+ <path>${RSPAMD_TMPDIR}/clickhouse/</path>
<!-- Default profile of settings. -->
<default_profile>default</default_profile>
options = {
filters = ["spf", "dkim", "regexp"]
- pidfile = "${TMPDIR}/rspamd.pid"
+ pidfile = "${RSPAMD_TMPDIR}/rspamd.pid"
lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "${RSPAMD_TMPDIR}/rspamd.log"
}
metric = {
name = "default",
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL}
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "${RSPAMD_TMPDIR}/stats.ucl"
}
-lua = "${TESTDIR}/lua/test_coverage.lua";
+lua = "${RSPAMD_TESTDIR}/lua/test_coverage.lua";
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "${RSPAMD_TESTDIR}/../../src/plugins/lua/"
}
lua = "${INSTALLROOT}/share/rspamd/rules/rspamd.lua"
}
slave {
name = "slave1";
- hosts = "${LOCAL_ADDR}:${PORT_FUZZY_SLAVE}";
+ hosts = "${RSPAMD_LOCAL_ADDR}:${PORT_FUZZY_SLAVE}";
key = "caen11q4eczdqgsb8u55zmmoh4z5qxd61y1rph7pz1fcubmfccdy";
}
type = "kex";
}
-masters = "${LOCAL_ADDR}";
+masters = "${RSPAMD_LOCAL_ADDR}";
master_key = "kmtnjffjzq9bq8qe14ii4gb4e1ihuq84ubfibe79ba85ob5nr3my";
events {
}
worker_processes 1;
-pid ${TMPDIR}/nginx.pid;
-error_log ${TMPDIR}/error.log;
+pid ${RSPAMD_TMPDIR}/nginx.pid;
+error_log ${RSPAMD_TMPDIR}/error.log;
http {
default_type application/octet-stream;
sendfile on;
server_name localhost;
location / {
- root ${TMPDIR};
+ root ${RSPAMD_TMPDIR};
autoindex on;
}
}
options = {
filters = ["spf", "dkim", "regexp"]
- url_tld = "${URL_TLD}"
- pidfile = "${TMPDIR}/rspamd.pid"
+ url_tld = "${RSPAMD_URL_TLD}"
+ pidfile = "${RSPAMD_TMPDIR}/rspamd.pid"
lua_path = "${INSTALLROOT}/share/rspamd/lib/?.lua"
dns {
nameserver = ["8.8.8.8", "8.8.4.4"];
logging = {
type = "file",
level = "debug"
- filename = "${TMPDIR}/rspamd.log"
+ filename = "${RSPAMD_TMPDIR}/rspamd.log"
}
metric = {
name = "default",
}
worker {
type = normal
- bind_socket = ${LOCAL_ADDR}:${PORT_NORMAL}
+ bind_socket = ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL}
count = 1
task_timeout = 60s;
}
worker {
type = controller
- bind_socket = ${LOCAL_ADDR}:${PORT_CONTROLLER}
+ bind_socket = ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER}
count = 1
secure_ip = ["127.0.0.1", "::1"];
- stats_path = "${TMPDIR}/stats.ucl"
+ stats_path = "${RSPAMD_TMPDIR}/stats.ucl"
}
modules {
- path = "${TESTDIR}/../../src/plugins/lua/"
+ path = "${RSPAMD_TESTDIR}/../../src/plugins/lua/"
}
lua = "${LUA}";
${PLUGIN_CONFIG}
-bind ${REDIS_ADDR}
+bind ${RSPAMD_REDIS_ADDR}
daemonize yes
loglevel debug
-logfile ${TMPDIR}/redis.log
-pidfile ${TMPDIR}/redis.pid
-port ${REDIS_PORT}
-dir ${TMPDIR}
+logfile ${RSPAMD_TMPDIR}/redis.log
+pidfile ${RSPAMD_TMPDIR}/redis.pid
+port ${RSPAMD_REDIS_PORT}
+dir ${RSPAMD_TMPDIR}
url_tags {
}
redis {
- servers = "${REDIS_ADDR}:${REDIS_PORT}";
+ servers = "${RSPAMD_REDIS_ADDR}:${RSPAMD_REDIS_PORT}";
}
options {
"""Creates and returns a unique temporary directory
Example:
- | ${TMPDIR} = | Make Temporary Directory |
+ | ${RSPAMD_TMPDIR} = | Make Temporary Directory |
"""
dirname = tempfile.mkdtemp()
os.chmod(dirname, stat.S_IRUSR |
return r.decode('utf-8')
def Scan_File(filename, **headers):
- addr = BuiltIn().get_variable_value("${LOCAL_ADDR}")
- port = BuiltIn().get_variable_value("${PORT_NORMAL}")
+ addr = BuiltIn().get_variable_value("${RSPAMD_LOCAL_ADDR}")
+ port = BuiltIn().get_variable_value("${RSPAMD_PORT_NORMAL}")
headers["Queue-Id"] = BuiltIn().get_variable_value("${TEST_NAME}")
c = http.client.HTTPConnection("%s:%s" % (addr, port))
c.request("POST", "/checkv2", open(filename, "rb"), headers)
def collect_lua_coverage():
"""
- Merges ${TMPDIR}/*.luacov.stats.out into luacov.stats.out
+ Merges ${RSPAMD_TMPDIR}/*.luacov.stats.out into luacov.stats.out
Example:
| Collect Lua Coverage |
# logger.info("ENABLE_LUA_COVERAGE is not present in env, will not collect Lua coverage")
# return
- tmp_dir = BuiltIn().get_variable_value("${TMPDIR}")
+ tmp_dir = BuiltIn().get_variable_value("${RSPAMD_TMPDIR}")
coverage = {}
input_files = []
*** Keywords ***
Check Controller Errors
- @{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /errors
+ @{result} = HTTP GET ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_CONTROLLER} /errors
Should Be Equal As Integers ${result}[0] 200
Log ${result}[1]
Expect Symbol With Exact Options ${symbol} @{options}
Expect Symbol With Score ${symbol} ${score}
+Export Rspamd Variables To Environment
+ &{all_vars} = Get Variables no_decoration=True
+ FOR ${k} ${v} IN &{all_vars}
+ Run Keyword If '${k}'.startswith("RSPAMD_") Set Environment Variable ${k} ${v}
+ END
+
Export Scoped Variables
[Arguments] ${scope} &{vars}
FOR ${k} ${v} IN &{vars}
#Run Keyword If '${CONTROLLER_ERRORS}' == 'True' Run Keyword And Warn On Failure Check Controller Errors
Run Keyword If '${CONTROLLER_ERRORS}' == 'True' Check Controller Errors
Shutdown Process With Children ${RSPAMD_PID}
- Save Run Results ${TMPDIR} rspamd.conf rspamd.log redis.log clickhouse-config.xml
+ Save Run Results ${RSPAMD_TMPDIR} rspamd.conf rspamd.log redis.log clickhouse-config.xml
Log does not contain segfault record
Collect Lua Coverage
- Cleanup Temporary Directory ${TMPDIR}
+ Cleanup Temporary Directory ${RSPAMD_TMPDIR}
# Possibly deal with Redis
${redis_tmpdir} = Get Variable Value ${REDIS_TMPDIR}
Shutdown Process With Children ${redis_pid}
Log does not contain segfault record
- ${log} = Get File ${TMPDIR}/rspamd.log encoding_errors=ignore
+ ${log} = Get File ${RSPAMD_TMPDIR}/rspamd.log encoding_errors=ignore
Should not contain ${log} Segmentation fault: msg=Segmentation fault detected
New Setup
[Arguments] &{kw}
# Create and chown temporary directory
- ${TMPDIR} = Make Temporary Directory
- Set Directory Ownership ${TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
-
- # Export ${TMPDIR} to appropriate scope according to ${RSPAMD_SCOPE}
- Export Scoped Variables ${RSPAMD_SCOPE} TMPDIR=${TMPDIR}
+ ${RSPAMD_TMPDIR} = Make Temporary Directory
+ Set Directory Ownership ${RSPAMD_TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
- # Set additional values to ${kw} that are expected to be available everywhere
- Set To Dictionary ${kw} LOCAL_ADDR=${LOCAL_ADDR} PORT_NORMAL=${PORT_NORMAL}
- ... KEY_PUB1=${KEY_PUB1} KEY_PVT1=${KEY_PVT1} PORT_CONTROLLER=${PORT_CONTROLLER}
- ... TESTDIR=${TESTDIR} INSTALLROOT=${INSTALLROOT} TMPDIR=${TMPDIR}
- ... MAP_WATCH_INTERVAL=${MAP_WATCH_INTERVAL} PORT_PROXY=${PORT_PROXY}
+ # Export ${RSPAMD_TMPDIR} to appropriate scope according to ${RSPAMD_SCOPE}
+ Export Scoped Variables ${RSPAMD_SCOPE} RSPAMD_TMPDIR=${RSPAMD_TMPDIR}
- New Run Rspamd &{kw}
+ New Run Rspamd
Normal Teardown
Generic Teardown
Redis HSET
[Arguments] ${hash} ${key} ${value}
- ${result} = Run Process redis-cli -h ${REDIS_ADDR} -p ${REDIS_PORT}
+ ${result} = Run Process redis-cli -h ${RSPAMD_REDIS_ADDR} -p ${RSPAMD_REDIS_PORT}
... HSET ${hash} ${key} ${value}
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Log ${result.stdout}
Redis SET
[Arguments] ${key} ${value}
- ${result} = Run Process redis-cli -h ${REDIS_ADDR} -p ${REDIS_PORT}
+ ${result} = Run Process redis-cli -h ${RSPAMD_REDIS_ADDR} -p ${RSPAMD_REDIS_PORT}
... SET ${key} ${value}
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Run Redis
- ${TMPDIR} = Make Temporary Directory
- ${template} = Get File ${TESTDIR}/configs/redis-server.conf
+ ${RSPAMD_TMPDIR} = Make Temporary Directory
+ ${template} = Get File ${RSPAMD_TESTDIR}/configs/redis-server.conf
${config} = Replace Variables ${template}
- Create File ${TMPDIR}/redis-server.conf ${config}
+ Create File ${RSPAMD_TMPDIR}/redis-server.conf ${config}
Log ${config}
- ${result} = Run Process redis-server ${TMPDIR}/redis-server.conf
+ ${result} = Run Process redis-server ${RSPAMD_TMPDIR}/redis-server.conf
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
- Wait Until Keyword Succeeds 5x 1 sec Check Pidfile ${TMPDIR}/redis.pid timeout=0.5s
- Wait Until Keyword Succeeds 5x 1 sec Redis Check ${REDIS_ADDR} ${REDIS_PORT}
- ${REDIS_PID} = Get File ${TMPDIR}/redis.pid
+ Wait Until Keyword Succeeds 5x 1 sec Check Pidfile ${RSPAMD_TMPDIR}/redis.pid timeout=0.5s
+ Wait Until Keyword Succeeds 5x 1 sec Redis Check ${RSPAMD_REDIS_ADDR} ${RSPAMD_REDIS_PORT}
+ ${REDIS_PID} = Get File ${RSPAMD_TMPDIR}/redis.pid
${REDIS_PID} = Convert To Number ${REDIS_PID}
- Export Scoped Variables ${REDIS_SCOPE} REDIS_PID=${REDIS_PID} REDIS_TMPDIR=${TMPDIR}
- ${redis_log} = Get File ${TMPDIR}/redis.log
+ Export Scoped Variables ${REDIS_SCOPE} REDIS_PID=${REDIS_PID} REDIS_TMPDIR=${RSPAMD_TMPDIR}
+ ${redis_log} = Get File ${RSPAMD_TMPDIR}/redis.log
Log ${redis_log}
Run Rspamd
- [Arguments] &{kwargs}
- New Run Rspamd &{kwargs}
+ New Run Rspamd
Run Nginx
- ${template} = Get File ${TESTDIR}/configs/nginx.conf
+ ${template} = Get File ${RSPAMD_TESTDIR}/configs/nginx.conf
${config} = Replace Variables ${template}
- Create File ${TMPDIR}/nginx.conf ${config}
+ Create File ${RSPAMD_TMPDIR}/nginx.conf ${config}
Log ${config}
- ${result} = Run Process nginx -c ${TMPDIR}/nginx.conf
+ ${result} = Run Process nginx -c ${RSPAMD_TMPDIR}/nginx.conf
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
- Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${TMPDIR}/nginx.pid timeout=0.5s
+ Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${RSPAMD_TMPDIR}/nginx.pid timeout=0.5s
Wait Until Keyword Succeeds 5x 1 sec TCP Connect ${NGINX_ADDR} ${NGINX_PORT}
- ${NGINX_PID} = Get File ${TMPDIR}/nginx.pid
+ ${NGINX_PID} = Get File ${RSPAMD_TMPDIR}/nginx.pid
Run Keyword If '${NGINX_SCOPE}' == 'Test' Set Test Variable ${NGINX_PID}
... ELSE IF '${NGINX_SCOPE}' == 'Suite' Set Suite Variable ${NGINX_PID}
- ${nginx_log} = Get File ${TMPDIR}/nginx.log
+ ${nginx_log} = Get File ${RSPAMD_TMPDIR}/nginx.log
Log ${nginx_log}
Run Rspamc
[Arguments] @{args}
${result} = Run Process ${RSPAMC} -t 60 --header Queue-ID\=${TEST NAME}
- ... @{args} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
+ ... @{args} env:LD_LIBRARY_PATH=${RSPAMD_TESTDIR}/../../contrib/aho-corasick
Log ${result.stdout}
[Return] ${result}
New Run Rspamd
- [Arguments] &{kwargs}
-
- # Set each kwarg to environment variable prefixed with RSPAMD_
- FOR ${k} ${v} IN &{kwargs}
- Set Environment Variable RSPAMD_${k} ${v}
- END
+ Export Rspamd Variables To Environment
# Dump templated config or errors to log
${result} = Run Process ${RSPAMADM} configdump -c ${CONFIG}
# We need to send output to files (or discard output) to avoid hanging Robot
- ... stdout=${TMPDIR}/configdump.stdout stderr=${TMPDIR}/configdump.stderr
- ${configdump} = Run Keyword If ${result.rc} == 0 Get File ${TMPDIR}/configdump.stdout
- ... ELSE Get File ${TMPDIR}/configdump.stderr
+ ... stdout=${RSPAMD_TMPDIR}/configdump.stdout stderr=${RSPAMD_TMPDIR}/configdump.stderr
+ ${configdump} = Run Keyword If ${result.rc} == 0 Get File ${RSPAMD_TMPDIR}/configdump.stdout
+ ... ELSE Get File ${RSPAMD_TMPDIR}/configdump.stderr
Log ${configdump}
# Fix directory ownership (maybe do this somewhere else)
- Set Directory Ownership ${TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
+ Set Directory Ownership ${RSPAMD_TMPDIR} ${RSPAMD_USER} ${RSPAMD_GROUP}
# Run Rspamd
${result} = Run Process ${RSPAMD} -u ${RSPAMD_USER} -g ${RSPAMD_GROUP}
- ... -c ${CONFIG} env:TMPDIR=${TMPDIR} env:DBDIR=${TMPDIR} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
- ... env:RSPAMD_INSTALLROOT=${INSTALLROOT} env:RSPAMD_TMPDIR=${TMPDIR} env:RSPAMD_TESTDIR=${TESTDIR}
+ ... -c ${CONFIG} env:TMPDIR=${RSPAMD_TMPDIR} env:DBDIR=${RSPAMD_TMPDIR} env:LD_LIBRARY_PATH=${RSPAMD_TESTDIR}/../../contrib/aho-corasick
# We need to send output to files (or discard output) to avoid hanging Robot
- ... stdout=${TMPDIR}/rspamd.stdout stderr=${TMPDIR}/rspamd.stderr
+ ... stdout=${RSPAMD_TMPDIR}/rspamd.stdout stderr=${RSPAMD_TMPDIR}/rspamd.stderr
# Abort if it failed
Should Be Equal As Integers ${result.rc} 0
# Wait for pid file to be written
- Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${TMPDIR}/rspamd.pid timeout=0.5s
+ Wait Until Keyword Succeeds 10x 1 sec Check Pidfile ${RSPAMD_TMPDIR}/rspamd.pid timeout=0.5s
# Confirm worker is reachable
- Wait Until Keyword Succeeds 5x 1 sec Ping Rspamd ${LOCAL_ADDR} ${PORT_NORMAL}
+ Wait Until Keyword Succeeds 5x 1 sec Ping Rspamd ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL}
# Read PID from PIDfile and export it to appropriate scope as ${RSPAMD_PID}
- ${RSPAMD_PID} = Get File ${TMPDIR}/rspamd.pid
+ ${RSPAMD_PID} = Get File ${RSPAMD_TMPDIR}/rspamd.pid
Export Scoped Variables ${RSPAMD_SCOPE} RSPAMD_PID=${RSPAMD_PID}
Simple Teardown
Scan Message With Rspamc
[Arguments] ${msg_file} @{vargs}
- ${result} = Run Rspamc -p -h ${LOCAL_ADDR}:${PORT_NORMAL} @{vargs} ${msg_file}
+ ${result} = Run Rspamc -p -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_NORMAL} @{vargs} ${msg_file}
[Return] ${result}
Sync Fuzzy Storage
[Arguments] @{vargs}
${len} = Get Length ${vargs}
${result} = Run Keyword If $len == 0 Run Process ${RSPAMADM} control -s
- ... ${TMPDIR}/rspamd.sock fuzzy_sync
+ ... ${RSPAMD_TMPDIR}/rspamd.sock fuzzy_sync
... ELSE Run Process ${RSPAMADM} control -s ${vargs}[0]/rspamd.sock
... fuzzy_sync
Log ${result.stdout}
import socket
CONTROLLER_ERRORS = True
-KEY_PVT1 = 'ekd3x36tfa5gd76t6pa8hqif3ott7n1siuux68exbkk7ukscte9y'
-KEY_PUB1 = 'm8kneubpcjsb8sbsoj7jy7azj9fdd3xmj63txni86a8ye9ncomny'
-LOCAL_ADDR = '127.0.0.1'
-MAP_WATCH_INTERVAL = '1min'
-PORT_CONTROLLER = 56790
-PORT_CONTROLLER_SLAVE = 56793
-PORT_FUZZY = 56791
-PORT_FUZZY_SLAVE = 56792
-PORT_NORMAL = 56789
-PORT_NORMAL_SLAVE = 56794
-PORT_PROXY = 56795
-PORT_CLAM = 2100
-PORT_FPROT = 2101
-PORT_FPROT2_DUPLICATE = 2102
-PORT_AVAST = 2103
-P0F_SOCKET = '/tmp/p0f.sock'
-REDIS_ADDR = '127.0.0.1'
-REDIS_PORT = 56379
-NGINX_ADDR = '127.0.0.1'
-NGINX_PORT = 56380
+RSPAMD_KEY_PVT1 = 'ekd3x36tfa5gd76t6pa8hqif3ott7n1siuux68exbkk7ukscte9y'
+RSPAMD_KEY_PUB1 = 'm8kneubpcjsb8sbsoj7jy7azj9fdd3xmj63txni86a8ye9ncomny'
+RSPAMD_LOCAL_ADDR = '127.0.0.1'
+RSPAMD_MAP_WATCH_INTERVAL = '1min'
+RSPAMD_PORT_CONTROLLER = 56790
+RSPAMD_PORT_CONTROLLER_SLAVE = 56793
+RSPAMD_PORT_FUZZY = 56791
+RSPAMD_PORT_FUZZY_SLAVE = 56792
+RSPAMD_PORT_NORMAL = 56789
+RSPAMD_PORT_NORMAL_SLAVE = 56794
+RSPAMD_PORT_PROXY = 56795
+RSPAMD_PORT_CLAM = 2100
+RSPAMD_PORT_FPROT = 2101
+RSPAMD_PORT_FPROT2_DUPLICATE = 2102
+RSPAMD_PORT_AVAST = 2103
+RSPAMD_P0F_SOCKET = '/tmp/p0f.sock'
+RSPAMD_REDIS_ADDR = '127.0.0.1'
+RSPAMD_REDIS_PORT = 56379
+RSPAMD_NGINX_ADDR = '127.0.0.1'
+RSPAMD_NGINX_PORT = 56380
RSPAMD_GROUP = 'nogroup'
RSPAMD_USER = 'nobody'
SOCK_DGRAM = socket.SOCK_DGRAM