Debian Codegraph @

test/functional/cases/109_composites.robot

raw
1 *** Settings ***
2 Suite Setup Rspamd Setup
3 Suite Teardown Rspamd Teardown
4 Library ${RSPAMD_TESTDIR}/lib/rspamd.py
5 Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
6 Variables ${RSPAMD_TESTDIR}/lib/vars.py
7
8 *** Variables ***
9 ${CONFIG} ${RSPAMD_TESTDIR}/configs/composites.conf
10 ${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
11 ${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/composites.lua
12 ${RSPAMD_SCOPE} Suite
13
14 *** Test Cases ***
15 Composites - All in One
16 Scan File ${MESSAGE}
17 Expect Symbols With Scores EXPRESSIONS=5
18 ... EXPRESSIONS_B=0
19 ... POLICY_REMOVE_WEIGHT=5
20 ... POLICY_REMOVE_WEIGHT_B=0
21 ... POLICY_FORCE_REMOVE=5.00
22 ... POLICY_FORCE_REMOVE_A=1.00
23 ... POLICY_LEAVE=5.00
24 ... POLICY_LEAVE_B=1.00
25 ... DEFAULT_POLICY_REMOVE_WEIGHT=5.00
26 ... DEFAULT_POLICY_REMOVE_WEIGHT_A=0.00
27 ... DEFAULT_POLICY_REMOVE_WEIGHT_B=0.00
28 ... DEFAULT_POLICY_REMOVE_SYMBOL=5.00
29 ... DEFAULT_POLICY_LEAVE=5.00
30 ... DEFAULT_POLICY_LEAVE_A=1.00
31 ... DEFAULT_POLICY_LEAVE_B=1.00
32 ... SYMBOL_GROUPS=5.00
33 ... POSITIVE_A=-1.00
34 ... ANY_A=-1.00
35 ... NEGATIVE_B=1.00
36 Do Not Expect Symbols DEFAULT_POLICY_REMOVE_SYMBOL_A
37 ... DEFAULT_POLICY_REMOVE_SYMBOL_B
38 ... NEGATIVE_A
39 ... POLICY_REMOVE_WEIGHT_A
40 ... POLICY_FORCE_REMOVE_B
41 ... POLICY_LEAVE_A
42 Expect Score 50
43 Expect Required Score To Be Null
44
45 Composites - Opts Plain
46 Scan File ${MESSAGE} opts=sym1
47 Expect Symbol With Score SYMOPTS1 5.00
48 Do Not Expect Symbol SYMOPTS2
49
50 Composites - Opts RE Miss one
51 Scan File ${MESSAGE} opts=sym1,foo1
52 Expect Symbol With Score SYMOPTS1 5.00
53 Do Not Expect Symbol SYMOPTS2
54 Do Not Expect Symbol SYMOPTS3
55
56 Composites - Opts RE Miss both
57 Scan File ${MESSAGE} opts=sym2
58 Do Not Expect Symbol SYMOPTS1
59 Do Not Expect Symbol SYMOPTS2
60 Do Not Expect Symbol SYMOPTS3
61
62 Composites - Opts RE Hit
63 Scan File ${MESSAGE} opts=foo1,sym2
64 Expect Symbol With Score SYMOPTS2 6.00
65 Do Not Expect Symbol SYMOPTS1
66 Do Not Expect Symbol SYMOPTS3
67
68 Composites - Opts RE Hit 2
69 Scan File ${MESSAGE} opts=sym2,foo/
70 Expect Symbol With Score SYMOPTS3 6.00
71 Do Not Expect Symbol SYMOPTS2
72 Do Not Expect Symbol SYMOPTS1
73
74 Composites - Opts RE Hit 3
75 Scan File ${MESSAGE} opts=example.com->app.link
76 Expect Symbol With Score SYMOPTS4 6.00
77 Do Not Expect Symbol SYMOPTS2
78 Do Not Expect Symbol SYMOPTS1