rsyslog/tests/threadingmqaq.sh
2017-04-13 14:07:38 +02:00

30 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# test many concurrent tcp connections
# we send 100,000 messages in the hopes that his puts at least a little bit
# of pressure on the threading subsystem. To really prove it, we would need to
# push messages for several minutes, but that takes too long during the
# automatted tests (hint: do this manually after suspect changes). Thankfully,
# in practice many threading bugs result in an abort rather quickly and these
# should be covered by this test here.
# rgerhards, 2009-06-26
echo \[threadingmqaq.sh\]: main/action queue concurrency
uname
if [ `uname` = "SunOS" ] ; then
echo "This test currently does not work on all flavors of Solaris."
exit 77
fi
. $srcdir/diag.sh init
. $srcdir/diag.sh startup threadingmqaq.conf
#. $srcdir/diag.sh tcpflood -c2 -m100000
#. $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
. $srcdir/diag.sh injectmsg 0 100000
# we need to sleep a bit on some environments, as imdiag can not correctly
# diagnose when the action queues are empty...
sleep 3
. $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
. $srcdir/diag.sh wait-shutdown
. $srcdir/diag.sh seq-check 0 99999
. $srcdir/diag.sh exit