rsyslog/tests/imptcp_large.sh
2018-11-30 18:54:07 +01:00

27 lines
750 B
Bash
Executable File

#!/bin/bash
# Test imptcp with large messages
# added 2010-08-10 by Rgerhards
# This file is part of the rsyslog project, released under ASL 2.0
. ${srcdir:=.}/diag.sh init
export NUMMESSAGES=20000
generate_conf
add_conf '
global(maxMessageSize="10k")
template(name="outfmt" type="string" string="%msg:F,58:2%,%msg:F,58:3%,%msg:F,58:4%\n")
module(load="../plugins/imptcp/.libs/imptcp")
input(type="imptcp" port="'$TCPFLOOD_PORT'" ruleset="testing")
ruleset(name="testing") {
action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
}
'
startup
# send messages of 10.000bytes plus header max, randomized
tcpflood -c5 -m$NUMMESSAGES -r -d10000
wait_file_lines
shutdown_when_empty
wait_shutdown
seq_check 0 $((NUMMESSAGES - 1)) -E
exit_test