]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Mark error with symbol in response 2478/head
authorMikhail Galanin <mgalanin@mimecast.com>
Mon, 10 Sep 2018 14:35:52 +0000 (15:35 +0100)
committerMikhail Galanin <mgalanin@mimecast.com>
Mon, 10 Sep 2018 14:35:52 +0000 (15:35 +0100)
test/functional/lua/tcp.lua

index 21bb0c6e7291d708f7b9f5e0d128f001e00eae65..30285c4f5954d470e82da07bedb5aa5adbedd0d7 100644 (file)
@@ -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')