"Fossies" - the Fresh Open Source Software Archive

Member "rspamd-1.8.3/test/functional/cases/108_settings.robot" (3 Dec 2018, 2844 Bytes) of package /linux/misc/rspamd-1.8.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 *** Settings ***
    2 Suite Setup     Settings Setup
    3 Suite Teardown  Settings Teardown
    4 Library         ${TESTDIR}/lib/rspamd.py
    5 Resource        ${TESTDIR}/lib/rspamd.robot
    6 Variables       ${TESTDIR}/lib/vars.py
    7 
    8 *** Variables ***
    9 ${CONFIG}       ${TESTDIR}/configs/plugins.conf
   10 ${LUA_SCRIPT}   ${TESTDIR}/lua/settings.lua
   11 ${MESSAGE}      ${TESTDIR}/messages/spam_message.eml
   12 ${RSPAMD_SCOPE}  Suite
   13 ${URL_TLD}      ${TESTDIR}/../lua/unit/test_tld.dat
   14 
   15 *** Test Cases ***
   16 NO SETTINGS
   17   ${result} =  Scan Message With Rspamc  ${MESSAGE}
   18   Check Rspamc  ${result}  SIMPLE_TEST
   19   Should Contain  ${result.stdout}  SIMPLE_PRE
   20   Should Contain  ${result.stdout}  SIMPLE_POST
   21 
   22 ENABLE SYMBOL - NORMAL
   23   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SIMPLE_TEST"]}
   24   Check Rspamc  ${result}  SIMPLE_TEST
   25   Should Not Contain  ${result.stdout}  SIMPLE_PRE
   26   Should Not Contain  ${result.stdout}  SIMPLE_POST
   27 
   28 ENABLE SYMBOL - POSTFILTER
   29   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SIMPLE_TEST", "SIMPLE_POST"]}
   30   Check Rspamc  ${result}  SIMPLE_TEST
   31   Should Contain  ${result.stdout}  SIMPLE_POST
   32   Should Not Contain  ${result.stdout}  SIMPLE_PRE
   33 
   34 ENABLE SYMBOL - PREFILTER
   35   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_enabled = ["SIMPLE_PRE"]}
   36   Check Rspamc  ${result}  SIMPLE_PRE
   37   Should Not Contain  ${result.stdout}  SIMPLE_POST
   38   Should Not Contain  ${result.stdout}  SIMPLE_TEST
   39 
   40 DISABLE SYMBOL - NORMAL
   41   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={symbols_disabled = ["SIMPLE_TEST"]}
   42   Check Rspamc  ${result}  SIMPLE_TEST  inverse=1
   43   Should Contain  ${result.stdout}  SIMPLE_PRE
   44   Should Contain  ${result.stdout}  SIMPLE_POST
   45 
   46 RESCORE SYMBOL - NORMAL
   47   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={SIMPLE_TEST = 3.33}
   48   Check Rspamc  ${result}  SIMPLE_TEST (3.33)
   49 
   50 RESCORE ACTION
   51   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={actions { reject = 1234.5; } }
   52   Check Rspamc  ${result}  ${SPACE}/ 1234.50
   53 
   54 DISABLE GROUP - NORMAL
   55   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={groups_disabled = ["b"]}
   56   Check Rspamc  ${result}  SIMPLE_TEST  inverse=1
   57   Should Contain  ${result.stdout}  SIMPLE_PRE
   58   Should Contain  ${result.stdout}  SIMPLE_POST
   59 
   60 ENABLE GROUP - NORMAL
   61   ${result} =  Scan Message With Rspamc  ${MESSAGE}  --header  Settings={groups_enabled = ["b"]}
   62   Check Rspamc  ${result}  SIMPLE_TEST
   63   Should Not Contain  ${result.stdout}  SIMPLE_PRE
   64   Should Not Contain  ${result.stdout}  SIMPLE_POST
   65 
   66 *** Keywords ***
   67 Settings Setup
   68   ${PLUGIN_CONFIG} =  Get File  ${TESTDIR}/configs/settings.conf
   69   Set Suite Variable  ${PLUGIN_CONFIG}
   70   Generic Setup  PLUGIN_CONFIG
   71 
   72 Settings Teardown
   73   Normal Teardown