summaryrefslogtreecommitdiffstats
path: root/tests/omfile-outchannel.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/omfile-outchannel.sh')
-rwxr-xr-xtests/omfile-outchannel.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/omfile-outchannel.sh b/tests/omfile-outchannel.sh
new file mode 100755
index 0000000..329f844
--- /dev/null
+++ b/tests/omfile-outchannel.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# addd 2018-08-02 by RGerhards, released under ASL 2.0
+. ${srcdir:=.}/diag.sh init
+export NUMMESSAGES=10000
+echo "ls -l $RSYSLOG_DYNNAME*
+mv -f $RSYSLOG_DYNNAME.channel.log $RSYSLOG_DYNNAME.channel.log.prev
+" > $RSYSLOG_DYNNAME.rotate.sh
+chmod +x $RSYSLOG_DYNNAME.rotate.sh
+generate_conf
+add_conf '
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+module(load="builtin:omfile" template="outfmt")
+$outchannel log_rotation,'$RSYSLOG_DYNNAME.channel.log', 50000,./'$RSYSLOG_DYNNAME.rotate.sh'
+:msg, contains, "msgnum:" :omfile:$log_rotation
+'
+startup
+injectmsg
+shutdown_when_empty
+wait_shutdown
+cat $RSYSLOG_DYNNAME.channel.* > $RSYSLOG_OUT_LOG
+ls -l $RSYSLOG_DYNNAME*
+seq_check
+exit_test