You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109_composites.robot 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. *** Settings ***
  2. Suite Setup Generic Setup
  3. Suite Teardown Simple Teardown
  4. Library ${TESTDIR}/lib/rspamd.py
  5. Resource ${TESTDIR}/lib/rspamd.robot
  6. Variables ${TESTDIR}/lib/vars.py
  7. *** Variables ***
  8. ${CONFIG} ${TESTDIR}/configs/composites.conf
  9. ${LUA_SCRIPT} ${TESTDIR}/lua/composites.lua
  10. ${MESSAGE} ${TESTDIR}/messages/spam_message.eml
  11. ${RSPAMD_SCOPE} Suite
  12. *** Test Cases ***
  13. Composites - Score
  14. ${result} = Scan Message With Rspamc ${MESSAGE}
  15. Check Rspamc ${result} ${SPACE}50.00 / 0.00
  16. Composites - Expressions
  17. ${result} = Scan Message With Rspamc ${MESSAGE}
  18. Check Rspamc ${result} EXPRESSIONS (5.00)
  19. Should Contain ${result.stdout} EXPRESSIONS_B (0.00)
  20. Composites - Policy: remove_weight
  21. ${result} = Scan Message With Rspamc ${MESSAGE}
  22. Check Rspamc ${result} ${SPACE}POLICY_REMOVE_WEIGHT (5.00)
  23. Should Not Contain ${result.stdout} ${SPACE}POLICY_REMOVE_WEIGHT_A (1.00)
  24. Should Contain ${result.stdout} ${SPACE}POLICY_REMOVE_WEIGHT_B (0.00)
  25. Composites - Policy: force removing
  26. ${result} = Scan Message With Rspamc ${MESSAGE}
  27. Check Rspamc ${result} ${SPACE}POLICY_FORCE_REMOVE (5.00)
  28. Should Contain ${result.stdout} ${SPACE}POLICY_FORCE_REMOVE_A (1.00)
  29. Should Not Contain ${result.stdout} ${SPACE}POLICY_FORCE_REMOVE_B
  30. Composites - Policy: leave
  31. ${result} = Scan Message With Rspamc ${MESSAGE}
  32. Check Rspamc ${result} ${SPACE}POLICY_LEAVE (5.00)
  33. Should Not Contain ${result.stdout} ${SPACE}POLICY_LEAVE_A
  34. Should Contain ${result.stdout} ${SPACE}POLICY_LEAVE_B (1.00)
  35. Composites - Default policy: remove_weight
  36. ${result} = Scan Message With Rspamc ${MESSAGE}
  37. Check Rspamc ${result} DEFAULT_POLICY_REMOVE_WEIGHT (5.00)
  38. Should Contain ${result.stdout} DEFAULT_POLICY_REMOVE_WEIGHT_A (0.00)
  39. Should Contain ${result.stdout} DEFAULT_POLICY_REMOVE_WEIGHT_B (0.00)
  40. Composites - Default policy: remove_symbol
  41. ${result} = Scan Message With Rspamc ${MESSAGE}
  42. Check Rspamc ${result} DEFAULT_POLICY_REMOVE_SYMBOL (5.00)
  43. Should Not Contain ${result.stdout} DEFAULT_POLICY_REMOVE_SYMBOL_
  44. Composites - Default policy: leave
  45. ${result} = Scan Message With Rspamc ${MESSAGE}
  46. Check Rspamc ${result} DEFAULT_POLICY_LEAVE (5.00)
  47. Should Contain ${result.stdout} DEFAULT_POLICY_LEAVE_A (1.00)
  48. Should Contain ${result.stdout} DEFAULT_POLICY_LEAVE_B (1.00)
  49. Composites - Symbol groups
  50. ${result} = Scan Message With Rspamc ${MESSAGE}
  51. Check Rspamc ${result} SYMBOL_GROUPS (5.00)
  52. Should Contain ${result.stdout} POSITIVE_A (-1.00)
  53. Should Contain ${result.stdout} ANY_A (-1.00)
  54. Should Contain ${result.stdout} NEGATIVE_B (1.00)
  55. Should Not Contain ${result.stdout} NEGATIVE_A