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.

140_proxy.robot 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. *** Settings ***
  2. Suite Setup Proxy Setup
  3. Suite Teardown Proxy Teardown
  4. Library ${TESTDIR}/lib/rspamd.py
  5. Resource ${TESTDIR}/lib/rspamd.robot
  6. Variables ${TESTDIR}/lib/vars.py
  7. *** Variables ***
  8. ${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua
  9. ${MESSAGE} ${TESTDIR}/messages/spam_message.eml
  10. ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
  11. *** Test Cases ***
  12. Rspamc Client
  13. ${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_PROXY} -p ${MESSAGE}
  14. Run Keyword If ${result.rc} != 0 Log ${result.stderr}
  15. Should Contain ${result.stdout} SIMPLE_TEST
  16. Should Be Equal As Integers ${result.rc} 0
  17. SPAMC
  18. ${result} = Spamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
  19. Should Contain ${result} SPAMD/1.1 0 EX_OK
  20. RSPAMC Legacy Protocol
  21. ${result} = Rspamc ${LOCAL_ADDR} ${PORT_PROXY} ${MESSAGE}
  22. Should Contain ${result} RSPAMD/1.3 0 EX_OK
  23. *** Keywords ***
  24. Proxy Setup
  25. &{d} = Run Rspamd CONFIG=${TESTDIR}/configs/lua_test.conf
  26. Set Suite Variable ${SLAVE_PID} ${d}[RSPAMD_PID]
  27. Set Suite Variable ${SLAVE_TMPDIR} ${d}[TMPDIR]
  28. &{d} = Run Rspamd CONFIG=${TESTDIR}/configs/proxy.conf
  29. Set Suite Variable ${PROXY_PID} ${d}[RSPAMD_PID]
  30. Set Suite Variable ${PROXY_TMPDIR} ${d}[TMPDIR]
  31. Proxy Teardown
  32. Shutdown Process With Children ${PROXY_PID}
  33. Shutdown Process With Children ${SLAVE_PID}
  34. Cleanup Temporary Directory ${PROXY_TMPDIR}
  35. Cleanup Temporary Directory ${SLAVE_TMPDIR}