sysklogd/test/fwd.sh
Joachim Wiberg dbdc1cdf91 test: Update fwd.sh to ignore kernel logs
With the new support for /dev/kmsg the tests can run on a system that
already has a syslog daemon, and still receive all kernel messages.  We
want to ignore those in this (all?) tests and focus on the forwarding of
messages between two sysklogd.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-01-15 09:40:31 +01:00

32 lines
629 B
Bash
Executable File

#!/bin/sh
# Test FWD between two syslogd, second binds 127.0.0.2:5555
set -ex
if [ x"${srcdir}" = x ]; then
srcdir=.
fi
. ${srcdir}/test.rc
MSG="fwd and allow"
cat <<EOF >${CONFD}/fwd.conf
ntp.* @127.0.0.2:${PORT2} ;RFC5424
EOF
cat <<EOF >${CONFD2}/50-default.conf
kern.* /dev/null
*.*;kern.none ${LOG2} ;RFC5424
EOF
../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 &
echo "$!" > ${PID2}
kill -HUP `cat ${PID}`
sleep 2
# Enable debug for second syslogd
kill -USR1 `cat ${PID2}`
../src/logger -t fwd -p ntp.notice -u ${SOCK} -m "NTP123" ${MSG}
sleep 3
grep "fwd - NTP123 - ${MSG}" ${LOG2}