summaryrefslogtreecommitdiffstats
path: root/test/functional/cases/220_http.robot
blob: b3c42a33218e7e4d2bb84332605524a2b1930d5f (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
*** 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"

# Broken as dummy server is now not so dummy, not sure what is expected to be tested here
#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
  Rspamd Teardown
  Dummy Http Teardown
  Dummy Https Teardown