blob: d1a771cb3eb651941072a74753739732153cdb7d (
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
|
*** Settings ***
Library ${RSPAMD_TESTDIR}/lib/rspamd.py
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
Variables ${RSPAMD_TESTDIR}/lib/vars.py
*** Variables ***
${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml
${RSPAMD_MAP_MAP} ${RSPAMD_TESTDIR}/configs/maps/map.list
${RSPAMD_RADIX_MAP} ${RSPAMD_TESTDIR}/configs/maps/ip2.list
${RSPAMD_REGEXP_MAP} ${RSPAMD_TESTDIR}/configs/maps/regexp.list
*** Test Cases ***
Recipient Parsing Sanity
Scan File ${MESSAGE} Rcpt=rcpt1@foobar,rcpt2@foobar,rcpt3@foobar,rcpt4@foobar
... Settings={symbols_enabled = [TEST_RCPT]}
Expect Symbol With Exact Options TEST_RCPT rcpt1@foobar,rcpt2@foobar,rcpt3@foobar,rcpt4@foobar
TLD parts
Scan File ${MESSAGE} Settings={symbols_enabled = [TEST_TLD]}
Expect Symbol With Exact Options TEST_TLD no worry
Hashes
Scan File ${MESSAGE} Settings={symbols_enabled = [TEST_HASHES]}
Expect Symbol With Exact Options TEST_HASHES no worry
Maps Key Values
Scan File ${MESSAGE} Settings={symbols_enabled = [RADIX_KV, REGEXP_KV, MAP_KV]}
Expect Symbol With Exact Options RADIX_KV no worry
Expect Symbol With Exact Options REGEXP_KV no worry
Expect Symbol With Exact Options MAP_KV no worry
Option Order
Scan File ${MESSAGE} Settings={symbols_enabled = [OPTION_ORDER, TBL_OPTION_ORDER]}
Expect Symbol With Exact Options OPTION_ORDER one two three 4 5 a
Expect Symbol With Exact Options TBL_OPTION_ORDER one two three 4 5 a
Remove Result
Scan File ${MESSAGE} Settings={symbols_enabled = [REMOVE_RESULT_EXPECTED, REMOVE_RESULT_UNEXPECTED]}
Expect Symbol REMOVE_RESULT_EXPECTED
Do Not Expect Symbol REMOVE_RESULT_UNEXPECTED
Rule conditions
Scan File ${MESSAGE} Settings={symbols_enabled = [ANY_A]}
Expect Symbol With Option ANY_A hello3
Expect Symbol With Option ANY_A hello1
Expect Symbol With Option ANY_A hello2
External Maps Simple
Scan File ${MESSAGE} Settings={symbols_enabled = [EXTERNAL_MAP]}
Expect Symbol With Exact Options EXTERNAL_MAP +hello map
|