aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/290_greylist.robot
blob: 64896fe2bb5fb541d61f1c06c68ba8c7e0ff6aca (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
*** Settings ***
Suite Setup     Greylist Setup
Suite Teardown  Greylist Teardown
Library         ${TESTDIR}/lib/rspamd.py
Resource        ${TESTDIR}/lib/rspamd.robot
Variables       ${TESTDIR}/lib/vars.py

*** Variables ***
${CONFIG}       ${TESTDIR}/configs/plugins.conf
${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
${REDIS_SCOPE}  Suite
${RSPAMD_SCOPE}  Suite
${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat

*** Test Cases ***
GREYLIST NEW
  ${result} =  Scan Message With Rspamc  ${MESSAGE}
  Check Rspamc  ${result}  GREYLIST (0.00)[greylisted

GREYLIST EARLY
  ${result} =  Scan Message With Rspamc  ${MESSAGE}
  Check Rspamc  ${result}  GREYLIST (0.00)[greylisted

GREYLIST PASS
  Sleep  4s  Wait greylisting timeout
  ${result} =  Scan Message With Rspamc  ${MESSAGE}
  Check Rspamc  ${result}  GREYLIST (0.00)[pass

*** Keywords ***
Greylist Setup
  ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/greylist.conf
  Set Suite Variable  ${PLUGIN_CONFIG}
  Generic Setup  PLUGIN_CONFIG
  Run Redis

Greylist Teardown
  Normal Teardown
  Shutdown Process With Children  ${REDIS_PID}
  Terminate All Processes    kill=True