rsyslog/tests/omusrmsg-noabort.sh
Rainer Gerhards 1f864ec519
testbench: make omusrmsg-noabort test more reliable
The previous test did not always detect an abort of rsyslog/omusrmsg.
The detection method has now been improved, so it is far more
probable that an abort is detected.

While doing this, we noticed that the omusrmsg-noabort-legacy test was
now a 100% duplicate. There is no need any longer to check pure legacy
syntax, and so that test has been removed.

We also added a valgrind-based test ofr omusrmsg-noabort, which furthers
strengthens bug detection. Most importantly, it helps us to detect
potentially new memory leaks on all CI platforms (in case the lib
behaves differently depending on os/distro).

see also https://github.com/rsyslog/rsyslog/issues/5294
2023-12-14 14:43:23 +01:00

24 lines
715 B
Bash
Executable File

#!/bin/bash
# same as omusrmsg-noabort, but with legacy syntax.
# addd 2018-08-05 by RGerhards, released under ASL 2.0
. ${srcdir:=.}/diag.sh init
export NUMMESSAGES=10
export QUEUE_EMPTY_CHECK_FUNC=wait_file_lines
generate_conf
add_conf '
template(name="outfmt" type="string" string="%msg:F,58:2%\n")
:msg, contains, "msgnum:" {
action(type="omusrmsg" users="nouser" template="outfmt")
action(type="omfile" template="outfmt" file="'$RSYSLOG_OUT_LOG'")
}
'
startup
injectmsg
shutdown_when_empty
wait_shutdown
# while we cannot check if the messages arrived in user sessions, we
# can check that all messages arrive in the file, which we consider as
# an indication that everything went well.
seq_check
exit_test