| 1 |
*** Settings *** |
| 2 |
Test Teardown Rspamd Teardown |
| 3 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 4 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 5 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 6 |
|
| 7 |
*** Variables *** |
| 8 |
${CONFIG} ${RSPAMD_TESTDIR}/configs/password.conf |
| 9 |
${CONTROLLER_ERRORS} False |
| 10 |
${RSPAMD_CATENA_PASSWORD} "$2$xu1581gidj5cyp4yjgo68qbj6jz1j8o3$j9yg4k58jy3fj8suijxx9d7pea6a6obtufq9kfenosyq8erm87ky" |
| 11 |
${RSPAMD_PBKDF_PASSWORD} "$1$rhzzahtm8a5homdhh7z4qiiy7j8pzp4u$k5toro136brshjjuy9t39r785td69qodmd39qzygxuyehn9tqauy" |
| 12 |
${RSPAMD_ENABLE_CATENA_PASSWORD} "$2$irotou88u89r1gj53pqnom96qo36hgkn$d4dt3466db7ccqx96k18yz9b1brx8hmk3b4w6erf4oqpmf9sag6y" |
| 13 |
${RSPAMD_SCOPE} Test |
| 14 |
|
| 15 |
*** Test Cases *** |
| 16 |
PASSWORD - PBKDF |
| 17 |
[Setup] Password Setup ${RSPAMD_PBKDF_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 18 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat |
| 19 |
Check Rspamc ${result} Messages scanned: |
| 20 |
|
| 21 |
PASSWORD - PBKDF WRONG |
| 22 |
[Setup] Password Setup ${RSPAMD_PBKDF_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 23 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q1q1 stat |
| 24 |
Should Be Equal As Integers ${result.rc} 1 |
| 25 |
|
| 26 |
PASSWORD - CATENA |
| 27 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 28 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat |
| 29 |
Check Rspamc ${result} Messages scanned: |
| 30 |
|
| 31 |
PASSWORD - CATENA WRONG |
| 32 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 33 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q stat |
| 34 |
Should Be Equal As Integers ${result.rc} 1 |
| 35 |
|
| 36 |
PASSWORD - ENABLE |
| 37 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 38 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq2 stat_reset |
| 39 |
Check Rspamc ${result} Messages scanned: |
| 40 |
|
| 41 |
PASSWORD - ENABLE WITH NORMAL |
| 42 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 43 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat_reset |
| 44 |
Should Be Equal As Integers ${result.rc} 1 |
| 45 |
|
| 46 |
PASSWORD - ENABLE INCORRECT |
| 47 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_ENABLE_CATENA_PASSWORD} |
| 48 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P q2q2 stat_reset |
| 49 |
Should Be Equal As Integers ${result.rc} 1 |
| 50 |
|
| 51 |
PASSWORD - ENABLE EQUAL TO NORMAL PRIV COMMAND |
| 52 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_CATENA_PASSWORD} |
| 53 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat_reset |
| 54 |
Check Rspamc ${result} Messages scanned: |
| 55 |
|
| 56 |
PASSWORD - ENABLE EQUAL TO NORMAL NON PRIV COMMAND |
| 57 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_CATENA_PASSWORD} |
| 58 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq1 stat |
| 59 |
Check Rspamc ${result} Messages scanned: |
| 60 |
|
| 61 |
PASSWORD - ENABLE EQUAL TO NORMAL WRONG PASSWORD |
| 62 |
[Setup] Password Setup ${RSPAMD_CATENA_PASSWORD} ${RSPAMD_CATENA_PASSWORD} |
| 63 |
${result} = Run Rspamc -h ${RSPAMD_LOCAL_ADDR}:${RSPAMD_PORT_CONTROLLER} -P nq2 stat |
| 64 |
Should Be Equal As Integers ${result.rc} 1 |
| 65 |
|
| 66 |
*** Keywords *** |
| 67 |
Password Setup |
| 68 |
[Arguments] ${RSPAMD_PASSWORD} ${RSPAMD_ENABLE_PASSWORD} |
| 69 |
Set Test Variable ${RSPAMD_PASSWORD} |
| 70 |
Set Test Variable ${RSPAMD_ENABLE_PASSWORD} |
| 71 |
Rspamd Setup |