mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 09:50:43 +01:00
FreeBSD is not able to run all tests, therefore all tests that can't be run will be disabled.
56 lines
1.4 KiB
Bash
Executable File
56 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# add 2017-04-28 by Pascal Withopf, released under ASL 2.0
|
|
|
|
uname
|
|
if [ `uname` = "FreeBSD" ] ; then
|
|
echo "This test currently does not work on FreeBSD."
|
|
exit 77
|
|
fi
|
|
|
|
if [ `uname` = "SunOS" ] ; then
|
|
echo "Solaris: inotify isn't supported on Solaris"
|
|
exit 77
|
|
fi
|
|
|
|
. $srcdir/diag.sh init
|
|
. $srcdir/diag.sh generate-conf
|
|
. $srcdir/diag.sh add-conf '
|
|
module(load="../plugins/imfile/.libs/imfile")
|
|
input(type="imfile" File="./rsyslog.input" Tag="tag1" ruleset="ruleset1")
|
|
|
|
template(name="tmpl1" type="string" string="%msg%\n")
|
|
ruleset(name="ruleset1") {
|
|
action(type="omfile" file="rsyslog.out.log" template="tmpl1")
|
|
}
|
|
action(type="omfile" file="rsyslog2.out.log")
|
|
'
|
|
. $srcdir/diag.sh startup
|
|
./msleep 2000
|
|
|
|
echo 'testmessage1
|
|
testmessage2
|
|
testmessage3' > rsyslog.input
|
|
|
|
./msleep 2000
|
|
. $srcdir/diag.sh shutdown-when-empty
|
|
. $srcdir/diag.sh wait-shutdown
|
|
|
|
grep "file.*rsyslog.input.*No such file or directory" rsyslog2.out.log > /dev/null
|
|
if [ $? -ne 0 ]; then
|
|
echo
|
|
echo "FAIL: expected error message from missing input file not found. rsyslog2.out.log is:"
|
|
cat rsyslog2.out.log
|
|
. $srcdir/diag.sh error-exit 1
|
|
fi
|
|
|
|
echo 'testmessage1
|
|
testmessage2
|
|
testmessage3' | cmp rsyslog.out.log
|
|
if [ ! $? -eq 0 ]; then
|
|
echo "invalid response generated, rsyslog.out.log is:"
|
|
cat rsyslog.out.log
|
|
. $srcdir/diag.sh error-exit 1
|
|
fi;
|
|
|
|
. $srcdir/diag.sh exit
|