diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-28 18:35:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-28 18:35:09 +0100 |
commit | 0ea6d39d57cd6147409e4b6ab8375fbbd4e77680 (patch) | |
tree | 82d75d5dddbcf9e38115e320393243f8c8820898 /test/functional/cases/103_password.robot | |
parent | 50ef807416b4f3b0ed8bca72b1b5643406d365ca (diff) | |
download | rspamd-0ea6d39d57cd6147409e4b6ab8375fbbd4e77680.tar.gz rspamd-0ea6d39d57cd6147409e4b6ab8375fbbd4e77680.zip |
[Test] Add tests for controller passwords
Diffstat (limited to 'test/functional/cases/103_password.robot')
-rw-r--r-- | test/functional/cases/103_password.robot | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/functional/cases/103_password.robot b/test/functional/cases/103_password.robot new file mode 100644 index 000000000..93e55d683 --- /dev/null +++ b/test/functional/cases/103_password.robot @@ -0,0 +1,55 @@ +*** Settings *** +Test Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/password.conf +${RSPAMD_SCOPE} Test +${PBKDF_PASSWORD} "$1$nxnwqu5t6ruqfzb4h7bs47ogmdk9sb74$c8mbmcfyd6aic1sm48qzxuzkw4nhx6te6h7owgxz63bcd7fqu1dy" +${CATENA_PASSWORD} "$2$9dydyukfndmi8zzp7rbdsu43y7a3iucg$1nketaa9pjqwwzzjxogcrniphw4y5fanixudpwzza85tcb56yzub" + +*** Test Cases *** +PASSWORD - PBKDF + [Setup] Password Setup ${PBKDF_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q1 stat + Should Contain ${result.stdout} Messages scanned: + +PASSWORD - PBKDF WRONG + [Setup] Password Setup ${PBKDF_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q1q1 stat + Should Contain ${result.stdout} Unauthorized rc_nocheck=1 + +PASSWORD - CATENA + [Setup] Password Setup ${CATENA_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q1 stat + Should Contain ${result.stdout} Messages scanned: + + +PASSWORD - CATENA WRONG + [Setup] Password Setup ${CATENA_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q stat + Should Contain ${result.stdout} Unauthorized rc_nocheck=1 + +PASSWORD - ENABLE + [Setup] Password Setup ${CATENA_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q2 stat_reset + Should Contain ${result.stdout} Messages scanned: + +PASSWORD - ENABLE WITH NORMAL + [Setup] Password Setup ${CATENA_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q1 stat_reset + Should Contain ${result.stdout} Unauthorized rc_nocheck=1 + +PASSWORD - ENABLE INCORRECT + [Setup] Password Setup ${CATENA_PASSWORD} + ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} -P q2q2 stat_reset + Should Contain ${result.stdout} Unauthorized rc_nocheck=1 + +*** Keywords *** +Password Setup + [Arguments] ${PASSWORD} ${ENABLE_PASSWORD}=q2 + Set Test Variable ${PASSWORD} + Set Test Variable ${ENABLE_PASSWORD} + Generic Setup
\ No newline at end of file |