rsyslog/tests/pmnormalize-neither_rule_rulebase.sh
Rainer Gerhards 1ee1da9410
pmnormalize: fix memory leak, improve tests
This patch fixes a set of problems plus provides more and enhanced
tests for the module.

Most important problem was a memory leak that occured when a message
could not be passed at all. For each message that could not be parsed
memory of at least the size the message is leaked. Depending on
traffic pattern this can quickly lead to OOM. Note, however, that
this leak was never reported - it was discovered as part of code
review.

closes https://github.com/rsyslog/rsyslog/issues/2007
2019-04-10 13:15:01 +02:00

16 lines
402 B
Bash
Executable File

#!/bin/bash
# add 2019-04-10 by Rainer Gerhards, released under ASL 2.0
. ${srcdir:=.}/diag.sh init
generate_conf
add_conf '
module(load="../plugins/pmnormalize/.libs/pmnormalize")
parser(name="custom.pmnormalize" type="pmnormalize")
action(type="omfile" file="'$RSYSLOG_OUT_LOG'")
'
startup
shutdown_when_empty
wait_shutdown
content_check --regex "pmnormalize:.*you need to specify either"
exit_test