summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-12-06 15:24:20 +0000
committerGitHub <noreply@github.com>2023-12-06 15:24:20 +0000
commit6bf7c1a1b3fccd245c149c562c19783f68311e0e (patch)
treeb85e6a75690a78fa2bda1fa0ee116906eab7c6bb
parent537f28b8700503c64d4d7ea188dfba8a379a04d3 (diff)
parent356574a219e1b5ac22017d9d152e9b48fde6fe25 (diff)
downloadrspamd-6bf7c1a1b3fccd245c149c562c19783f68311e0e.tar.gz
rspamd-6bf7c1a1b3fccd245c149c562c19783f68311e0e.zip
Merge pull request #4728 from fatalbanana/test_rspamadm_logger
[Test] Exercise rspamadm lua logger in functional tests
-rw-r--r--test/functional/cases/150_rspamadm.robot9
-rw-r--r--test/functional/lua/rspamadm/test_batch.lua5
-rw-r--r--test/functional/lua/rspamadm/test_verbose.lua3
3 files changed, 14 insertions, 3 deletions
diff --git a/test/functional/cases/150_rspamadm.robot b/test/functional/cases/150_rspamadm.robot
index 879d4d7e8..83229dd11 100644
--- a/test/functional/cases/150_rspamadm.robot
+++ b/test/functional/cases/150_rspamadm.robot
@@ -34,7 +34,12 @@ Process message callback
Lua batch mode
${result} = Run Process ${RSPAMADM} lua -b ${RSPAMD_TESTDIR}/lua/rspamadm/test_batch.lua
- Should Match Regexp ${result.stderr} ^$
+ Should Be Equal ${result.stderr} hello world
+ Should Match Regexp ${result.stdout} ^$
Should Be Equal As Integers ${result.rc} 0
- Should Be Equal ${result.stdout} hello world
+Verbose mode
+ ${result} = Run Process ${RSPAMADM} -v lua ${RSPAMD_TESTDIR}/lua/rspamadm/test_verbose.lua
+ Should Match Regexp ${result.stderr} ^$
+ Should Match Regexp ${result.stdout} hello world\n
+ Should Be Equal As Integers ${result.rc} 0
diff --git a/test/functional/lua/rspamadm/test_batch.lua b/test/functional/lua/rspamadm/test_batch.lua
index e75154b7c..dd50c9db5 100644
--- a/test/functional/lua/rspamadm/test_batch.lua
+++ b/test/functional/lua/rspamadm/test_batch.lua
@@ -1 +1,4 @@
-print("hello world") \ No newline at end of file
+local rspamd_logger = require "rspamd_logger"
+
+rspamd_logger.info(rspamd_config, "nope")
+rspamd_logger.err(rspamd_config, "hello world")
diff --git a/test/functional/lua/rspamadm/test_verbose.lua b/test/functional/lua/rspamadm/test_verbose.lua
new file mode 100644
index 000000000..4470c63e2
--- /dev/null
+++ b/test/functional/lua/rspamadm/test_verbose.lua
@@ -0,0 +1,3 @@
+local rspamd_logger = require "rspamd_logger"
+
+rspamd_logger.info(rspamd_config, "hello world")