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.

231_tcp_down.robot 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. *** Settings ***
  2. Test Setup Http Setup
  3. Test Teardown Http Teardown
  4. Library Process
  5. Library ${TESTDIR}/lib/rspamd.py
  6. Resource ${TESTDIR}/lib/rspamd.robot
  7. Variables ${TESTDIR}/lib/vars.py
  8. *** Variables ***
  9. # ${CONFIG} ${TESTDIR}/configs/http.conf
  10. ${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
  11. ${CONFIG} ${TESTDIR}/configs/lua_test.conf
  12. ${MESSAGE} ${TESTDIR}/messages/spam_message.eml
  13. ${RSPAMD_SCOPE} Test
  14. *** Test Cases ***
  15. Sync API TCP get request when server is down
  16. [Documentation] We don't create HTTP server here, that's why
  17. ... all requests fail with "connection refused"
  18. Check url /request get HTTP_ASYNC_RESPONSE (0.00)[Socket error detected: Connection refused]
  19. Check url /content-length HTTP_SYNC_WRITE_ERROR (0.00)[Socket error detected: Connection refused]
  20. *** Keywords ***
  21. Lua Setup
  22. [Arguments] ${LUA_SCRIPT}
  23. Set Suite Variable ${LUA_SCRIPT}
  24. Generic Setup
  25. Http Setup
  26. Lua Setup ${TESTDIR}/lua/tcp.lua
  27. Http Teardown
  28. Normal Teardown
  29. Check url
  30. [Arguments] ${url} ${method} @{expect_results}
  31. ${result} = Scan Message With Rspamc --header=url:${url} --header=method:${method} ${MESSAGE}
  32. FOR ${expect} IN @{expect_results}
  33. Check Rspamc ${result} ${expect}
  34. END