diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-01 10:00:10 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-01 10:00:10 +0000 |
commit | 0d434c6ce319dc0a0362110059af8625900f0eb4 (patch) | |
tree | 78867ac90ce4b1dc5a276705e6bf09d80384c34e /test/functional/lua | |
parent | 131c74bd2c3419c6ca6dcdd259376f489f305205 (diff) | |
download | rspamd-0d434c6ce319dc0a0362110059af8625900f0eb4.tar.gz rspamd-0d434c6ce319dc0a0362110059af8625900f0eb4.zip |
[Test] Revert tests changes
Diffstat (limited to 'test/functional/lua')
-rw-r--r-- | test/functional/lua/http.lua | 6 | ||||
-rw-r--r-- | test/functional/lua/redis.lua | 14 | ||||
-rw-r--r-- | test/functional/lua/tcp.lua | 11 |
3 files changed, 19 insertions, 12 deletions
diff --git a/test/functional/lua/http.lua b/test/functional/lua/http.lua index a433a9d93..1981c8734 100644 --- a/test/functional/lua/http.lua +++ b/test/functional/lua/http.lua @@ -43,7 +43,7 @@ local function http_symbol(task) callback = http_dns_callback, timeout = 1, }) ---[[ + rspamd_logger.errx(task, 'rspamd_http.request[before]') local err, response = rspamd_http.request({ @@ -73,7 +73,6 @@ local function http_symbol(task) else task:insert_result('HTTP_CORO_DNS_ERROR', 1.0, err) end - --]] end @@ -110,7 +109,8 @@ rspamd_config:register_symbol({ name = 'SIMPLE_TEST', score = 1.0, callback = http_symbol, -no_squeeze = true +no_squeeze = true, +flags = 'coro' }) diff --git a/test/functional/lua/redis.lua b/test/functional/lua/redis.lua index 075660063..1a1eaf2b7 100644 --- a/test/functional/lua/redis.lua +++ b/test/functional/lua/redis.lua @@ -2,11 +2,17 @@ -- Just a test for Redis API --]] +local logger = require "rspamd_logger" local redis_lua = require "lua_redis" local redis_params local N = 'redis_test' +local lua_script = [[ +local f = function() end +return "hello from lua on redis" +]] + local function redis_simple_async_symbol(task) local function redis_cb(err, data) if err then @@ -46,7 +52,7 @@ local function redis_simple_async_api201809(task) } redis_lua.request(redis_params, attrs, request) end ---[[ + local function redis_symbol(task) local attrs = {task = task} @@ -81,7 +87,7 @@ local function redis_symbol(task) task:insert_result('REDIS', 1.0, data) end ---]] + redis_params = rspamd_parse_redis_server(N) rspamd_config:register_symbol({ @@ -97,11 +103,11 @@ rspamd_config:register_symbol({ callback = redis_simple_async_api201809, no_squeeze = true }) ---[[ + rspamd_config:register_symbol({ name = 'REDIS_TEST', score = 1.0, callback = redis_symbol, - no_squeeze = true + flags = 'coro', }) -- ]] diff --git a/test/functional/lua/tcp.lua b/test/functional/lua/tcp.lua index 63c70683d..d032a049f 100644 --- a/test/functional/lua/tcp.lua +++ b/test/functional/lua/tcp.lua @@ -31,7 +31,7 @@ local function http_simple_tcp_async_symbol(task) port = 18080, }) end ---[[ + local function http_simple_tcp_symbol(task) logger.errx(task, 'connect_sync, before') @@ -171,25 +171,26 @@ local function http_tcp_symbol(task) end logger.errx(task, '(is_ok: %1) content [%2 bytes] %3', is_ok, content_length, content) end ---]] + rspamd_config:register_symbol({ name = 'SIMPLE_TCP_ASYNC_TEST', score = 1.0, callback = http_simple_tcp_async_symbol, no_squeeze = true }) ---[[ rspamd_config:register_symbol({ name = 'SIMPLE_TCP_TEST', score = 1.0, callback = http_simple_tcp_symbol, - no_squeeze = true + no_squeeze = true, + flags = 'coro', }) rspamd_config:register_symbol({ name = 'HTTP_TCP_TEST', score = 1.0, callback = http_tcp_symbol, - no_squeeze = true + no_squeeze = true, + flags = 'coro', }) -- ]] |