rsyslog/tests/imtcp-multiport.sh
Rainer Gerhards aba90e8248 added capability to run multiple tcp listeners (on different ports)
Well, actually this and a lot of related things. I improved the
testbench so that the new capabilities are automatically tested and
also did some general cleanup. The current multiple tcp listener
solution will probably receive some further cleanup, too, but looks
quite OK so far. I also reviewed the way tcpsrv et all work, in
preparation of using this code for imdiag. I need to document the
findings, especially as the code is rather complicated "thanks" to
the combination of plain tcp and gssapi transport modes.
2009-05-22 17:06:52 +02:00

81 lines
2.5 KiB
Bash
Executable File

# Test for multiple ports in imtcp
# This test checks if multiple tcp listener ports are correctly
# handled by imtcp
#
# NOTE: this test must (and can) be enhanced when we merge in the
# upgraded tcpflood program
#
# added 2009-05-22 by Rgerhards
# This file is part of the rsyslog project, released under GPLv3
echo testing imtcp multiple listeners
rm -f work rsyslog.out.log rsyslog.out.log.save # work files
../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/imtcp-multiport.conf &
sleep 1
echo "rsyslogd started with pid " `cat rsyslog.pid`
./tcpflood 127.0.0.1 13514 1 10000
if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
sleep 2 # we need this so that rsyslogd can receive all outstanding messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
./chkseq work 0 9999
if [ "$?" -ne "0" ]; then
# rm -f work rsyslog.out.log
echo "sequence error detected"
exit 1
fi
rm -f work rsyslog.out.log
#
#
# ### now complete new cycle with other port ###
#
#
rm -f work rsyslog.out.log rsyslog.out.log.save # work files
../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/imtcp-multiport.conf &
sleep 1
echo "rsyslogd started with pid " `cat rsyslog.pid`
./tcpflood 127.0.0.1 13515 1 10000
if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
sleep 2 # we need this so that rsyslogd can receive all outstanding messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
./chkseq work 0 9999
if [ "$?" -ne "0" ]; then
# rm -f work rsyslog.out.log
echo "sequence error detected"
exit 1
fi
rm -f work rsyslog.out.log
#
#
# ### now complete new cycle with other port ###
#
#
rm -f work rsyslog.out.log rsyslog.out.log.save # work files
../tools/rsyslogd -c4 -u2 -n -irsyslog.pid -M../runtime/.libs:../.libs -f$srcdir/testsuites/imtcp-multiport.conf &
sleep 1
echo "rsyslogd started with pid " `cat rsyslog.pid`
./tcpflood 127.0.0.1 13516 1 10000
if [ "$?" -ne "0" ]; then
echo "error during tcpflood! see rsyslog.out.log.save for what was written"
cp rsyslog.out.log rsyslog.out.log.save
fi
sleep 2 # we need this so that rsyslogd can receive all outstanding messages
kill `cat rsyslog.pid`
rm -f work
sort < rsyslog.out.log > work
./chkseq work 0 9999
if [ "$?" -ne "0" ]; then
# rm -f work rsyslog.out.log
echo "sequence error detected"
exit 1
fi
rm -f work rsyslog.out.log