Debian Codegraph @

test/functional/cases/153_rspamadm_mapstats.robot

raw
1 *** Settings ***
2 Suite Setup Rspamadm Setup
3 Suite Teardown Rspamadm Teardown
4 Library ${RSPAMD_TESTDIR}/lib/rspamd.py
5 Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
6 Test Timeout 1 minute
7
8 *** Variables ***
9 ${MAPSTATS_LOG} ${RSPAMD_TESTDIR}/data/mapstats_test.data
10 ${MAPSTATS_CONF} ${RSPAMD_TESTDIR}/configs/mapstats_test.conf
11
12 *** Test Cases ***
13 Mapstats map loading
14 ${result} = Run Mapstats
15 Should Be Equal As Integers ${result.rc} 0
16 Should Contain ${result.stdout} TEST_PLAIN
17 Should Contain ${result.stdout} TEST_IP
18 Should Contain ${result.stdout} TEST_RE
19 Should Contain ${result.stdout} [OK]
20
21 Mapstats plain map comments
22 ${result} = Run Mapstats
23 Should Be Equal As Integers ${result.rc} 0
24 Should Contain ${result.stdout} \# Test domain
25 Should Contain ${result.stdout} \# Scored entry
26
27 Mapstats IP map comments
28 ${result} = Run Mapstats
29 Should Be Equal As Integers ${result.rc} 0
30 Should Contain ${result.stdout} \# Private network
31 Should Contain ${result.stdout} \# Internal
32
33 Mapstats regexp map comments
34 ${result} = Run Mapstats
35 Should Be Equal As Integers ${result.rc} 0
36 Should Contain ${result.stdout} \# Test pattern
37
38 Mapstats plain match counts
39 ${result} = Run Mapstats
40 Should Be Equal As Integers ${result.rc} 0
41 Should Contain ${result.stdout} example.com
42 Should Contain ${result.stdout} test.org
43
44 Mapstats regexp match
45 ${result} = Run Mapstats
46 Should Be Equal As Integers ${result.rc} 0
47 Should Contain ${result.stdout} test-string-
48
49 *** Keywords ***
50 Run Mapstats
51 ${result} = Rspamadm --var\=TESTDIR\=${RSPAMD_TESTDIR} mapstats -c ${MAPSTATS_CONF} ${MAPSTATS_LOG}
52 RETURN ${result}