]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Test systemd logging 4733/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 8 Dec 2023 10:51:08 +0000 (12:51 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 8 Dec 2023 11:22:43 +0000 (13:22 +0200)
test/functional/cases/410_systemd_logger.robot [new file with mode: 0644]
test/functional/configs/systemd-local.conf [new file with mode: 0644]
test/functional/configs/systemd.conf [new file with mode: 0644]

diff --git a/test/functional/cases/410_systemd_logger.robot b/test/functional/cases/410_systemd_logger.robot
new file mode 100644 (file)
index 0000000..f90d160
--- /dev/null
@@ -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 (file)
index 0000000..ed796a9
--- /dev/null
@@ -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 (file)
index 0000000..f57827c
--- /dev/null
@@ -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"