| 1 |
*** Settings *** |
| 2 |
Test Setup Rspamadm test Setup |
| 3 |
Test Teardown Rspamadm test Teardown |
| 4 |
Library Process |
| 5 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 6 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 7 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 8 |
|
| 9 |
*** Variables *** |
| 10 |
${CONFIG} ${RSPAMD_TESTDIR}/configs/plugins.conf |
| 11 |
${REDIS_SCOPE} Test |
| 12 |
# For dummy http |
| 13 |
${RSPAMD_SCOPE} Test |
| 14 |
${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat |
| 15 |
|
| 16 |
*** Test Cases *** |
| 17 |
#Tcp client |
| 18 |
# ${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_tcp_client.lua |
| 19 |
# Should Match Regexp ${result.stderr} ^$ |
| 20 |
# Should Be Equal As Integers ${result.rc} 0 |
| 21 |
# Should Be Equal ${result.stdout} hello post |
| 22 |
|
| 23 |
Redis client |
| 24 |
${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_redis_client.lua |
| 25 |
Should Match Regexp ${result.stderr} ^$ |
| 26 |
Should Be Equal As Integers ${result.rc} 0 |
| 27 |
Should Be Equal ${result.stdout} true\thello from lua on redis |
| 28 |
|
| 29 |
# Broken due to tmpdir override |
| 30 |
#DNS client |
| 31 |
# ${result} = Run Process ${RSPAMADM} --var\=CONFDIR\=${tmpdir} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_dns_client.lua |
| 32 |
# Log ${result.stdout} |
| 33 |
# Log ${result.stderr} |
| 34 |
# Should Be Equal As Integers ${result.rc} 0 |
| 35 |
# Should Be Equal ${result.stdout} true\tk=ed25519; p=yi50DjK5O9pqbFpNHklsv9lqaS0ArSYu02qp1S0DW1Y= |
| 36 |
# Cleanup Temporary Directory ${tmpdir} |
| 37 |
|
| 38 |
*** Keywords *** |
| 39 |
|
| 40 |
Rspamadm test Setup |
| 41 |
Run Dummy Http |
| 42 |
Run Redis |
| 43 |
|
| 44 |
Rspamadm test Teardown |
| 45 |
Dummy Http Teardown |
| 46 |
Redis Teardown |
| 47 |
|
| 48 |
Prepare temp directory |
| 49 |
[Arguments] ${CONFIG} |
| 50 |
${template} = Get File ${CONFIG} |
| 51 |
${tmpdir} = Make Temporary Directory |
| 52 |
${config} = Replace Variables ${template} |
| 53 |
${config} = Replace Variables ${config} |
| 54 |
Log ${config} |
| 55 |
Create File ${tmpdir}/rspamd.conf ${config} |
| 56 |
[Return] ${tmpdir} |