diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-12 12:00:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 12:00:34 +0100 |
commit | 88689d7be5cb1e5e8643ad4130c60ba2277ddd1b (patch) | |
tree | 60e548e8dd1ac5c646e38013cfc53c9bd08ef50c /test/functional/cases | |
parent | f77c6af1d0228256972140e0d3281abbe689fea7 (diff) | |
parent | 9ea7effc33d297790cc8273db69c996454201fda (diff) | |
download | rspamd-88689d7be5cb1e5e8643ad4130c60ba2277ddd1b.tar.gz rspamd-88689d7be5cb1e5e8643ad4130c60ba2277ddd1b.zip |
Merge pull request #2485 from negram/dns-api-test
[Test] Added test for DNS api
Diffstat (limited to 'test/functional/cases')
-rw-r--r-- | test/functional/cases/250_dns.robot | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/cases/250_dns.robot b/test/functional/cases/250_dns.robot new file mode 100644 index 000000000..c19f473e9 --- /dev/null +++ b/test/functional/cases/250_dns.robot @@ -0,0 +1,36 @@ +*** Settings *** +Test Setup Http Setup +Test Teardown Http Teardown +Library Process +Library ${TESTDIR}/lib/rspamd.py +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat +${CONFIG} ${TESTDIR}/configs/lua_test.conf +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${RSPAMD_SCOPE} Test + +*** Test Cases *** +Simple DNS request + ${result} = Scan Message With Rspamc --header=to-resolve:example.com ${MESSAGE} + Check Rspamc ${result} DNS_SYNC (0.00)[93.184.216.34] + Check Rspamc ${result} DNS (0.00)[93.184.216.34] + +Faulty DNS request + ${result} = Scan Message With Rspamc --header=to-resolve:not-resolvable.com ${MESSAGE} + Check Rspamc ${result} DNS_SYNC_ERROR (0.00)[requested record is not found] + Check Rspamc ${result} DNS_ERROR (0.00)[requested record is not found] + +*** Keywords *** +Lua Setup + [Arguments] ${LUA_SCRIPT} + Set Global Variable ${LUA_SCRIPT} + Generic Setup + +Http Setup + Lua Setup ${TESTDIR}/lua/dns.lua + +Http Teardown + Normal Teardown |