From 352bf6f96a93599883eaeb5954c09d01181d83e7 Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Mon, 10 Sep 2018 15:35:52 +0100 Subject: [PATCH] [Test] Mark error with symbol in response --- test/functional/lua/tcp.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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') -- 2.39.5