| 1 |
#!/bin/bash |
| 2 |
# added 2024-02-19 by rgerhards. Released under ASL 2.0 |
| 3 |
# This test is not meant to be executed independetly. It just permits |
| 4 |
# to be called by different drivers with different io buffer sizes. |
| 5 |
# This in turn is needed to test some edge cases. |
| 6 |
. ${srcdir:=.}/diag.sh init |
| 7 |
skip_platform "SunOS" "This test is currently not supported on solaris due to too-different timing" |
| 8 |
generate_conf |
| 9 |
export NUMMESSAGES=2000 |
| 10 |
|
| 11 |
# starting minitcpsrvr receivers so that we can obtain their port |
| 12 |
# numbers |
| 13 |
export MINITCPSRV_EXTRA_OPTS="-D900 -B2 -a -S5" |
| 14 |
start_minitcpsrvr $RSYSLOG_OUT_LOG 1 |
| 15 |
|
| 16 |
add_conf ' |
| 17 |
$MainMsgQueueTimeoutShutdown 10000 |
| 18 |
$MainMsgQueueDequeueBatchSize 100 |
| 19 |
|
| 20 |
global(allMessagesToStderr="on") |
| 21 |
|
| 22 |
template(name="outfmt" type="string" string="%msg:F,58:2%\n") |
| 23 |
module(load="builtin:omfwd" template="outfmt" iobuffer.maxSize="'$OMFWD_IOBUF_SIZE'") |
| 24 |
|
| 25 |
if $msg contains "msgnum:" then { |
| 26 |
action(type="omfwd" target=["127.0.0.1"] port="'$MINITCPSRVR_PORT1'" protocol="tcp" |
| 27 |
pool.resumeInterval="2" |
| 28 |
action.reportsuspensioncontinuation="on" |
| 29 |
action.resumeRetryCount="-1" action.resumeInterval="3") |
| 30 |
} |
| 31 |
' |
| 32 |
echo Note: intentionally not started any local TCP receiver! |
| 33 |
|
| 34 |
# now do the usual run |
| 35 |
startup |
| 36 |
|
| 37 |
injectmsg |
| 38 |
shutdown_when_empty |
| 39 |
wait_shutdown |
| 40 |
# note: minitcpsrv shuts down automatically if the connection is closed! |
| 41 |
|
| 42 |
export SEQ_CHECK_OPTIONS=-d |
| 43 |
#permit 250 messages to be lost in this extreme test (-m 250) |
| 44 |
seq_check 0 $((NUMMESSAGES-1)) -m250 |
| 45 |
exit_test |