| 1 |
*** Settings *** |
| 2 |
Suite Setup Rspamd Setup |
| 3 |
Suite Teardown Rspamd Teardown |
| 4 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 5 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 6 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 7 |
|
| 8 |
*** Variables *** |
| 9 |
${CONFIG} ${RSPAMD_TESTDIR}/configs/milter_headers.conf |
| 10 |
${MESSAGE} ${RSPAMD_TESTDIR}/messages/zip.eml |
| 11 |
${RSPAMD_SCOPE} Suite |
| 12 |
${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat |
| 13 |
|
| 14 |
*** Test Cases *** |
| 15 |
RSPAMC PROTOCOL STATUS LINE |
| 16 |
[Documentation] Verify RSPAMC response has correct status line and basic structure |
| 17 |
${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 18 |
Should Contain ${result} RSPAMD/1.3 0 EX_OK |
| 19 |
Should Contain ${result} Metric: default; |
| 20 |
|
| 21 |
RSPAMC BACKWARD COMPATIBLE SYMBOLS |
| 22 |
[Documentation] Existing Symbol: lines must be preserved |
| 23 |
${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 24 |
Should Match Regexp ${result} Symbol: SIMPLE_TEST\\(\\d+\\.\\d+\\) |
| 25 |
|
| 26 |
RSPAMC EXTENDED SYMBOLS |
| 27 |
[Documentation] X-Symbol: lines with options from symbol callbacks |
| 28 |
${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 29 |
Should Match Regexp ${result} X-Symbol: SIMPLE_TEST\\(\\d+\\.\\d+\\).*\\[Fires always\\] |
| 30 |
|
| 31 |
RSPAMC MILTER ADD HEADERS |
| 32 |
[Documentation] X-Milter-Add: lines for milter add_headers |
| 33 |
${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 34 |
Should Match Regexp ${result} X-Milter-Add: X-Virus: |
| 35 |
Should Match Regexp ${result} X-Milter-Add: My-Spamd-Bar: |
| 36 |
Should Match Regexp ${result} X-Milter-Add: X-Spam-Level: |
| 37 |
|
| 38 |
RSPAMC MILTER DEL HEADERS |
| 39 |
[Documentation] X-Milter-Del: lines for milter remove_headers |
| 40 |
${result} = Rspamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 41 |
Should Match Regexp ${result} X-Milter-Del: X-Spam-Level |
| 42 |
Should Match Regexp ${result} X-Milter-Del: X-Virus |
| 43 |
|
| 44 |
SPAMC PROTOCOL STATUS LINE |
| 45 |
[Documentation] Verify SPAMC response has correct status line |
| 46 |
${result} = Spamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 47 |
Should Contain ${result} SPAMD/1.1 0 EX_OK |
| 48 |
|
| 49 |
SPAMC MILTER ADD HEADERS |
| 50 |
[Documentation] X-Milter-Add: lines in SPAMC protocol output |
| 51 |
${result} = Spamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 52 |
Should Match Regexp ${result} X-Milter-Add: X-Virus: |
| 53 |
Should Match Regexp ${result} X-Milter-Add: My-Spamd-Bar: |
| 54 |
|
| 55 |
SPAMC MILTER DEL HEADERS |
| 56 |
[Documentation] X-Milter-Del: lines in SPAMC protocol output |
| 57 |
${result} = Spamc ${RSPAMD_LOCAL_ADDR} ${RSPAMD_PORT_NORMAL} ${MESSAGE} |
| 58 |
Should Match Regexp ${result} X-Milter-Del: X-Spam-Level |
| 59 |
Should Match Regexp ${result} X-Milter-Del: X-Virus |