[Arguments] ${message}
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
+ @{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}
*** Keywords ***
Stat Test
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /stat
- Check JSON @{result}[1]
- Should Be Equal As Integers @{result}[0] 200
+ Check JSON ${result}[1]
+ Should Be Equal As Integers ${result}[0] 200
History Test
[Arguments] ${rspamc_expected_result}
${result} = Scan Message With Rspamc ${MESSAGE}
Check Rspamc ${result} ${rspamc_expected_result}
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /history
- Check JSON @{result}[1]
- Should Be Equal As Integers @{result}[0] 200
+ 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}
- Check JSON @{result}[1]
- Should Be Equal As Integers @{result}[0] 200
+ Check JSON ${result}[1]
+ Should Be Equal As Integers ${result}[0] 200
*** Keywords ***
Proxy Setup
&{d} = Run Rspamd CONFIG=${TESTDIR}/configs/lua_test.conf
- Set Suite Variable ${SLAVE_LOGPOS} &{d}[RSPAMD_LOGPOS]
- Set Suite Variable ${SLAVE_PID} &{d}[RSPAMD_PID]
- Set Suite Variable ${SLAVE_TMPDIR} &{d}[TMPDIR]
+ Set Suite Variable ${SLAVE_LOGPOS} ${d}[RSPAMD_LOGPOS]
+ Set Suite Variable ${SLAVE_PID} ${d}[RSPAMD_PID]
+ Set Suite Variable ${SLAVE_TMPDIR} ${d}[TMPDIR]
&{d} = Run Rspamd CONFIG=${TESTDIR}/configs/proxy.conf
- Set Suite Variable ${PROXY_LOGPOS} &{d}[RSPAMD_LOGPOS]
- Set Suite Variable ${PROXY_PID} &{d}[RSPAMD_PID]
- Set Suite Variable ${PROXY_TMPDIR} &{d}[TMPDIR]
+ Set Suite Variable ${PROXY_LOGPOS} ${d}[RSPAMD_LOGPOS]
+ Set Suite Variable ${PROXY_PID} ${d}[RSPAMD_PID]
+ Set Suite Variable ${PROXY_TMPDIR} ${d}[TMPDIR]
Proxy Teardown
Shutdown Process With Children ${PROXY_PID}
&{d} = Run Rspamd CONFIG=${TESTDIR}/configs/clickhouse.conf TMPDIR=${TMPDIR}
${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}]
+ 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
*** Keywords ***
Check Controller Errors
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /errors
- Should Be Equal As Integers @{result}[0] 200
- Log @{result}[1]
+ Should Be Equal As Integers ${result}[0] 200
+ Log ${result}[1]
Check Pidfile
[Arguments] ${pidfile} ${timeout}=1 min
${has_rc} = Evaluate 'rc' in $kwargs
${inverse} = Evaluate 'inverse' in $kwargs
${re} = Evaluate 're' in $kwargs
- ${rc} = Set Variable If ${has_rc} == True &{kwargs}[rc] 0
+ ${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}
&{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}]
+ 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
[Arguments] @{vargs} &{kwargs}
${has_CONFIG} = Evaluate 'CONFIG' in $kwargs
${has_TMPDIR} = Evaluate 'TMPDIR' in $kwargs
- ${CONFIG} = Set Variable If '${has_CONFIG}' == 'True' &{kwargs}[CONFIG] ${CONFIG}
+ ${CONFIG} = Set Variable If '${has_CONFIG}' == 'True' ${kwargs}[CONFIG] ${CONFIG}
&{d} = Create Dictionary
- ${tmpdir} = Run Keyword If '${has_TMPDIR}' == 'True' Set Variable &{kwargs}[TMPDIR]
+ ${tmpdir} = Run Keyword If '${has_TMPDIR}' == 'True' Set Variable ${kwargs}[TMPDIR]
... ELSE Make Temporary Directory
Set Directory Ownership ${tmpdir} ${RSPAMD_USER} ${RSPAMD_GROUP}
${template} = Get File ${CONFIG}
${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
+ ... 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]
+ ... ELSE Custom Follow Rspamd Log ${vargs}[0]/rspamd.log ${vargs}[1] ${vargs}[2] ${vargs}[3]
Sleep 0.1s Try give fuzzy storage time to sync