From: Mikhail Galanin Date: Mon, 10 Sep 2018 13:50:13 +0000 (+0100) Subject: [Test] Added test case for error handling check X-Git-Tag: 1.8.0~144^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6abc2ca8d91c302cb2a7bb38cf9b162770d5528a;p=thirdparty%2Frspamd.git [Test] Added test case for error handling check --- diff --git a/test/functional/cases/231_tcp_down.robot b/test/functional/cases/231_tcp_down.robot new file mode 100644 index 0000000000..474faa3f55 --- /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}