mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-20 07:20:41 +01:00
The problem checked with this test has now been fixed. This activates the test inside the testbench to guard against future regressions. It also changes the test, because the old construct caused trucation and immediate rewrite with the same nubmer of bytes, so that the trucation could not be detected.
47 lines
1.0 KiB
Bash
Executable File
47 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# addd 2016-10-06 by RGerhards, released under ASL 2.0
|
|
. $srcdir/diag.sh init
|
|
. $srcdir/diag.sh generate-conf
|
|
. $srcdir/diag.sh add-conf '
|
|
module(load="../plugins/imfile/.libs/imfile")
|
|
|
|
input(type="imfile"
|
|
File="./rsyslog.input"
|
|
Tag="file:"
|
|
reopenOnTruncate="on"
|
|
)
|
|
|
|
template(name="outfmt" type="string" string="%msg:F,58:2%\n")
|
|
|
|
if $msg contains "msgnum:" then
|
|
action(
|
|
type="omfile"
|
|
file="rsyslog.out.log"
|
|
template="outfmt"
|
|
)
|
|
'
|
|
. $srcdir/diag.sh startup
|
|
|
|
# write the beginning of the file
|
|
echo 'msgnum:0
|
|
msgnum:1' > rsyslog.input
|
|
|
|
# sleep a little to give rsyslog a chance to begin processing
|
|
sleep 1
|
|
|
|
# truncate and write some more lines (see https://github.com/rsyslog/rsyslog/issues/1090)
|
|
echo 'msgnum:2' > rsyslog.input
|
|
# sleep some more
|
|
sleep 1
|
|
echo 'msgnum:3
|
|
msgnum:4' >> rsyslog.input
|
|
|
|
# give it time to finish
|
|
sleep 1
|
|
|
|
. $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
|
|
. $srcdir/diag.sh wait-shutdown
|
|
|
|
. $srcdir/diag.sh seq-check 0 4
|
|
. $srcdir/diag.sh exit
|