summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-12-08 12:28:09 +0000
committerGitHub <noreply@github.com>2023-12-08 12:28:09 +0000
commitc01a75f18605cceac3a72a71aef5eab9cecbb59b (patch)
tree51d5940a00826274392dfafd63b5d9afd78d6b4d
parent81cfc5e27aee077f86e7e34127a3f06b849b5173 (diff)
parentd61879f0eaf7df8520beaa884203f69a07ef147b (diff)
downloadrspamd-c01a75f18605cceac3a72a71aef5eab9cecbb59b.tar.gz
rspamd-c01a75f18605cceac3a72a71aef5eab9cecbb59b.zip
Merge pull request #4733 from fatalbanana/systemd_test
[Test] Test systemd logging
-rw-r--r--test/functional/cases/410_systemd_logger.robot21
-rw-r--r--test/functional/configs/systemd-local.conf4
-rw-r--r--test/functional/configs/systemd.conf3
3 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/cases/410_systemd_logger.robot b/test/functional/cases/410_systemd_logger.robot
new file mode 100644
index 000000000..f90d16065
--- /dev/null
+++ b/test/functional/cases/410_systemd_logger.robot
@@ -0,0 +1,21 @@
+*** Settings ***
+Suite Setup Rspamd Setup
+Suite Teardown Systemd Teardown
+Library ${RSPAMD_TESTDIR}/lib/rspamd.py
+Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot
+Variables ${RSPAMD_TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${RSPAMD_TESTDIR}/configs/systemd.conf
+${RSPAMD_SCOPE} Suite
+
+*** Test Cases ***
+EMPTY TEST
+ Pass Execution No worries
+
+*** Keywords ***
+Systemd Teardown
+ Touch ${RSPAMD_TMPDIR}/rspamd.log
+ Rspamd Teardown
+ ${log} = Get File ${EXECDIR}/robot-save/rspamd.stderr.last
+ Should Match Regexp ${log} \\n\\(main\\) lua; lua_cfg_transform\\.lua:\\d+: overriding actions from the legacy metric settings\\n
diff --git a/test/functional/configs/systemd-local.conf b/test/functional/configs/systemd-local.conf
new file mode 100644
index 000000000..ed796a95e
--- /dev/null
+++ b/test/functional/configs/systemd-local.conf
@@ -0,0 +1,4 @@
+logging {
+ type = "console";
+ systemd = true;
+}
diff --git a/test/functional/configs/systemd.conf b/test/functional/configs/systemd.conf
new file mode 100644
index 000000000..f57827c48
--- /dev/null
+++ b/test/functional/configs/systemd.conf
@@ -0,0 +1,3 @@
+.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/trivial.conf"
+
+.include(priority=1,duplicate=merge) "{= env.TESTDIR =}/configs/systemd-local.conf"