Skip to content

Commit

Permalink
Merge pull request #5209 from rgerhards/testbench-imfile-state-file-dir2
Browse files Browse the repository at this point in the history
testbench: cleanup and improve some more imfile tests
  • Loading branch information
rgerhards committed Aug 2, 2023
2 parents 60d8abd + d6adb68 commit edf5c69
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 15 deletions.
8 changes: 5 additions & 3 deletions tests/imfile-endmsg.regex-vg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
USE_VALGRIND=true
echo ======================================================================
echo [imfile-endmsg.regex.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
Expand All @@ -29,7 +31,7 @@ if $msg contains "msgnum:" then
template="outfmt"
)
'
if [ "x${USE_VALGRIND:-false}" == "xtrue" ] ; then
if [ "${USE_VALGRIND:-false}" == "true" ] ; then
startup_vg
else
startup
Expand Down Expand Up @@ -66,7 +68,7 @@ echo 'date stdout F msgnum:6' >> $RSYSLOG_DYNNAME.crio.input
echo 'date stdout P msgnum:7' >> $RSYSLOG_DYNNAME.crio.input

shutdown_when_empty # shut down rsyslogd when done processing messages
if [ "x${USE_VALGRIND:-false}" == "xtrue" ] ; then
if [ "${USE_VALGRIND:-false}" == "true" ] ; then
wait_shutdown_vg
check_exit_vg
else
Expand Down
8 changes: 5 additions & 3 deletions tests/imfile-endmsg.regex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
# This test tests imfile endmsg.regex.
echo ======================================================================
echo [imfile-endmsg.regex.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
Expand All @@ -28,7 +30,7 @@ if $msg contains "msgnum:" then
template="outfmt"
)
'
if [ "x${USE_VALGRIND:-false}" == "xtrue" ] ; then
if [ "${USE_VALGRIND:-false}" == "true" ] ; then
startup_vg
else
startup
Expand Down Expand Up @@ -65,7 +67,7 @@ echo 'date stdout F msgnum:6' >> $RSYSLOG_DYNNAME.crio.input
echo 'date stdout P msgnum:7' >> $RSYSLOG_DYNNAME.crio.input

shutdown_when_empty # shut down rsyslogd when done processing messages
if [ "x${USE_VALGRIND:-false}" == "xtrue" ] ; then
if [ "${USE_VALGRIND:-false}" == "true" ] ; then
wait_shutdown_vg
check_exit_vg
else
Expand Down
4 changes: 3 additions & 1 deletion tests/imfile-endregex-save-lf-persist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# This is part of the rsyslog testbench, licensed under ASL 2.0
echo ======================================================================
echo [imfile-endregex-save-lf-persist.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
File="./'$RSYSLOG_DYNNAME'.input"
Expand Down
4 changes: 3 additions & 1 deletion tests/imfile-endregex-save-lf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# endmsg.regex. It's kind of a base test for the regex functionality.
echo ======================================================================
echo [imfile-endregex-save-lf.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
File="./'$RSYSLOG_DYNNAME'.input"
Expand Down
5 changes: 3 additions & 2 deletions tests/imfile-endregex-timeout-none-polling.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
# This is part of the rsyslog testbench, licensed under ASL 2.0
echo ======================================================================
. ${srcdir:=.}/diag.sh init
if [ $(uname) = "SunOS" ] ; then
echo "Solaris: FIX ME"
exit 77
fi

. ${srcdir:=.}/diag.sh init
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile"
mode="polling"
pollingInterval="2"
Expand Down
4 changes: 3 additions & 1 deletion tests/imfile-endregex-timeout-none.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# This is part of the rsyslog testbench, licensed under ASL 2.0
echo ======================================================================
echo [imfile-endregex-timeout-none.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
File="./'$RSYSLOG_DYNNAME'.input"
Expand Down
6 changes: 3 additions & 3 deletions tests/imfile-endregex-timeout-polling.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash
# This is part of the rsyslog testbench, licensed under ASL 2.0
echo ======================================================================

. ${srcdir:=.}/diag.sh init
if [ $(uname) = "SunOS" ] ; then
echo "Solaris: FIX ME"
exit 77
fi

. ${srcdir:=.}/diag.sh init
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile"
mode="polling"
pollingInterval="2"
Expand Down
2 changes: 2 additions & 0 deletions tests/imfile-endregex-timeout-with-shutdown-polling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
. ${srcdir:=.}/diag.sh init
export IMFILECHECKTIMEOUT="60"

mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile" mode="polling" pollingInterval="1")
input(type="imfile"
Expand Down
2 changes: 2 additions & 0 deletions tests/imfile-endregex-timeout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
. $srcdir/diag.sh check-inotify-only
export IMFILECHECKTIMEOUT="60"

mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile" timeoutGranularity="1")
input(type="imfile" File="./'$RSYSLOG_DYNNAME'.input" Tag="file:"
Expand Down
2 changes: 2 additions & 0 deletions tests/imfile-endregex-vg.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash
# This is part of the rsyslog testbench, licensed under ASL 2.0
. ${srcdir:=.}/diag.sh init
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
Expand Down
4 changes: 3 additions & 1 deletion tests/imfile-endregex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# endmsg.regex. It's kind of a base test for the regex functionality.
echo ======================================================================
echo [imfile-endregex.sh]
. $srcdir/diag.sh check-inotify
. ${srcdir:=.}/diag.sh init
. $srcdir/diag.sh check-inotify
mkdir "$RSYSLOG_DYNNAME.work"
generate_conf
add_conf '
global(workDirectory="./'"$RSYSLOG_DYNNAME"'.work")
module(load="../plugins/imfile/.libs/imfile")
input(type="imfile"
Expand Down

0 comments on commit edf5c69

Please sign in to comment.