summaryrefslogtreecommitdiffstats
path: root/test/functional/cases/220_http.robot
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2021-05-24 16:33:20 +0200
committerAndrew Lewis <nerf@judo.za.org>2021-06-01 15:59:19 +0200
commit89ecb1b26baa4a9d511d7fe6a50c8bc8414b5ed0 (patch)
tree0ac863007ae9356b28f11cc97afa9f098c0940e8 /test/functional/cases/220_http.robot
parent9c12fd9609b1af6da35178987b9f1033b02757bc (diff)
downloadrspamd-89ecb1b26baa4a9d511d7fe6a50c8bc8414b5ed0.tar.gz
rspamd-89ecb1b26baa4a9d511d7fe6a50c8bc8414b5ed0.zip
[Test] Unmerge http / tcp tests
Diffstat (limited to 'test/functional/cases/220_http.robot')
-rw-r--r--test/functional/cases/220_http.robot83
1 files changed, 83 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..2812b4efa
--- /dev/null
+++ b/test/functional/cases/220_http.robot
@@ -0,0 +1,83 @@
+*** Settings ***
+Test Setup Http Setup
+Test Teardown Http Teardown
+Library Process
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
+${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/http.lua
+${RSPAMD_SCOPE} Suite
+${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat
+
+*** Test Cases ***
+Simple HTTP request
+ Scan File ${MESSAGE} Url=/request Method=get
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_DNS_200 HTTP_200 HTTP_CORO_DNS_200
+ Expect Symbol With Exact Options HTTP_CORO_200 hello world
+
+ Scan File ${MESSAGE} Url=/request Method=post
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_DNS_200 HTTP_200 HTTP_CORO_DNS_200
+ Expect Symbol With Exact Options HTTP_CORO_200 hello post
+
+HTTP request 403
+ Scan File ${MESSAGE} Url=/error_403 Method=get
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_DNS_403 HTTP_403 HTTP_CORO_DNS_403 method_get
+
+ Scan File ${MESSAGE} Url=/error_403 Method=post
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_DNS_403 HTTP_403 HTTP_CORO_DNS_403 method_post
+
+HTTP timeout
+ Scan File ${MESSAGE} Url=/timeout Method=get
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_get
+ # FIXME: where is "IO timeout"
+
+ Scan File ${MESSAGE} Url=/timeout Method=post
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_post
+ # FIXME: where is "IO timeout"
+
+HTTP empty response
+ Scan File ${MESSAGE} Url=/empty Method=get
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_get
+ # FIXME: where is "IO read error: unexpected EOF"
+
+ Scan File ${MESSAGE} Url=/empty Method=post
+ ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]}
+ Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_post
+ # FIXME: where is "IO read error: unexpected EOF"
+
+SSL Large HTTP request
+ Scan File ${MESSAGE}
+ ... Settings={symbols_enabled = [LARGE_HTTP_TEST]}
+ Expect Symbol HTTP_SSL_LARGE
+
+*** Keywords ***
+Http Setup
+ Run Dummy Http
+ Run Dummy Https
+ Rspamd Setup
+
+Http Teardown
+ ${http_pid} = Get File /tmp/dummy_http.pid
+ Shutdown Process With Children ${http_pid}
+ ${https_pid} = Get File /tmp/dummy_https.pid
+ Shutdown Process With Children ${https_pid}
+ Rspamd Teardown
+
+Run Dummy Http
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py
+ Wait Until Created /tmp/dummy_http.pid
+
+Run Dummy Https
+ ${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_https.py ${RSPAMD_TESTDIR}/util/server.pem
+ Wait Until Created /tmp/dummy_https.pid