summaryrefslogtreecommitdiffstats
path: root/tests/imfile-ignore-old-file-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-ignore-old-file-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-ignore-old-file-1.sh')
-rwxr-xr-xtests/imfile-ignore-old-file-1.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/imfile-ignore-old-file-1.sh b/tests/imfile-ignore-old-file-1.sh
new file mode 100755
index 0000000..9ae660c
--- /dev/null
+++ b/tests/imfile-ignore-old-file-1.sh
@@ -0,0 +1,37 @@
+#! /bin/bash
+# Don't read a file with old timestamp
+echo [imfile-ignore-old-file-1.sh]
+. ${srcdir:=.}/diag.sh init
+. $srcdir/diag.sh check-inotify
+generate_conf
+add_conf '
+module(load="../plugins/imfile/.libs/imfile")
+input(type="imfile"
+ File="./'$RSYSLOG_DYNNAME'.input"
+ ignoreolderthan="604800"
+ Tag="file:"
+ ruleset="ruleset")
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+ruleset(name="ruleset") {
+ action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
+}
+'
+
+# create a log for testing
+./inputfilegen -m 1000 > ${RSYSLOG_DYNNAME}.input
+
+touch -m -t 201806010000.00 ./${RSYSLOG_DYNNAME}.input
+
+startup
+
+# shut down rsyslogd when done processing messages
+shutdown_when_empty
+# we need to wait until rsyslogd is finished!
+wait_shutdown
+
+if ls ${RSYSLOG_OUT_LOG} > /dev/null; then
+ echo "FAIL: rsyslog.out.log isn't expected to be generated!"
+ exit 1
+fi
+
+exit_test