summaryrefslogtreecommitdiffstats
path: root/test/functional/cases/109_composites.robot
blob: 8da18fe977bb88244d1534e6c44ddd48f7cbe483 (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
*** Settings ***
Suite Setup     Generic Setup
Suite Teardown  Simple Teardown
Library         ${TESTDIR}/lib/rspamd.py
Resource        ${TESTDIR}/lib/rspamd.robot
Variables       ${TESTDIR}/lib/vars.py

*** Variables ***
${CONFIG}       ${TESTDIR}/configs/composites.conf
${LUA_SCRIPT}   ${TESTDIR}/lua/composites.lua
${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
${RSPAMD_SCOPE}  Suite

*** Test Cases ***
Composites - All in One
  Scan File  ${MESSAGE}
  Expect Symbol With Score  EXPRESSIONS  5
  Expect Symbol With Score  EXPRESSIONS_B  0
  Expect Symbol With Score  POLICY_REMOVE_WEIGHT  5
  Expect Symbol With Score  POLICY_REMOVE_WEIGHT_B  0
  Do Not Expect Symbol  POLICY_REMOVE_WEIGHT_A
  Expect Symbol With Score  POLICY_FORCE_REMOVE  5.00
  Expect Symbol With Score  POLICY_FORCE_REMOVE_A  1.00
  Do Not Expect Symbol  POLICY_FORCE_REMOVE_B
  Expect Symbol With Score  POLICY_LEAVE  5.00
  Do Not Expect Symbol  POLICY_LEAVE_A
  Expect Symbol With Score  POLICY_LEAVE_B  1.00
  Expect Symbol With Score  DEFAULT_POLICY_REMOVE_WEIGHT  5.00
  Expect Symbol With Score  DEFAULT_POLICY_REMOVE_WEIGHT_A  0.00
  Expect Symbol With Score  DEFAULT_POLICY_REMOVE_WEIGHT_B  0.00
  Expect Symbol With Score  DEFAULT_POLICY_REMOVE_SYMBOL  5.00
  Do Not Expect Symbol  DEFAULT_POLICY_REMOVE_SYMBOL_A
  Do Not Expect Symbol  DEFAULT_POLICY_REMOVE_SYMBOL_B
  Expect Symbol With Score  DEFAULT_POLICY_LEAVE  5.00
  Expect Symbol With Score  DEFAULT_POLICY_LEAVE_A  1.00
  Expect Symbol With Score  DEFAULT_POLICY_LEAVE_B  1.00
  Expect Symbol With Score  SYMBOL_GROUPS  5.00
  Expect Symbol With Score  POSITIVE_A  -1.00
  Expect Symbol With Score  ANY_A  -1.00
  Expect Symbol With Score  NEGATIVE_B  1.00
  Do Not Expect Symbol  NEGATIVE_A
  Expect Score  50
  Expect Required Score To Be Null

Composites - Opts Plain
  Scan File  ${MESSAGE}  opts=sym1
  Expect Symbol With Score  SYMOPTS1  5.00
  Do Not Expect Symbol  SYMOPTS2

Composites - Opts RE Miss one
  Scan File  ${MESSAGE}  opts=sym1,foo1
  Expect Symbol With Score  SYMOPTS1  5.00
  Do Not Expect Symbol  SYMOPTS2

Composites - Opts RE Miss both
  Scan File  ${MESSAGE}  opts=sym2
  Do Not Expect Symbol  SYMOPTS1
  Do Not Expect Symbol  SYMOPTS2

Composites - Opts RE Hit
  Scan File  ${MESSAGE}  opts=sym2,foo1
  Expect Symbol With Score  SYMOPTS2  6.00
  Do Not Expect Symbol  SYMOPTS1