aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/220_http.robot
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-08-22 15:59:44 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-08-22 15:59:44 +0100
commit9ee6b0c059ad291e2e1a3a5cd6f01effd6f115a3 (patch)
tree29671f01a752f35256111e244bec3accb15c2766 /test/functional/cases/220_http.robot
parent434446f72add375d0f7a94a94e4797d9bd6d1d6a (diff)
downloadrspamd-9ee6b0c059ad291e2e1a3a5cd6f01effd6f115a3.tar.gz
rspamd-9ee6b0c059ad291e2e1a3a5cd6f01effd6f115a3.zip
[Test] Added test for HTTP API
Diffstat (limited to 'test/functional/cases/220_http.robot')
-rw-r--r--test/functional/cases/220_http.robot41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/cases/220_http.robot b/test/functional/cases/220_http.robot
new file mode 100644
index 000000000..427b4467f
--- /dev/null
+++ b/test/functional/cases/220_http.robot
@@ -0,0 +1,41 @@
+*** 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 ***
+# ${CONFIG} ${TESTDIR}/configs/http.conf
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${MESSAGE2} ${TESTDIR}/messages/freemail.eml
+${REDIS_SCOPE} Suite
+${RSPAMD_SCOPE} Suite
+
+*** Test Cases ***
+HTTP
+ Run Dummy Http
+ [Setup] Lua Setup ${TESTDIR}/lua/http.lua
+ ${result} = Scan Message With Rspamc ${MESSAGE}
+ Check Rspamc ${result} HTTP_DNS_200
+ Check Rspamc ${result} HTTP_200
+
+
+*** Keywords ***
+Lua Setup
+ [Arguments] ${LUA_SCRIPT}
+ Set Test Variable ${LUA_SCRIPT}
+ Generic Setup
+
+Http Teardown
+ ${http_pid} = Get File /tmp/dummy_http.pid
+ # Shutdown Process With Children ${http_pid}
+ Normal Teardown
+
+Run Dummy Http
+ [Arguments]
+ ${result} = Start Process ${TESTDIR}/util/dummy_http.py
+ Wait Until Created /tmp/dummy_http.pid