aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-11 11:07:58 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-11 11:07:58 +0100
commit09551bcf6ad0033e5e56e53b9d2e7b05d4d91996 (patch)
tree31284f84ec39c68c672ffb8ddf4f9a205573bd02 /test
parent2ee5f7e4cdadb324aa16af67491f56a1f6fdb412 (diff)
parent36aac959a763a1fdd82b9056b43962d4ea898e38 (diff)
downloadrspamd-09551bcf6ad0033e5e56e53b9d2e7b05d4d91996.tar.gz
rspamd-09551bcf6ad0033e5e56e53b9d2e7b05d4d91996.zip
Merge branch 'master' into redis-coroutines
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/231_tcp_down.robot41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/cases/231_tcp_down.robot b/test/functional/cases/231_tcp_down.robot
new file mode 100644
index 000000000..474faa3f5
--- /dev/null
+++ b/test/functional/cases/231_tcp_down.robot
@@ -0,0 +1,41 @@
+*** Settings ***
+Test Setup Http Setup
+Test Teardown Http Teardown
+Library Process
+Library ${TESTDIR}/lib/rspamd.py
+Resource ${TESTDIR}/lib/rspamd.robot
+Variables ${TESTDIR}/lib/vars.py
+
+*** Variables ***
+# ${CONFIG} ${TESTDIR}/configs/http.conf
+${URL_TLD} ${TESTDIR}/../lua/unit/test_tld.dat
+${CONFIG} ${TESTDIR}/configs/lua_test.conf
+${MESSAGE} ${TESTDIR}/messages/spam_message.eml
+${RSPAMD_SCOPE} Test
+
+*** Test Cases ***
+
+Sync API TCP get request when server is down
+ [Documentation] We don't create HTTP server here, that's why
+ ... all requests fail with "connection refused"
+ Check url /request get HTTP_ASYNC_RESPONSE (0.00)[Socket error detected: Connection refused]
+ Check url /content-length HTTP_SYNC_WRITE_ERROR (0.00)[Socket error detected: Connection refused]
+
+
+*** Keywords ***
+Lua Setup
+ [Arguments] ${LUA_SCRIPT}
+ Set Global Variable ${LUA_SCRIPT}
+ Generic Setup
+
+Http Setup
+ Lua Setup ${TESTDIR}/lua/tcp.lua
+
+Http Teardown
+ Normal Teardown
+
+Check url
+ [Arguments] ${url} ${method} @{expect_results}
+ ${result} = Scan Message With Rspamc --header=url:${url} --header=method:${method} ${MESSAGE}
+ : FOR ${expect} IN @{expect_results}
+ \ Check Rspamc ${result} ${expect}