summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-10 15:35:52 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-10 15:35:52 +0100
commit352bf6f96a93599883eaeb5954c09d01181d83e7 (patch)
tree2581e736ff9cbdb67672a03c2f099ce5d99073ca /test/functional
parent6abc2ca8d91c302cb2a7bb38cf9b162770d5528a (diff)
downloadrspamd-352bf6f96a93599883eaeb5954c09d01181d83e7.tar.gz
rspamd-352bf6f96a93599883eaeb5954c09d01181d83e7.zip
[Test] Mark error with symbol in response
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/lua/tcp.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/lua/tcp.lua b/test/functional/lua/tcp.lua
index 21bb0c6e7..30285c4f5 100644
--- a/test/functional/lua/tcp.lua
+++ b/test/functional/lua/tcp.lua
@@ -20,7 +20,7 @@ local function http_simple_tcp_async_symbol(task)
local function http_read_cb(err, data, conn)
logger.errx(task, 'http_read_cb: got reply: %s, error: %s, conn: %s', data, err, conn)
conn:add_write(http_read_post_cb, "POST /request2 HTTP/1.1\r\n\r\n")
- task:insert_result('HTTP_ASYNC_RESPONSE', 1.0, data)
+ task:insert_result('HTTP_ASYNC_RESPONSE', 1.0, data or err)
end
rspamd_tcp:request({
task = task,
@@ -43,6 +43,11 @@ local function http_simple_tcp_symbol(task)
port = 18080,
}
+ if not is_ok then
+ task:insert_result('HTTP_SYNC_WRITE_ERROR', 1.0, connection)
+ logger.errx(task, 'write error: %1', connection)
+ end
+
logger.errx(task, 'connect_sync %1, %2', is_ok, tostring(connection))
is_ok, err = connection:write('GET /request_sync HTTP/1.1\r\nConnection: keep-alive\r\n\r\n')