summaryrefslogtreecommitdiffstats
path: root/tests/imfile-persist-state-1.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-persist-state-1.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-persist-state-1.sh')
-rwxr-xr-xtests/imfile-persist-state-1.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/imfile-persist-state-1.sh b/tests/imfile-persist-state-1.sh
new file mode 100755
index 0000000..f3fe3ee
--- /dev/null
+++ b/tests/imfile-persist-state-1.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# added 2016-11-02 by rgerhards
+# This is part of the rsyslog testbench, licensed under ASL 2.0
+. ${srcdir:=.}/diag.sh init
+. $srcdir/diag.sh check-inotify
+generate_conf
+add_conf '
+global(workDirectory="'${RSYSLOG_DYNNAME}'.spool")
+
+module(load="../plugins/imfile/.libs/imfile")
+
+input( type="imfile"
+ file="./'$RSYSLOG_DYNNAME'.input"
+ tag="file:"
+ startmsg.regex="^msgnum"
+ PersistStateInterval="1"
+)
+
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+if $msg contains "msgnum:" then
+ action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="outfmt")
+'
+# generate input file first. Note that rsyslog processes it as
+# soon as it start up (so the file should exist at that point).
+./inputfilegen -m5 -d4000 > $RSYSLOG_DYNNAME.input
+startup
+shutdown_when_empty
+wait_shutdown
+seq_check 0 3
+exit_test