| 1 |
*** Settings *** |
| 2 |
Suite Setup Rspamadm Setup |
| 3 |
Suite Teardown Rspamadm Teardown |
| 4 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 5 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 6 |
Test Timeout 1 minute |
| 7 |
|
| 8 |
*** Variables *** |
| 9 |
${LOGSTATS_LOG} ${RSPAMD_TESTDIR}/data/logstats_test.data |
| 10 |
|
| 11 |
*** Test Cases *** |
| 12 |
Logstats JSON output |
| 13 |
${result} = Rspamadm logstats --json ${LOGSTATS_LOG} |
| 14 |
Should Be Equal As Integers ${result.rc} 0 |
| 15 |
Should Contain ${result.stdout} "total" |
| 16 |
Should Contain ${result.stdout} "no action" |
| 17 |
Should Contain ${result.stdout} "reject" |
| 18 |
Should Contain ${result.stdout} "add header" |
| 19 |
Should Contain ${result.stdout} "greylist" |
| 20 |
Should Contain ${result.stdout} "symbols" |
| 21 |
|
| 22 |
Logstats text output |
| 23 |
${result} = Rspamadm logstats ${LOGSTATS_LOG} |
| 24 |
Should Be Equal As Integers ${result.rc} 0 |
| 25 |
Should Contain ${result.stdout} Messages scanned: 10 |
| 26 |
Should Contain ${result.stdout} === Summary |
| 27 |
Should Contain ${result.stdout} no action |
| 28 |
Should Contain ${result.stdout} reject |
| 29 |
Should Contain ${result.stdout} add header |
| 30 |
Should Contain ${result.stdout} greylist |
| 31 |
|
| 32 |
Logstats symbol filter |
| 33 |
${result} = Rspamadm logstats -s BAYES_SPAM ${LOGSTATS_LOG} |
| 34 |
Should Be Equal As Integers ${result.rc} 0 |
| 35 |
Should Contain ${result.stdout} BAYES_SPAM |
| 36 |
Should Not Contain ${result.stdout} R_SPF_ALLOW |
| 37 |
Should Contain ${result.stdout} Messages scanned: 10 |
| 38 |
|
| 39 |
Logstats alpha score warning |
| 40 |
${result} = Rspamadm logstats ${LOGSTATS_LOG} |
| 41 |
Should Be Equal As Integers ${result.rc} 0 |
| 42 |
Should Contain ${result.stdout} WARNING: |
| 43 |
Should Contain ${result.stdout} DKIM_TRACE |
| 44 |
Should Contain ${result.stdout} alpha_score |
| 45 |
|
| 46 |
Logstats stdin |
| 47 |
${result} = Run Process ${RSPAMADM} |
| 48 |
... --var\=TMPDIR\=${RSPAMADM_TMPDIR} |
| 49 |
... --var\=DBDIR\=${RSPAMADM_TMPDIR} |
| 50 |
... --var\=LOCAL_CONFDIR\=/nonexistent |
| 51 |
... logstats --json - |
| 52 |
... stdin=${LOGSTATS_LOG} |
| 53 |
Should Be Equal As Integers ${result.rc} 0 |
| 54 |
Should Contain ${result.stdout} "total" |
| 55 |
Should Contain ${result.stdout} "no action" |
| 56 |
|
| 57 |
Logstats scan time |
| 58 |
${result} = Rspamadm logstats ${LOGSTATS_LOG} |
| 59 |
Should Be Equal As Integers ${result.rc} 0 |
| 60 |
Should Contain ${result.stdout} scan time min/avg/max |