rsyslog/tests/omprog-cleanup-with-outfile.sh
2017-04-13 14:07:38 +02:00

45 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# added 2016-09-09 by singh.janmejay
# This file is part of the rsyslog project, released under ASL 2.0
echo ===============================================================================
echo \[omprog-cleanup-with-outfile.sh\]: test for cleanup in omprog when used with outfile
uname
if [ `uname` = "SunOS" ] ; then
echo "Solaris: FIX ME"
exit 77
fi
. $srcdir/diag.sh init
. $srcdir/diag.sh startup omprog-cleanup-outfile.conf
. $srcdir/diag.sh wait-startup
. $srcdir/diag.sh injectmsg 0 5
sleep 1
. $srcdir/diag.sh wait-queueempty
. $srcdir/diag.sh content-check "msgnum:00000000:"
. $srcdir/diag.sh getpid
old_fd_count=$(lsof -p $pid | wc -l)
for i in $(seq 5 10); do
pkill -USR1 omprog-test-bin
sleep .1
. $srcdir/diag.sh injectmsg $i 1
sleep .1
done
sleep .5
. $srcdir/diag.sh content-check "msgnum:00000009:"
new_fd_count=$(lsof -p $pid | wc -l)
echo OLD: $old_fd_count NEW: $new_fd_count
. $srcdir/diag.sh assert-equal $old_fd_count $new_fd_count 2
cp rsyslog.out.log /tmp/
echo doing shutdown
. $srcdir/diag.sh shutdown-when-empty
echo wait on shutdown
. $srcdir/diag.sh wait-shutdown
. $srcdir/diag.sh exit