summaryrefslogtreecommitdiffstats
path: root/tests/internal-errmsg-memleak-vg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/internal-errmsg-memleak-vg.sh')
-rwxr-xr-xtests/internal-errmsg-memleak-vg.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/internal-errmsg-memleak-vg.sh b/tests/internal-errmsg-memleak-vg.sh
new file mode 100755
index 0000000..adc0c2a
--- /dev/null
+++ b/tests/internal-errmsg-memleak-vg.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# This tests a memory leak we have seen when processing internal error
+# message with the settings used in this test. We use imfile as it is
+# easist to reproduce this way. Note that we are only interested in
+# whether or not we have a leak, not any other functionality. Most
+# importantly, we do not care if the error message appears or not. This
+# is because it is not so easy to pick it up from the system log and other
+# tests already cover this scenario.
+# add 2017-05-10 by Rainer Gerhards, released under ASL 2.0
+
+uname
+if [ $(uname) = "FreeBSD" ] ; then
+ echo "This test currently does not work on FreeBSD."
+ exit 77
+fi
+
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+global(processInternalMessages="off")
+$RepeatedMsgReduction on # keep this on because many distros have set it
+
+module(load="../plugins/imfile/.libs/imfile") # mode="polling" pollingInterval="1")
+input(type="imfile" File="./'$RSYSLOG_DYNNAME'.input" Tag="tag1" ruleset="ruleset1")
+
+template(name="tmpl1" type="string" string="%msg%\n")
+ruleset(name="ruleset1") {
+ action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="tmpl1")
+}
+action(type="omfile" file=`echo $RSYSLOG2_OUT_LOG`)
+'
+startup_vg_waitpid_only
+./msleep 500 # wait a bit so that the error message can be emitted
+shutdown_immediate
+wait_shutdown_vg
+
+exit_test