blob: 2812b4efa6e6f6e56fe1ad5bdb14568ae0ad6fce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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
|