rsyslog/tests/imfile-basic-legacy.sh
Rainer Gerhards c407a5a883
imfile bugfix: newstyle config default does not work on some platforms
when script based configuration is used (which is recommended), "inotify" mode
is always selected as default, except if solaris is detected, in which case
"FEN" is used.

However, there are some systems (like FreeBSD) which neithe support FEN nor
inotify. On these platforms, imfile will alwas fail if not explicitely
configured to "polling".

This patch now checks system capabilities and selects an appropriate
operations mode (the best available).
2018-11-11 12:19:20 +01:00

28 lines
774 B
Bash
Executable File

#!/bin/bash
# This is part of the rsyslog testbench, licensed under ASL 2.0
. ${srcdir:=.}/diag.sh init
NUMMESSAGES=50000
generate_conf
add_conf '
$ModLoad ../plugins/imfile/.libs/imfile
$InputFileName ./'$RSYSLOG_DYNNAME'.input
$InputFileTag file:
$InputFileStateFile stat-file1
$InputFileSeverity error
$InputFileFacility local7
$InputFileMaxLinesAtOnce 100000
$InputRunFileMonitor
$template outfmt,"%msg:F,58:2%\n"
:msg, contains, "msgnum:" action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
'
# generate input file first. Note that rsyslog processes it as
# soon as it start up (so the file should exist at that point).
./inputfilegen -m $NUMMESSAGES > $RSYSLOG_DYNNAME.input
startup
wait_file_lines
shutdown_when_empty
wait_shutdown
seq_check
exit_test