${RSPAMD_SCOPE} Suite
${SYMBOL} GET_FROM (0.00)
-${SYMBOL1} ${SYMBOL}[,user@example.org,user,example.org]
-${SYMBOL2} ${SYMBOL}[First Last,user@example.org,user,example.org]
-${SYMBOL3} ${SYMBOL}[First M. Last,user@example.org,user,example.org]
+${SYMBOL1} ${SYMBOL}\[,user@example.org,user,example.org]
+${SYMBOL2} ${SYMBOL}\[First Last,user@example.org,user,example.org]
+${SYMBOL3} ${SYMBOL}\[First M. Last,user@example.org,user,example.org]
*** Test Cases ***
task:get_from('mime') - address only
task:get_from('mime') - display name Base64
${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_dn_base64.eml
- Check Rspamc ${result} ${SYMBOL}[Кириллица,user@example.org,user,example.org]
+ Check Rspamc ${result} ${SYMBOL}\[Кириллица,user@example.org,user,example.org]
task:get_from('mime') - display name and comment
${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_dn_comment.eml
Run Keyword If ${RSPAMD_FUZZY_ADD_${message}} != 1 Fail "Fuzzy Add was not run"
@{path_info} = Path Splitter ${message}
@{fuzzy_files} = List Files In Directory @{pathinfo}[0] pattern=@{pathinfo}[1].fuzzy* absolute=1
- : FOR ${i} IN @{fuzzy_files}
- \ ${result} = Scan Message With Rspamc ${i}
- \ Check Rspamc ${result} ${FLAG1_SYMBOL}
+ FOR ${i} IN @{fuzzy_files}
+ ${result} = Scan Message With Rspamc ${i}
+ Check Rspamc ${result} ${FLAG1_SYMBOL}
+ END
Fuzzy Miss Test
[Arguments] ${message}
Fuzzy Overwrite Test
[Arguments] ${message}
${flag_numbers} = Create List ${FLAG1_NUMBER} ${FLAG2_NUMBER}
- : FOR ${i} IN @{flag_numbers}
- \ ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10
- \ ... -f ${i} fuzzy_add ${message}
- \ Check Rspamc ${result}
+ FOR ${i} IN @{flag_numbers}
+ ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -w 10
+ ... -f ${i} fuzzy_add ${message}
+ Check Rspamc ${result}
+ END
Sync Fuzzy Storage
${result} = Scan Message With Rspamc ${message}
Follow Rspamd Log
Fuzzy Setup Encrypted siphash
Fuzzy Multimessage Add Test
- : FOR ${i} IN @{MESSAGES}
- \ Fuzzy Add Test ${i}
+ FOR ${i} IN @{MESSAGES}
+ Fuzzy Add Test ${i}
+ END
Fuzzy Multimessage Fuzzy Test
- : FOR ${i} IN @{MESSAGES}
- \ Fuzzy Fuzzy Test ${i}
+ FOR ${i} IN @{MESSAGES}
+ Fuzzy Fuzzy Test ${i}
+ END
Fuzzy Multimessage Miss Test
- : FOR ${i} IN @{RANDOM_MESSAGES}
- \ Fuzzy Miss Test ${i}
+ FOR ${i} IN @{RANDOM_MESSAGES}
+ Fuzzy Miss Test ${i}
+ END
Fuzzy Multimessage Delete Test
- : FOR ${i} IN @{MESSAGES}
- \ Fuzzy Delete Test ${i}
+ FOR ${i} IN @{MESSAGES}
+ Fuzzy Delete Test ${i}
+ END
Fuzzy Multimessage Overwrite Test
- : FOR ${i} IN @{MESSAGES}
- \ Fuzzy Overwrite Test ${i}
+ FOR ${i} IN @{MESSAGES}
+ Fuzzy Overwrite Test ${i}
+ END
Fuzzy Teardown
Normal Teardown
${inverse} = Evaluate 'inverse' in $kwargs
${re} = Evaluate 're' in $kwargs
${rc} = Set Variable If ${has_rc} == True &{kwargs}[rc] 0
- : FOR ${i} IN @{args}
- \ Run Keyword If ${re} == True Check Rspamc Match Regexp ${result.stdout} ${i} ${inverse}
- \ ... ELSE Check Rspamc Match String ${result.stdout} ${i} ${inverse}
+ FOR ${i} IN @{args}
+ Run Keyword If ${re} == True Check Rspamc Match Regexp ${result.stdout} ${i} ${inverse}
+ ... ELSE Check Rspamc Match String ${result.stdout} ${i} ${inverse}
+ END
Run Keyword If @{args} == @{EMPTY} Check Rspamc Match Default ${result.stdout} ${inverse}
Should Be Equal As Integers ${result.rc} ${rc}
[Arguments] @{vargs} &{kwargs}
&{d} = Run Rspamd @{vargs} &{kwargs}
${keys} = Get Dictionary Keys ${d}
- : FOR ${i} IN @{keys}
- \ Run Keyword If '${RSPAMD_SCOPE}' == 'Suite' Set Suite Variable ${${i}} &{d}[${i}]
- \ ... ELSE IF '${RSPAMD_SCOPE}' == 'Test' Set Test Variable ${${i}} &{d}[${i}]
- \ ... ELSE Fail 'RSPAMD_SCOPE must be Test or Suite'
+ FOR ${i} IN @{keys}
+ Run Keyword If '${RSPAMD_SCOPE}' == 'Suite' Set Suite Variable ${${i}} &{d}[${i}]
+ ... ELSE IF '${RSPAMD_SCOPE}' == 'Test' Set Test Variable ${${i}} &{d}[${i}]
+ ... ELSE Fail 'RSPAMD_SCOPE must be Test or Suite'
+ END
Generic Teardown
[Arguments] @{ports}
Run Rspamc
[Arguments] @{args}
- ${result} = Run Process ${RSPAMC} -t 60 --header Queue-ID\=${TEST NAME} @{args} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
+ ${result} = Run Process ${RSPAMC} -t 60 --header Queue-ID\=${TEST NAME}
+ ... @{args} env:LD_LIBRARY_PATH=${TESTDIR}/../../contrib/aho-corasick
Log ${result.stdout}
[Return] ${result}
... ELSE Make Temporary Directory
Set Directory Ownership ${tmpdir} ${RSPAMD_USER} ${RSPAMD_GROUP}
${template} = Get File ${CONFIG}
- : FOR ${i} IN @{vargs}
- \ ${newvalue} = Replace Variables ${${i}}
- \ Set To Dictionary ${d} ${i}=${newvalue}
+ FOR ${i} IN @{vargs}
+ ${newvalue} = Replace Variables ${${i}}
+ Set To Dictionary ${d} ${i}=${newvalue}
+ END
${config} = Replace Variables ${template}
${config} = Replace Variables ${config}
Log ${config}
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
- ... ELSE Run Process ${RSPAMADM} control -s @{vargs}[0]/rspamd.sock fuzzy_sync
+ ${result} = Run Keyword If $len == 0 Run Process ${RSPAMADM} control -s
+ ... ${TMPDIR}/rspamd.sock fuzzy_sync
+ ... ELSE Run Process ${RSPAMADM} control -s @{vargs}[0]/rspamd.sock
+ ... fuzzy_sync
Log ${result.stdout}
Run Keyword If $len == 0 Follow Rspamd Log
... ELSE Custom Follow Rspamd Log @{vargs}[0]/rspamd.log @{vargs}[1] @{vargs}[2] @{vargs}[3]