summaryrefslogtreecommitdiffstats
path: root/tests/internal-errmsg-memleak-vg.sh
blob: adc0c2af0387ae0b409ca845e543f4ca555a9770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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