rsyslog/tests/random.sh
Rainer Gerhards 4adfefe090
testbench: another step towards parallel testing
Merging in multiple steps to avoid getting new tests with non-correct
plumbing.

- some more dynamic file names
- convert more commands to pure bash functions
- cleanup no longer neede files
2018-08-22 14:56:07 +02:00

32 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Test if rsyslog survives sending truely random data to it...
#
# added 2010-04-01 by Rgerhards
# This file is part of the rsyslog project, released under ASL 2.0
. $srcdir/diag.sh init
generate_conf
add_conf '
# The random data will generate TCP framing error messages. We will
# not clutter the test output with them. So we disable error messages
# to stderr.
$ErrorMessagesToStderr off
$ModLoad ../plugins/imtcp/.libs/imtcp
$MainMsgQueueTimeoutShutdown 10000
$InputTCPServerRun '$TCPFLOOD_PORT'
$template outfmt,"%rawmsg%\n"
template(name="dynfile" type="string" string=`echo $RSYSLOG_OUT_LOG`) # trick to use relative path names!
*.* /dev/null
'
startup
# generate random data
./randomgen -f $RSYSLOG_DYNNAME.random.data -s 100000
ls -l $RSYSLOG_DYNNAME.random.data
tcpflood -B -I $RSYSLOG_DYNNAME.random.data -c5 -C10
shutdown_when_empty # shut down rsyslogd when done processing messages
wait_shutdown # and wait for it to terminate
# we do not check anything yet, the point is if rsyslog survived ;)
# TODO: check for exit message, but we'll notice an abort anyhow, so not that important
exit_test