summaryrefslogtreecommitdiffstats
path: root/tests/imfile-escapelf.replacement.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:28:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:28:20 +0000
commitdcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch)
tree66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/imfile-escapelf.replacement.sh
parentInitial commit. (diff)
downloadrsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz
rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/imfile-escapelf.replacement.sh')
-rwxr-xr-xtests/imfile-escapelf.replacement.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/imfile-escapelf.replacement.sh b/tests/imfile-escapelf.replacement.sh
new file mode 100755
index 0000000..6039947
--- /dev/null
+++ b/tests/imfile-escapelf.replacement.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# Written in 2019 by Rainer Gerhards
+# This is part of the rsyslog testbench, licensed under ASL 2.0
+export QUEUE_EMPTY_CHECK_FUNC=wait_file_lines
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+global(workDirectory="'${RSYSLOG_DYNNAME}'.spool")
+module(load="../plugins/imfile/.libs/imfile")
+input(type="imfile" ruleset="output" escapelf.replacement="[LF]"
+ File="./'$RSYSLOG_DYNNAME'.input" tag="file:" startmsg.regex="^msg")
+
+template(name="outfmt" type="string" string="%msg%\n")
+ruleset(name="output") {
+ action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
+}
+'
+# make sure file exists when rsyslog starts up
+echo 'msg 1 part 1
+ msg 1 part 2
+msg 2
+msg INVISIBLE by design' > $RSYSLOG_DYNNAME.input
+startup
+export NUMMESSAGES=2
+shutdown_when_empty
+wait_shutdown
+export EXPECTED='msg 1 part 1[LF] msg 1 part 2
+msg 2'
+cmp_exact
+exit_test